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_OBSERVER_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_PRINTER_PROVIDER_INTERNAL_PRINTER_PROVIDER_INTERN
AL_API_OBSERVER_H_ |
6 #define EXTENSIONS_BROWSER_API_PRINTER_PROVIDER_INTERNAL_PRINTER_PROVIDER_INTERN
AL_API_OBSERVER_H_ | 6 #define EXTENSIONS_BROWSER_API_PRINTER_PROVIDER_INTERNAL_PRINTER_PROVIDER_INTERN
AL_API_OBSERVER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "extensions/common/api/printer_provider.h" | 10 #include "extensions/common/api/printer_provider.h" |
11 #include "extensions/common/api/printer_provider_internal.h" | 11 #include "extensions/common/api/printer_provider_internal.h" |
12 | 12 |
13 namespace base { | 13 namespace base { |
14 class DictionaryValue; | 14 class DictionaryValue; |
15 class ListValue; | 15 class ListValue; |
16 } | 16 } |
17 | 17 |
18 namespace extensions { | 18 namespace extensions { |
19 | 19 |
20 class Extension; | 20 class Extension; |
21 | 21 |
22 // Interface for observing chrome.printerProviderInternal API function calls. | 22 // Interface for observing chrome.printerProviderInternal API function calls. |
23 class PrinterProviderInternalAPIObserver { | 23 class PrinterProviderInternalAPIObserver { |
24 public: | 24 public: |
25 using PrinterInfoVector = | 25 using PrinterInfoVector = |
26 std::vector<linked_ptr<core_api::printer_provider::PrinterInfo>>; | 26 std::vector<linked_ptr<api::printer_provider::PrinterInfo>>; |
27 | 27 |
28 // Used by chrome.printerProviderInternal API to report | 28 // Used by chrome.printerProviderInternal API to report |
29 // chrome.printerProvider.onGetPrintersRequested result returned by the | 29 // chrome.printerProvider.onGetPrintersRequested result returned by the |
30 // extension |extension|. | 30 // extension |extension|. |
31 // |request_id| is the request id passed to the original | 31 // |request_id| is the request id passed to the original |
32 // chrome.printerProvider.onGetPrintersRequested event. | 32 // chrome.printerProvider.onGetPrintersRequested event. |
33 virtual void OnGetPrintersResult(const Extension* extension, | 33 virtual void OnGetPrintersResult(const Extension* extension, |
34 int request_id, | 34 int request_id, |
35 const PrinterInfoVector& result) = 0; | 35 const PrinterInfoVector& result) = 0; |
36 | 36 |
37 // Used by chrome.printerProviderInternal API to report | 37 // Used by chrome.printerProviderInternal API to report |
38 // chrome.printerProvider.onGetCapabilityRequested result returned by the | 38 // chrome.printerProvider.onGetCapabilityRequested result returned by the |
39 // extension |extensiod|. | 39 // extension |extensiod|. |
40 // |request_id| is the request id passed to the original | 40 // |request_id| is the request id passed to the original |
41 // chrome.printerProvider.onGetCapabilityRequested event. | 41 // chrome.printerProvider.onGetCapabilityRequested event. |
42 virtual void OnGetCapabilityResult(const Extension* extension, | 42 virtual void OnGetCapabilityResult(const Extension* extension, |
43 int request_id, | 43 int request_id, |
44 const base::DictionaryValue& result) = 0; | 44 const base::DictionaryValue& result) = 0; |
45 | 45 |
46 // Used by chrome.printerProviderInternal API to report | 46 // Used by chrome.printerProviderInternal API to report |
47 // chrome.printerProvider.onPrintRequested result returned by the extension | 47 // chrome.printerProvider.onPrintRequested result returned by the extension |
48 // |extension|. | 48 // |extension|. |
49 // |request_id| is the request id passed to the original | 49 // |request_id| is the request id passed to the original |
50 // chrome.printerProvider.onPrintRequested event. | 50 // chrome.printerProvider.onPrintRequested event. |
51 virtual void OnPrintResult( | 51 virtual void OnPrintResult( |
52 const Extension* extension, | 52 const Extension* extension, |
53 int request_id, | 53 int request_id, |
54 core_api::printer_provider_internal::PrintError error) = 0; | 54 api::printer_provider_internal::PrintError error) = 0; |
55 | 55 |
56 // Used by chrome.printerProviderInternal API to report | 56 // Used by chrome.printerProviderInternal API to report |
57 // chrome.printerProvider.onGetUsbPrinterInfoRequested result returned by the | 57 // chrome.printerProvider.onGetUsbPrinterInfoRequested result returned by the |
58 // extension |extension|. | 58 // extension |extension|. |
59 // |request_id| is the request id passed to the original | 59 // |request_id| is the request id passed to the original |
60 // chrome.printerProvider.onGetUsbPrinterInfoRequested event. | 60 // chrome.printerProvider.onGetUsbPrinterInfoRequested event. |
61 virtual void OnGetUsbPrinterInfoResult( | 61 virtual void OnGetUsbPrinterInfoResult( |
62 const Extension* extension, | 62 const Extension* extension, |
63 int request_id, | 63 int request_id, |
64 const core_api::printer_provider::PrinterInfo* printer_info) = 0; | 64 const api::printer_provider::PrinterInfo* printer_info) = 0; |
65 | 65 |
66 protected: | 66 protected: |
67 virtual ~PrinterProviderInternalAPIObserver() {} | 67 virtual ~PrinterProviderInternalAPIObserver() {} |
68 }; | 68 }; |
69 | 69 |
70 } // namespace extensions | 70 } // namespace extensions |
71 | 71 |
72 #endif // EXTENSIONS_BROWSER_API_PRINTER_PROVIDER_INTERNAL_PRINTER_PROVIDER_INT
ERNAL_API_OBSERVER_H_ | 72 #endif // EXTENSIONS_BROWSER_API_PRINTER_PROVIDER_INTERNAL_PRINTER_PROVIDER_INT
ERNAL_API_OBSERVER_H_ |
OLD | NEW |