| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef EXTENSIONS_BROWSER_API_PRINTER_PROVIDER_INTERNAL_PRINTER_PROVIDER_INTERN
AL_API_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_PRINTER_PROVIDER_INTERNAL_PRINTER_PROVIDER_INTERN
AL_API_H_ |
| 6 #define EXTENSIONS_BROWSER_API_PRINTER_PROVIDER_INTERNAL_PRINTER_PROVIDER_INTERN
AL_API_H_ | 6 #define EXTENSIONS_BROWSER_API_PRINTER_PROVIDER_INTERNAL_PRINTER_PROVIDER_INTERN
AL_API_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/observer_list.h" | 9 #include "base/observer_list.h" |
| 10 #include "extensions/browser/api/printer_provider_internal/printer_provider_inte
rnal_api_observer.h" | 10 #include "extensions/browser/api/printer_provider_internal/printer_provider_inte
rnal_api_observer.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 void AddObserver(PrinterProviderInternalAPIObserver* observer); | 40 void AddObserver(PrinterProviderInternalAPIObserver* observer); |
| 41 void RemoveObserver(PrinterProviderInternalAPIObserver* observer); | 41 void RemoveObserver(PrinterProviderInternalAPIObserver* observer); |
| 42 | 42 |
| 43 private: | 43 private: |
| 44 friend class BrowserContextKeyedAPIFactory<PrinterProviderInternalAPI>; | 44 friend class BrowserContextKeyedAPIFactory<PrinterProviderInternalAPI>; |
| 45 friend class PrinterProviderInternalReportPrintersFunction; | 45 friend class PrinterProviderInternalReportPrintersFunction; |
| 46 friend class PrinterProviderInternalReportPrinterCapabilityFunction; | 46 friend class PrinterProviderInternalReportPrinterCapabilityFunction; |
| 47 friend class PrinterProviderInternalReportPrintResultFunction; | 47 friend class PrinterProviderInternalReportPrintResultFunction; |
| 48 | 48 |
| 49 // BrowserContextKeyedAPI implementation. |
| 50 static const bool kServiceRedirectedInIncognito = true; |
| 51 static const char* service_name() { return "PrinterProviderInternal"; } |
| 52 |
| 49 // Notifies observers that a printerProvider.onGetPrintersRequested callback | 53 // Notifies observers that a printerProvider.onGetPrintersRequested callback |
| 50 // has been called. Called from | 54 // has been called. Called from |
| 51 // |PrinterProviderInternalReportPrintersFunction|. | 55 // |PrinterProviderInternalReportPrintersFunction|. |
| 52 void NotifyGetPrintersResult( | 56 void NotifyGetPrintersResult( |
| 53 const Extension* extension, | 57 const Extension* extension, |
| 54 int request_id, | 58 int request_id, |
| 55 const PrinterProviderInternalAPIObserver::PrinterInfoVector& printers); | 59 const PrinterProviderInternalAPIObserver::PrinterInfoVector& printers); |
| 56 | 60 |
| 57 // Notifies observers that a printerProvider.onGetCapabilityRequested callback | 61 // Notifies observers that a printerProvider.onGetCapabilityRequested callback |
| 58 // has been called. Called from | 62 // has been called. Called from |
| 59 // |PrinterProviderInternalReportPrinterCapabilityFunction|. | 63 // |PrinterProviderInternalReportPrinterCapabilityFunction|. |
| 60 void NotifyGetCapabilityResult(const Extension* extension, | 64 void NotifyGetCapabilityResult(const Extension* extension, |
| 61 int request_id, | 65 int request_id, |
| 62 const base::DictionaryValue& capability); | 66 const base::DictionaryValue& capability); |
| 63 | 67 |
| 64 // Notifies observers that a printerProvider.onPrintRequested callback has | 68 // Notifies observers that a printerProvider.onPrintRequested callback has |
| 65 // been called. Called from | 69 // been called. Called from |
| 66 // |PrinterProviderInternalReportPrintResultFunction|. | 70 // |PrinterProviderInternalReportPrintResultFunction|. |
| 67 void NotifyPrintResult(const Extension* extension, | 71 void NotifyPrintResult(const Extension* extension, |
| 68 int request_id, | 72 int request_id, |
| 69 core_api::printer_provider_internal::PrintError error); | 73 core_api::printer_provider_internal::PrintError error); |
| 70 | 74 |
| 71 // BrowserContextKeyedAPI implementation. | |
| 72 static const char* service_name() { return "PrinterProviderInternal"; } | |
| 73 | |
| 74 ObserverList<PrinterProviderInternalAPIObserver> observers_; | 75 ObserverList<PrinterProviderInternalAPIObserver> observers_; |
| 75 | 76 |
| 76 DISALLOW_COPY_AND_ASSIGN(PrinterProviderInternalAPI); | 77 DISALLOW_COPY_AND_ASSIGN(PrinterProviderInternalAPI); |
| 77 }; | 78 }; |
| 78 | 79 |
| 79 class PrinterProviderInternalReportPrintResultFunction | 80 class PrinterProviderInternalReportPrintResultFunction |
| 80 : public UIThreadExtensionFunction { | 81 : public UIThreadExtensionFunction { |
| 81 public: | 82 public: |
| 82 PrinterProviderInternalReportPrintResultFunction(); | 83 PrinterProviderInternalReportPrintResultFunction(); |
| 83 | 84 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 private: | 124 private: |
| 124 DECLARE_EXTENSION_FUNCTION("printerProviderInternal.reportPrinters", | 125 DECLARE_EXTENSION_FUNCTION("printerProviderInternal.reportPrinters", |
| 125 PRINTERPROVIDERINTERNAL_REPORTPRINTERS) | 126 PRINTERPROVIDERINTERNAL_REPORTPRINTERS) |
| 126 | 127 |
| 127 DISALLOW_COPY_AND_ASSIGN(PrinterProviderInternalReportPrintersFunction); | 128 DISALLOW_COPY_AND_ASSIGN(PrinterProviderInternalReportPrintersFunction); |
| 128 }; | 129 }; |
| 129 | 130 |
| 130 } // namespace extensions | 131 } // namespace extensions |
| 131 | 132 |
| 132 #endif // EXTENSIONS_BROWSER_API_PRINTER_PROVIDER_INTERNAL_PRINTER_PROVIDER_INT
ERNAL_API_H_ | 133 #endif // EXTENSIONS_BROWSER_API_PRINTER_PROVIDER_INTERNAL_PRINTER_PROVIDER_INT
ERNAL_API_H_ |
| OLD | NEW |