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
3 // found in the LICENSE file.
5 #ifndef EXTENSIONS_BROWSER_API_PRINTER_PROVIDER_INTERNAL_PRINTER_PROVIDER_INTERNAL_API_OBSERVER_H_
6 #define EXTENSIONS_BROWSER_API_PRINTER_PROVIDER_INTERNAL_PRINTER_PROVIDER_INTERNAL_API_OBSERVER_H_
10 #include "extensions/common/api/printer_provider.h"
11 #include "extensions/common/api/printer_provider_internal.h"
14 class DictionaryValue
;
18 namespace extensions
{
22 // Interface for observing chrome.printerProviderInternal API function calls.
23 class PrinterProviderInternalAPIObserver
{
25 using PrinterInfoVector
=
26 std::vector
<linked_ptr
<api::printer_provider::PrinterInfo
>>;
28 // Used by chrome.printerProviderInternal API to report
29 // chrome.printerProvider.onGetPrintersRequested result returned by the
30 // extension |extension|.
31 // |request_id| is the request id passed to the original
32 // chrome.printerProvider.onGetPrintersRequested event.
33 virtual void OnGetPrintersResult(const Extension
* extension
,
35 const PrinterInfoVector
& result
) = 0;
37 // Used by chrome.printerProviderInternal API to report
38 // chrome.printerProvider.onGetCapabilityRequested result returned by the
39 // extension |extensiod|.
40 // |request_id| is the request id passed to the original
41 // chrome.printerProvider.onGetCapabilityRequested event.
42 virtual void OnGetCapabilityResult(const Extension
* extension
,
44 const base::DictionaryValue
& result
) = 0;
46 // Used by chrome.printerProviderInternal API to report
47 // chrome.printerProvider.onPrintRequested result returned by the extension
49 // |request_id| is the request id passed to the original
50 // chrome.printerProvider.onPrintRequested event.
51 virtual void OnPrintResult(
52 const Extension
* extension
,
54 api::printer_provider_internal::PrintError error
) = 0;
56 // Used by chrome.printerProviderInternal API to report
57 // chrome.printerProvider.onGetUsbPrinterInfoRequested result returned by the
58 // extension |extension|.
59 // |request_id| is the request id passed to the original
60 // chrome.printerProvider.onGetUsbPrinterInfoRequested event.
61 virtual void OnGetUsbPrinterInfoResult(
62 const Extension
* extension
,
64 const api::printer_provider::PrinterInfo
* printer_info
) = 0;
67 virtual ~PrinterProviderInternalAPIObserver() {}
70 } // namespace extensions
72 #endif // EXTENSIONS_BROWSER_API_PRINTER_PROVIDER_INTERNAL_PRINTER_PROVIDER_INTERNAL_API_OBSERVER_H_