Index: chrome/common/extensions/api/printer_provider.idl |
diff --git a/chrome/common/extensions/api/printer_provider.idl b/chrome/common/extensions/api/printer_provider.idl |
new file mode 100644 |
index 0000000000000000000000000000000000000000..6a33ff8a832834d4f6baaf22898ee9b12a1932f4 |
--- /dev/null |
+++ b/chrome/common/extensions/api/printer_provider.idl |
@@ -0,0 +1,79 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+// API provides set of events that should be handled by extension to discover |
+// 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:
|
+namespace printerProvider { |
+ // Error codes used by providing extensions in response to requests. |
+ enum PrintError { |
+ // Operation completed successfully. |
+ OK, |
+ |
+ // General failure. |
+ FAILED, |
+ |
+ // Print ticket is invalid. Extensions may not be able to handle all |
+ // 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.
|
+ // fail if possible. |
+ INVALID_TICKET, |
+ |
+ // 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.
|
+ // extension. |
+ INVALID_DATA |
+ }; |
+ |
+ // 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.
|
+ dictionary PrinterInfo { |
+ // 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.
|
+ DOMString id; |
+ |
+ // Human readable display name of printer. |
+ DOMString name; |
+ |
+ // Human readable description of printer. |
+ DOMString? description; |
+ }; |
+ |
+ // 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.
|
+ dictionary PrintJob { |
+ // Id of the printer to submit the job. |
+ DOMString printerId; |
+ |
+ // print ticket in CJT format described at |
+ // https://developers.google.com/cloud-print/docs/cdd#cjt |
+ object ticket; |
+ |
+ // Content type of the document. Supported formats are "application/pdf" and |
+ // "image/pwg-raster". |
+ DOMString contentType; |
+ |
+ // Buffer with document to printer. Format must match |contentType|. |
+ ArrayBuffer document; |
+ }; |
+ |
+ callback PrintersCallback = void(PrinterInfo[] printerInfo); |
+ callback CapabilitiesCallback = void(object capabilities); |
+ callback PrintCallback = void(PrintError result); |
+ |
+ interface Events { |
+ // 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
|
+ // |resultCallback| : callback to return printer list. Every listener must |
+ // call callback exactly once. |
+ static void onGetPrintersRequested(PrintersCallback resultCallback); |
+ |
+ // Event fired when print preview requests printer capabilities. |
+ // |printerId| : unique id of the printer. |
+ // |resultCallback| : callback to return device capabilities in CDD format |
+ // as described at https://developers.google.com/cloud-print/docs/cdd#cdd. |
+ // The receiving listener must call callback exectly once. |
+ static void onGetCapabilityRequested(DOMString printerId, |
+ CapabilitiesCallback resultCallback); |
+ |
+ // Event fired when print preview requests printing. |
+ // |printJob| : parameters of printing request. |
+ static void onPrintRequested(PrintJob printJob, |
+ PrintCallback resultCallback); |
+ }; |
+}; |
+ |