OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2014 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. | |
4 | |
5 // Use the <code>chrome.printerProvider</code> API to create print systems | |
6 // which can be used from browser print preview. | |
not at google - send to devlin
2014/10/29 17:13:56
A better comment would be the one that you have in
Vitaly Buka (NO REVIEWS)
2014/10/30 00:43:43
Changed, but I am not sure which commend you are r
| |
7 namespace printerProvider { | |
8 // Error codes used by providing extensions in response to requests. For | |
9 // success, <code>OK</code> should be used. | |
not at google - send to devlin
2014/10/29 17:13:56
Consider adding comments to each enum value, and n
Vitaly Buka (NO REVIEWS)
2014/10/30 00:43:43
Done.
| |
10 enum PrintError { | |
11 OK, | |
12 FAILED, | |
13 INVALID_TICKET, | |
14 INVALID_DATA | |
15 }; | |
16 | |
17 // Printer description for <code>onGetPrintersRequested()</code> event. | |
18 dictionary PrinterInfo { | |
19 // Unique id of printer. | |
20 DOMString printerId; | |
21 | |
22 // Human readable display name of printer. | |
23 DOMString printerName; | |
24 | |
25 // Human readable description of printers. | |
not at google - send to devlin
2014/10/29 17:13:56
printers -> printer.
Vitaly Buka (NO REVIEWS)
2014/10/30 00:43:43
Done.
| |
26 DOMString? printerDescription; | |
not at google - send to devlin
2014/10/29 17:13:56
The "printer" in these names looks redundant given
Vitaly Buka (NO REVIEWS)
2014/10/30 00:43:43
Done.
| |
27 }; | |
28 | |
29 callback PrintersCallback = void(PrinterInfo[] printerInfo); | |
30 callback CapabilitiesCallback = void(object capabilities); | |
31 callback PrintCallback = void(PrintError result); | |
32 | |
33 interface Events { | |
34 // Event fired when print preview requests printer l | |
not at google - send to devlin
2014/10/29 17:13:56
"l"?
Vitaly Buka (NO REVIEWS)
2014/10/30 00:43:43
Done.
| |
35 // |resultCallback| : callback to return printer list. Every listener must | |
36 // call callback exactly once. | |
37 static void onGetPrintersRequested(PrintersCallback resultCallback); | |
38 | |
39 // Event fired when print preview requests printer capabilities. | |
40 // |printerId| : unique id of the printer. | |
41 // |resultCallback| : callback to return device capabilities in CDD format | |
42 // as described at https://developers.google.com/cloud-print/docs/cdd#cdd. | |
43 // The receiving listener must call callback exectly once. | |
44 static void onGetCapabilityRequested(DOMString printerId, | |
45 CapabilitiesCallback resultCallback); | |
46 | |
not at google - send to devlin
2014/10/29 17:13:56
extra blank line
Vitaly Buka (NO REVIEWS)
2014/10/30 00:43:43
Done.
| |
47 | |
48 // Event fired when print preview requests printing. | |
49 // |printerId| : unique id of the printer. | |
50 // |ticket| : print ticket in CJT format described at | |
51 // https://developers.google.com/cloud-print/docs/cdd#cjt | |
52 // |contentType| : content type of the document. | |
53 // |document| : buffer with the document. | |
54 static void onPrintRequested(DOMString printerId, | |
55 object ticket, | |
56 DOMString contentType, | |
57 ArrayBuffer document, | |
not at google - send to devlin
2014/10/29 17:13:56
Rather than long argument lists, use an object.
(
Vitaly Buka (NO REVIEWS)
2014/10/30 00:43:43
Done for this event.
No sure if about onGetCapabil
| |
58 PrintCallback resultCallback); | |
59 }; | |
60 }; | |
61 | |
OLD | NEW |