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