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

Side by Side Diff: extensions/common/api/printer_provider.idl

Issue 1148383002: Add onGetUsbPrinterInfoRequested event to printerProvider API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compilation of extension_printer_handler_unittest.cc. Created 5 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // The <code>chrome.printerProvider</code> API exposes events used by print 5 // The <code>chrome.printerProvider</code> API exposes events used by print
6 // manager to query printers controlled by extensions, to query their 6 // manager to query printers controlled by extensions, to query their
7 // capabilities and to submit print jobs to these printers. 7 // capabilities and to submit print jobs to these printers.
8 namespace printerProvider { 8 namespace printerProvider {
9 // Error codes returned in response to $(ref:onPrintRequested) event. 9 // Error codes returned in response to $(ref:onPrintRequested) event.
10 enum PrintError { 10 enum PrintError {
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 // <code>"application/pdf"</code> and <code>"image/pwg-raster"</code>. 53 // <code>"application/pdf"</code> and <code>"image/pwg-raster"</code>.
54 DOMString contentType; 54 DOMString contentType;
55 55
56 // Blob containing the document data to print. Format must match 56 // Blob containing the document data to print. Format must match
57 // |contentType|. 57 // |contentType|.
58 [instanceOf=Blob] object document; 58 [instanceOf=Blob] object document;
59 }; 59 };
60 60
61 callback PrintersCallback = void(PrinterInfo[] printerInfo); 61 callback PrintersCallback = void(PrinterInfo[] printerInfo);
62 62
63 callback PrinterInfoCallback = void(optional PrinterInfo printerInfo);
64
63 // |capabilities|: Device capabilities in 65 // |capabilities|: Device capabilities in
64 // <a href="https://developers.google.com/cloud-print/docs/cdd#cdd">CDD 66 // <a href="https://developers.google.com/cloud-print/docs/cdd#cdd">CDD
65 // format</a>. 67 // format</a>.
66 callback CapabilitiesCallback = void(object capabilities); 68 callback CapabilitiesCallback = void(object capabilities);
67 69
68 callback PrintCallback = void(PrintError result); 70 callback PrintCallback = void(PrintError result);
69 71
70 interface Events { 72 interface Events {
71 // Event fired when print manager requests printers provided by extensions. 73 // Event fired when print manager requests printers provided by extensions.
72 // |resultCallback|: Callback to return printer list. Every listener must 74 // |resultCallback|: Callback to return printer list. Every listener must
73 // call callback exactly once. 75 // call callback exactly once.
74 static void onGetPrintersRequested(PrintersCallback resultCallback); 76 static void onGetPrintersRequested(PrintersCallback resultCallback);
75 77
78 // Event fired when print manager requests information about a USB device
79 // that may be a printer.
tbarzic 2015/05/28 22:20:50 Add a note that the extension should not rely on t
Reilly Grant (use Gerrit) 2015/05/28 22:38:58 Done.
80 // |device|: The USB device.
81 // |resultCallback|: Callback to return printer info. The receiving listener
82 // must call callback exactly once. If the parameter to this callback is
83 // undefined that indicates that the application has determined that the
84 // device is not supported.
85 static void onGetUsbPrinterInfoRequested(
86 usb.Device device,
87 PrinterInfoCallback resultCallback);
88
76 // Event fired when print manager requests printer capabilities. 89 // Event fired when print manager requests printer capabilities.
77 // |printerId|: Unique ID of the printer whose capabilities are requested. 90 // |printerId|: Unique ID of the printer whose capabilities are requested.
78 // |resultCallback|: Callback to return device capabilities in 91 // |resultCallback|: Callback to return device capabilities in
79 // <a href="https://developers.google.com/cloud-print/docs/cdd#cdd">CDD 92 // <a href="https://developers.google.com/cloud-print/docs/cdd#cdd">CDD
80 // format</a>. 93 // format</a>.
81 // The receiving listener must call callback exectly once. 94 // The receiving listener must call callback exectly once.
82 static void onGetCapabilityRequested(DOMString printerId, 95 static void onGetCapabilityRequested(DOMString printerId,
83 CapabilitiesCallback resultCallback); 96 CapabilitiesCallback resultCallback);
84 97
85 // Event fired when print manager requests printing. 98 // Event fired when print manager requests printing.
86 // |printJob|: The printing request parameters. 99 // |printJob|: The printing request parameters.
87 // |resultCallback|: Callback that should be called when the printing 100 // |resultCallback|: Callback that should be called when the printing
88 // request is completed. 101 // request is completed.
89 static void onPrintRequested(PrintJob printJob, 102 static void onPrintRequested(PrintJob printJob,
90 PrintCallback resultCallback); 103 PrintCallback resultCallback);
91 }; 104 };
92 }; 105 };
93 106
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698