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 // printerProviderInternal
6 // Internal API used to run callbacks passed to chrome.printerProvider API
8 // When dispatching a chrome.printerProvider API event, its arguments will be
9 // massaged in custom bindings so a callback is added. The callback uses
10 // chrome.printerProviderInternal API to report the event results.
11 // In order to identify the event for which the callback is called, the event
12 // is internally dispatched having a requestId argument (which is removed from
13 // the argument list before the event actually reaches the event listeners). The
14 // requestId is forwarded to the chrome.printerProviderInternal API functions.
15 namespace printerProviderInternal
{
16 // Same as in printerProvider.PrintError enum API.
17 enum PrintError
{ OK
, FAILED
, INVALID_TICKET
, INVALID_DATA
};
20 // Runs callback to printerProvider.onGetPrintersRequested event.
21 // |requestId|: Parameter identifying the event instance for which the
23 // |printers|: List of printers reported by the extension.
24 void reportPrinters
(long requestId
,
25 optional printerProvider.PrinterInfo
[] printers
);
27 // Runs callback to printerProvider.onGetCapabilityRequested event.
28 // |requestId|: Parameter identifying the event instance for which the
30 // |error|: The printer capability returned by the extension.
31 void reportPrinterCapability
(long request_id
, optional object capability
);
33 // Runs callback to printerProvider.onPrintRequested event.
34 // |requestId|: Parameter identifying the event instance for which the
36 // |error|: The requested print job result.
37 void reportPrintResult
(long request_id
, optional PrintError error
);