Chromium Code Reviews| 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 // API provides set of events that should be handled by extension to discover | |
| 6 // printers, get printer capabilities and to submit print jobs. | |
|
not at google - send to devlin
2014/10/30 14:51:28
Yes, thanks, this is a much better description (I
Vitaly Buka (NO REVIEWS)
2014/10/30 17:57:53
Done.
On 2014/10/30 14:51:28, kalman wrote:
| |
| 7 namespace printerProvider { | |
| 8 // Error codes used by providing extensions in response to requests. | |
| 9 enum PrintError { | |
| 10 // Operation completed successfully. | |
| 11 OK, | |
| 12 | |
| 13 // General failure. | |
| 14 FAILED, | |
| 15 | |
| 16 // Print ticket is invalid. Extensions may not be able to handle all | |
| 17 // settings from print ticket. It's recomeneded to ignore them and don't | |
|
not at google - send to devlin
2014/10/30 14:51:28
recommended
and perhaps "ignore this failure and
Vitaly Buka (NO REVIEWS)
2014/10/30 17:57:53
Done.
| |
| 18 // fail if possible. | |
| 19 INVALID_TICKET, | |
| 20 | |
| 21 // Document is invalid. If data is corrupted or format is incompartible with | |
|
not at google - send to devlin
2014/10/30 14:51:28
"If data is corrupted..." -> "For example, data ma
Vitaly Buka (NO REVIEWS)
2014/10/30 17:57:53
Done.
| |
| 22 // extension. | |
| 23 INVALID_DATA | |
| 24 }; | |
| 25 | |
| 26 // Printer description for <code>onGetPrintersRequested()</code> event. | |
|
not at google - send to devlin
2014/10/30 14:51:28
Rather than <code>onGetPrintersRequested</code> us
Vitaly Buka (NO REVIEWS)
2014/10/30 17:57:53
Done.
| |
| 27 dictionary PrinterInfo { | |
| 28 // Unique id of printer. | |
|
not at google - send to devlin
2014/10/30 14:51:28
"ID" everywhere, not "id".
Vitaly Buka (NO REVIEWS)
2014/10/30 17:57:53
Done.
| |
| 29 DOMString id; | |
| 30 | |
| 31 // Human readable display name of printer. | |
| 32 DOMString name; | |
| 33 | |
| 34 // Human readable description of printer. | |
| 35 DOMString? description; | |
| 36 }; | |
| 37 | |
| 38 // Parameters of |onPrintRequested|. | |
|
not at google - send to devlin
2014/10/30 14:51:28
Likewise.
Vitaly Buka (NO REVIEWS)
2014/10/30 17:57:53
Done.
| |
| 39 dictionary PrintJob { | |
| 40 // Id of the printer to submit the job. | |
| 41 DOMString printerId; | |
| 42 | |
| 43 // print ticket in CJT format described at | |
| 44 // https://developers.google.com/cloud-print/docs/cdd#cjt | |
| 45 object ticket; | |
| 46 | |
| 47 // Content type of the document. Supported formats are "application/pdf" and | |
| 48 // "image/pwg-raster". | |
| 49 DOMString contentType; | |
| 50 | |
| 51 // Buffer with document to printer. Format must match |contentType|. | |
| 52 ArrayBuffer document; | |
| 53 }; | |
| 54 | |
| 55 callback PrintersCallback = void(PrinterInfo[] printerInfo); | |
| 56 callback CapabilitiesCallback = void(object capabilities); | |
| 57 callback PrintCallback = void(PrintError result); | |
| 58 | |
| 59 interface Events { | |
| 60 // Event fired when print preview requests printers provided by extension. | |
|
not at google - send to devlin
2014/10/30 14:51:28
You mention "preview" in each of these event descr
Vitaly Buka (NO REVIEWS)
2014/10/30 17:57:53
On Chrome OS print preview is going to be the only
| |
| 61 // |resultCallback| : callback to return printer list. Every listener must | |
| 62 // call callback exactly once. | |
| 63 static void onGetPrintersRequested(PrintersCallback resultCallback); | |
| 64 | |
| 65 // Event fired when print preview requests printer capabilities. | |
| 66 // |printerId| : unique id of the printer. | |
| 67 // |resultCallback| : callback to return device capabilities in CDD format | |
| 68 // as described at https://developers.google.com/cloud-print/docs/cdd#cdd. | |
| 69 // The receiving listener must call callback exectly once. | |
| 70 static void onGetCapabilityRequested(DOMString printerId, | |
| 71 CapabilitiesCallback resultCallback); | |
| 72 | |
| 73 // Event fired when print preview requests printing. | |
| 74 // |printJob| : parameters of printing request. | |
| 75 static void onPrintRequested(PrintJob printJob, | |
| 76 PrintCallback resultCallback); | |
| 77 }; | |
| 78 }; | |
| 79 | |
| OLD | NEW |