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

Unified Diff: extensions/browser/api/printer_provider_internal/printer_provider_internal_api.h

Issue 1148383002: Add onGetUsbPrinterInfoRequested event to printerProvider API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Only include the permission granting part in this patch. 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_internal/printer_provider_internal_api.h
diff --git a/extensions/browser/api/printer_provider_internal/printer_provider_internal_api.h b/extensions/browser/api/printer_provider_internal/printer_provider_internal_api.h
index 611e3118ef8b9aada128d5adbc5a43f40e46feed..72d58fa1550fd06e68bfd457cf95c0ee49fb5dc4 100644
--- a/extensions/browser/api/printer_provider_internal/printer_provider_internal_api.h
+++ b/extensions/browser/api/printer_provider_internal/printer_provider_internal_api.h
@@ -48,6 +48,7 @@ class PrinterProviderInternalAPI : public BrowserContextKeyedAPI {
friend class PrinterProviderInternalReportPrintersFunction;
friend class PrinterProviderInternalReportPrinterCapabilityFunction;
friend class PrinterProviderInternalReportPrintResultFunction;
+ friend class PrinterProviderInternalReportUsbPrinterInfoFunction;
// BrowserContextKeyedAPI implementation.
static const bool kServiceRedirectedInIncognito = true;
@@ -75,6 +76,14 @@ class PrinterProviderInternalAPI : public BrowserContextKeyedAPI {
int request_id,
core_api::printer_provider_internal::PrintError error);
+ // Notifies observers that a printerProvider.onUsbAccessGranted callback has
+ // been called. Called from
+ // |PrinterProviderInternalReportUsbPrinterInfoFunction|.
+ void NotifyUsbAccessGrantedResult(
+ const Extension* extension,
+ int request_id,
+ const core_api::printer_provider::PrinterInfo* printer_info);
+
ObserverList<PrinterProviderInternalAPIObserver> observers_;
DISALLOW_COPY_AND_ASSIGN(PrinterProviderInternalAPI);
@@ -151,6 +160,22 @@ class PrinterProviderInternalGetPrintDataFunction
DISALLOW_COPY_AND_ASSIGN(PrinterProviderInternalGetPrintDataFunction);
};
+class PrinterProviderInternalReportUsbPrinterInfoFunction
+ : public UIThreadExtensionFunction {
+ public:
+ PrinterProviderInternalReportUsbPrinterInfoFunction();
+
+ protected:
+ ~PrinterProviderInternalReportUsbPrinterInfoFunction() override;
+ ExtensionFunction::ResponseAction Run() override;
+
+ private:
+ DECLARE_EXTENSION_FUNCTION("printerProviderInternal.reportUsbPrinterInfo",
+ PRINTERPROVIDERINTERNAL_REPORTUSBPRINTERINFO)
+
+ DISALLOW_COPY_AND_ASSIGN(PrinterProviderInternalReportUsbPrinterInfoFunction);
+};
+
} // namespace extensions
#endif // EXTENSIONS_BROWSER_API_PRINTER_PROVIDER_INTERNAL_PRINTER_PROVIDER_INTERNAL_API_H_

Powered by Google App Engine
This is Rietveld 408576698