Commit f8993669 authored by tbarzic's avatar tbarzic Committed by Commit bot

Enable documentation for chrome.printerProvider API

Also, a small update to the documentation in idl file.

BUG=408772
TEST=Checked out server2/preview.py

Review URL: https://codereview.chromium.org/933353002

Cr-Commit-Position: refs/heads/master@{#317133}
parent 4fdad4d7
{{+partials.standard_apps_api api:apis.apps.printerProvider/}}
{{+partials.standard_extensions_api api:apis.extensions.printerProvider/}}
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// This API exposes events used by print manager to query printers controlled // The <code>chrome.printerProvider</code> API exposes events used by print
// by extensions, to query capabilities of them and to submit print jobs to // manager to query printers controlled by extensions, to query their
// these printers. // capabilities and to submit print jobs to these printers.
namespace printerProvider { namespace printerProvider {
// Error codes used by providing extensions in response to requests. // Error codes returned in response to $(ref:onPrintRequested) event.
enum PrintError { enum PrintError {
// Operation completed successfully. // Operation completed successfully.
OK, OK,
...@@ -20,59 +20,68 @@ namespace printerProvider { ...@@ -20,59 +20,68 @@ namespace printerProvider {
INVALID_TICKET, INVALID_TICKET,
// Document is invalid. For example, data may be corrupted or the format is // Document is invalid. For example, data may be corrupted or the format is
// incompatible with the Extension. // incompatible with the extension.
INVALID_DATA INVALID_DATA
}; };
// Printer description for $(ref:onGetPrintersRequested) event. // Printer description for $(ref:onGetPrintersRequested) event.
dictionary PrinterInfo { dictionary PrinterInfo {
// Unique ID of printer. // Unique printer ID.
DOMString id; DOMString id;
// Human readable display name of printer. // Printer's human readable name.
DOMString name; DOMString name;
// Human readable description of printer. // Printer's human readable description.
DOMString? description; DOMString? description;
}; };
// Parameters of $(ref:onPrintRequested). // Printing request parameters. Passed to $(ref:onPrintRequested) event.
dictionary PrintJob { dictionary PrintJob {
// ID of the printer to submit the job. // ID of the printer which should handle the job.
DOMString printerId; DOMString printerId;
// print ticket in CJT format described at // Print ticket in
// https://developers.google.com/cloud-print/docs/cdd#cjt // <a href="https://developers.google.com/cloud-print/docs/cdd#cjt">
// CJT format</a>.
object ticket; object ticket;
// Content type of the document. Supported formats are "application/pdf" and // The document content type. Supported formats are
// "image/pwg-raster". // <code>"application/pdf"</code> and <code>"image/pwg-raster"</code>.
DOMString contentType; DOMString contentType;
// Buffer with document to printer. Format must match |contentType|. // Buffer containing the document to print. Format must match |contentType|.
ArrayBuffer document; ArrayBuffer document;
}; };
callback PrintersCallback = void(PrinterInfo[] printerInfo); callback PrintersCallback = void(PrinterInfo[] printerInfo);
// |capabilities|: Device capabilities in
// <a href="https://developers.google.com/cloud-print/docs/cdd#cdd">CDD
// format</a>.
callback CapabilitiesCallback = void(object capabilities); callback CapabilitiesCallback = void(object capabilities);
callback PrintCallback = void(PrintError result); callback PrintCallback = void(PrintError result);
interface Events { interface Events {
// Event fired when print manager requests printers provided by extension. // Event fired when print manager requests printers provided by extensions.
// |resultCallback| : callback to return printer list. Every listener must // |resultCallback|: Callback to return printer list. Every listener must
// call callback exactly once. // call callback exactly once.
static void onGetPrintersRequested(PrintersCallback resultCallback); static void onGetPrintersRequested(PrintersCallback resultCallback);
// Event fired when print manager requests printer capabilities. // Event fired when print manager requests printer capabilities.
// |printerId| : unique ID of the printer. // |printerId|: Unique ID of the printer whose capabilities are requested.
// |resultCallback| : callback to return device capabilities in CDD format // |resultCallback|: Callback to return device capabilities in
// as described at https://developers.google.com/cloud-print/docs/cdd#cdd. // <a href="https://developers.google.com/cloud-print/docs/cdd#cdd">CDD
// format</a>.
// The receiving listener must call callback exectly once. // The receiving listener must call callback exectly once.
static void onGetCapabilityRequested(DOMString printerId, static void onGetCapabilityRequested(DOMString printerId,
CapabilitiesCallback resultCallback); CapabilitiesCallback resultCallback);
// Event fired when print manager requests printing. // Event fired when print manager requests printing.
// |printJob| : parameters of printing request. // |printJob|: The printing request parameters.
// |resultCallback|: Callback that should be called when the printing
// request is completed.
static void onPrintRequested(PrintJob printJob, static void onPrintRequested(PrintJob printJob,
PrintCallback resultCallback); PrintCallback resultCallback);
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment