Show bugreport progress.

adb calls bugreportz to generate a bugreport; initially, bugreportz
would only report the final status of the operation (OK or FAIL), but
now it sends intermediate PROGRESS lines reporting its progress (in the
form of current/max).

Similarly, the initial implementation of 'adb bugreport <zip_file>'
would print an initial 'please wait' message and wait for the full
stdout before parsing the result, but now it uses a new callback class
to handle the stdout as it is generated by bugreportz.

BUG: 28609499

Change-Id: I6644fc39a686279e1635f946a47f3847b547d1c1
diff --git a/adb/bugreport.h b/adb/bugreport.h
index 1c39a9f..fd11a4a 100644
--- a/adb/bugreport.h
+++ b/adb/bugreport.h
@@ -21,12 +21,13 @@
 
 #include "adb.h"
 #include "commandline.h"
+#include "line_printer.h"
 
 class Bugreport {
     friend class BugreportStandardStreamsCallback;
 
   public:
-    Bugreport() {
+    Bugreport() : line_printer_() {
     }
     int DoIt(TransportType transport_type, const char* serial, int argc, const char** argv);
 
@@ -42,6 +43,9 @@
                             const char* name);
 
   private:
+    virtual void UpdateProgress(const std::string& file_name, int progress, int total,
+                                bool keep_info_line = false);
+    LinePrinter line_printer_;
     DISALLOW_COPY_AND_ASSIGN(Bugreport);
 };