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

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

Issue 1148383002: Add onGetUsbPrinterInfoRequested event to printerProvider API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 5240f9e88927ce09c67131438692af8e32ecf551..35129115409cfaa7066c976ce5d801992a45e51e 100644
--- a/chrome/browser/ui/webui/print_preview/print_preview_handler.h
+++ b/chrome/browser/ui/webui/print_preview/print_preview_handler.h
@@ -21,6 +21,7 @@
#include "chrome/browser/local_discovery/service_discovery_shared_client.h"
#endif // ENABLE_SERVICE_DISCOVERY
+class ExtensionPrinterHandler;
class PrinterHandler;
class PrintPreviewUI;
class PrintSystemTaskProxy;
@@ -122,12 +123,16 @@ class PrintPreviewHandler
// Gets the list of printers. |args| is unused.
void HandleGetPrinters(const base::ListValue* args);
- // Starts getting all local privet printers. |arg| is unused.
+ // Starts getting all local privet printers. |args| is unused.
void HandleGetPrivetPrinters(const base::ListValue* args);
- // Starts getting all local extension managed printers. |arg| is unused.
+ // Starts getting all local extension managed printers. |args| is unused.
void HandleGetExtensionPrinters(const base::ListValue* args);
+ // Grants an extension access to a USB printer. First element of |args| is
+ // the extension ID and the second element is USB device ID.
+ void HandleGrantExtensionUsbPrinterAccess(const base::ListValue* args);
+
// Stops getting all local privet printers. |arg| is unused.
void HandleStopGetPrivetPrinters(const base::ListValue* args);
@@ -308,6 +313,15 @@ class PrintPreviewHandler
// they manage.
void OnGotPrintersForExtension(const base::ListValue& printers, bool done);
+ // Called when an extension reports information for a USB printer it has just
+ // been granted access to.
+ // |extension_id|: The extension that was queried.
+ // |device_id|: The id of the USB device.
+ // |printer_info|: The data reported by the extension.
+ void OnGotExtensionUsbPrinterInfo(const std::string& extension_id,
+ int device_id,
+ const base::DictionaryValue& printer_info);
+
// Called when an extension reports the set of print capabilites for a
// printer.
// |printer_id|: The id of the printer whose capabilities are reported.
@@ -372,7 +386,7 @@ class PrintPreviewHandler
// Handles requests for extension printers. Created lazily by calling
// |EnsureExtensionPrinterHandlerSet|.
- scoped_ptr<PrinterHandler> extension_printer_handler_;
+ scoped_ptr<ExtensionPrinterHandler> extension_printer_handler_;
// Notifies tests that want to know if the PDF has been saved. This doesn't
// notify the test if it was a successful save, only that it was attempted.

Powered by Google App Engine
This is Rietveld 408576698