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

Unified Diff: extensions/browser/api/printer_provider/printer_provider_api.h

Issue 1148383002: Add onGetUsbPrinterInfoRequested event to printerProvider API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. 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: extensions/browser/api/printer_provider/printer_provider_api.h
diff --git a/extensions/browser/api/printer_provider/printer_provider_api.h b/extensions/browser/api/printer_provider/printer_provider_api.h
index f499e5ecc88dbe0c75ec829c3d74ab2e118d1d91..2112a76be2742c9047aede078fc494f4de35c975 100644
--- a/extensions/browser/api/printer_provider/printer_provider_api.h
+++ b/extensions/browser/api/printer_provider/printer_provider_api.h
@@ -7,7 +7,8 @@
#include <string>
-#include "base/callback.h"
+#include "base/callback_forward.h"
+#include "base/memory/ref_counted.h"
#include "components/keyed_service/core/keyed_service.h"
namespace base {
@@ -19,6 +20,10 @@ namespace content {
class BrowserContext;
}
+namespace device {
+class UsbDevice;
+}
+
namespace extensions {
class Extension;
struct PrinterProviderPrintJob;
@@ -35,6 +40,8 @@ class PrinterProviderAPI : public KeyedService {
base::Callback<void(const base::DictionaryValue& capability)>;
using PrintCallback =
base::Callback<void(bool success, const std::string& error)>;
+ using GetPrinterInfoCallback =
+ base::Callback<void(const base::DictionaryValue& printer_info)>;
static PrinterProviderAPI* Create(content::BrowserContext* context);
@@ -82,6 +89,14 @@ class PrinterProviderAPI : public KeyedService {
// It should return NULL if the job for the request does not exist.
virtual const PrinterProviderPrintJob* GetPrintJob(const Extension* extension,
int request_id) const = 0;
+
+ // Dispatches a chrome.printerProvider.getUsbPrinterInfo event requesting
+ // information about |device_id|. The event is only dispatched to the
+ // extension identified by |extension_id|.
+ virtual void DispatchGetUsbPrinterInfoRequested(
+ const std::string& extension_id,
+ scoped_refptr<device::UsbDevice> device,
+ const PrinterProviderAPI::GetPrinterInfoCallback& callback) = 0;
};
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698