Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(57)

Unified Diff: chrome/browser/ui/webui/print_preview/print_preview_handler.h

Issue 2948723002: Print Preview: Change print to cr.sendWithPromise (Closed)
Patch Set: Address comments and add close_ param Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/print_preview/print_preview_handler.h
diff --git a/chrome/browser/ui/webui/print_preview/print_preview_handler.h b/chrome/browser/ui/webui/print_preview/print_preview_handler.h
index f18848109b4f4ab42bbecf5d9e9d774ff9ceca67..985f287763ceee5d66c543a206b3eeb6ccb3ba12 100644
--- a/chrome/browser/ui/webui/print_preview/print_preview_handler.h
+++ b/chrome/browser/ui/webui/print_preview/print_preview_handler.h
@@ -248,7 +248,8 @@ class PrintPreviewHandler
void SendCloudPrintEnabled();
// Send the PDF data to the cloud to print.
- void SendCloudPrintJob(const base::RefCountedBytes* data);
+ void SendCloudPrintJob(const std::string& callback_id,
+ const base::RefCountedBytes* data);
// Gets the initiator for the print preview dialog.
content::WebContents* GetInitiator() const;
@@ -292,6 +293,7 @@ class PrintPreviewHandler
const std::string& callback_id,
std::unique_ptr<cloud_print::PrivetHTTPClient> http_client);
void PrivetLocalPrintUpdateClient(
+ const std::string& callback_id,
std::string print_ticket,
std::string capabilities,
gfx::Size page_size,
@@ -303,7 +305,8 @@ class PrintPreviewHandler
const std::string& capabilities,
const gfx::Size& page_size);
void SendPrivetCapabilitiesError(const std::string& id);
- void PrintToPrivetPrinter(const std::string& printer_name,
+ void PrintToPrivetPrinter(const std::string& callback_id,
+ const std::string& printer_name,
const std::string& print_ticket,
const std::string& capabilities,
const gfx::Size& page_size);
@@ -348,10 +351,13 @@ class PrintPreviewHandler
const base::DictionaryValue& capabilities);
// Called when an extension print job is completed.
+ // |callback_id|: The javascript callback to run.
// |success|: Whether the job succeeded.
// |status|: The returned print job status. Useful for reporting a specific
// error.
- void OnExtensionPrintResult(bool success, const std::string& status);
+ void OnExtensionPrintResult(const std::string& callback_id,
+ bool success,
+ const std::string& status);
// Register/unregister from notifications of changes done to the GAIA
// cookie.
@@ -406,8 +412,18 @@ class PrintPreviewHandler
// notify the test if it was a successful save, only that it was attempted.
base::Closure pdf_file_saved_closure_;
+#if BUILDFLAG(ENABLE_SERVICE_DISCOVERY)
// Callback ID to be used to notify UI that privet search is finished.
- std::string privet_callback_id_ = "";
+ std::string privet_search_callback_id_;
+
+ // Callback ID to be used to notify UI that privet printing is finished.
+ std::string privet_print_callback_id_;
+#endif
+
+ // Callback ID to be used to notify UI that PDF file selection has finished.
+ std::string pdf_callback_id_;
+
+ bool printing_started_ = false;
// Proxy for calls to the print backend. Lazily initialized since web_ui() is
// not available at construction time.

Powered by Google App Engine
This is Rietveld 408576698