Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(211)

Unified Diff: chrome/common/extensions/api/printer_provider.idl

Issue 530593002: Added chrome.printerProvider API definitions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Wed Oct 29 01:21:22 PDT 2014 Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..ab257b1c50ab97a60d119c85e186b2d27230a8f4
--- /dev/null
+++ b/chrome/common/extensions/api/printer_provider.idl
@@ -0,0 +1,61 @@
+// 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.
+
+// Use the <code>chrome.printerProvider</code> API to create print systems
+// 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
+namespace printerProvider {
+ // Error codes used by providing extensions in response to requests. For
+ // 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.
+ enum PrintError {
+ OK,
+ FAILED,
+ INVALID_TICKET,
+ INVALID_DATA
+ };
+
+ // Printer description for <code>onGetPrintersRequested()</code> event.
+ dictionary PrinterInfo {
+ // Unique id of printer.
+ DOMString printerId;
+
+ // Human readable display name of printer.
+ DOMString printerName;
+
+ // 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.
+ 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.
+ };
+
+ callback PrintersCallback = void(PrinterInfo[] printerInfo);
+ callback CapabilitiesCallback = void(object capabilities);
+ callback PrintCallback = void(PrintError result);
+
+ interface Events {
+ // 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.
+ // |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);
+
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.
+
+ // Event fired when print preview requests printing.
+ // |printerId| : unique id of the printer.
+ // |ticket| : print ticket in CJT format described at
+ // https://developers.google.com/cloud-print/docs/cdd#cjt
+ // |contentType| : content type of the document.
+ // |document| : buffer with the document.
+ static void onPrintRequested(DOMString printerId,
+ object ticket,
+ DOMString contentType,
+ 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
+ PrintCallback resultCallback);
+ };
+};
+

Powered by Google App Engine
This is Rietveld 408576698