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

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: 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..33a078353a097e5c573fa7e80228b0f4744570e4 100644
--- a/extensions/browser/api/printer_provider/printer_provider_api.h
+++ b/extensions/browser/api/printer_provider/printer_provider_api.h
@@ -19,6 +19,10 @@ namespace content {
class BrowserContext;
}
+namespace device {
+class UsbDevice;
+}
+
namespace extensions {
class Extension;
struct PrinterProviderPrintJob;
@@ -35,6 +39,8 @@ class PrinterProviderAPI : public KeyedService {
base::Callback<void(const base::DictionaryValue& capability)>;
using PrintCallback =
base::Callback<void(bool success, const std::string& error)>;
+ using UsbAccessGrantedCallback =
+ base::Callback<void(const base::DictionaryValue& printer_info)>;
static PrinterProviderAPI* Create(content::BrowserContext* context);
@@ -82,6 +88,12 @@ 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;
+
+ // Notifies the given extension that it has been granted access to the given
+ virtual void DispatchGrantUsbPrinterAccess(
+ const std::string& extension_id,
+ int device_id,
+ const PrinterProviderAPI::UsbAccessGrantedCallback& callback) = 0;
};
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698