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

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: Thu Oct 30 10:56:43 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
« no previous file with comments | « no previous file | chrome/common/extensions/api/schemas.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..a3b1b23a6259f009fb00ac56481cf2422b185b08
--- /dev/null
+++ b/chrome/common/extensions/api/printer_provider.idl
@@ -0,0 +1,80 @@
+// 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.
+
+// This API exposes events used by print manager to query printers controlled
+// by extensions, to query capabilities of them and to submit print jobs to
+// these printers.
+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. For example, ticket is inconsistent with
+ // capabilities or extension is not able to handle all settings from the
+ // ticket.
+ INVALID_TICKET,
+
+ // Document is invalid. For example, data may be corrupted or the format is
+ // incompatible with the Extension.
+ INVALID_DATA
+ };
+
+ // Printer description for $(ref:onGetPrintersRequested) event.
+ dictionary PrinterInfo {
+ // Unique ID of printer.
+ DOMString id;
+
+ // Human readable display name of printer.
+ DOMString name;
+
+ // Human readable description of printer.
+ DOMString? description;
+ };
+
+ // Parameters of $(ref:onPrintRequested).
+ 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 manager requests printers provided by extension.
+ // |resultCallback| : callback to return printer list. Every listener must
+ // call callback exactly once.
+ static void onGetPrintersRequested(PrintersCallback resultCallback);
+
+ // Event fired when print manager 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 manager requests printing.
+ // |printJob| : parameters of printing request.
+ static void onPrintRequested(PrintJob printJob,
+ PrintCallback resultCallback);
+ };
+};
+
« no previous file with comments | « no previous file | chrome/common/extensions/api/schemas.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698