| Index: chrome/browser/resources/print_preview/data/destination.js
|
| diff --git a/chrome/browser/resources/print_preview/data/destination.js b/chrome/browser/resources/print_preview/data/destination.js
|
| index edce220a5ee90ffeeefcfb3a9a5f32978b014d4a..9648080350884de858fcb5bbe4512b1218cb74a7 100644
|
| --- a/chrome/browser/resources/print_preview/data/destination.js
|
| +++ b/chrome/browser/resources/print_preview/data/destination.js
|
| @@ -56,6 +56,7 @@ cr.define('print_preview', function() {
|
| * cloudID: (string|undefined),
|
| * extensionId: (string|undefined),
|
| * extensionName: (string|undefined),
|
| + * usbId: (number | undefined),
|
| * description: (string|undefined)}=} opt_params Optional parameters
|
| * for the destination.
|
| * @constructor
|
| @@ -167,6 +168,12 @@ cr.define('print_preview', function() {
|
| * @private {string}
|
| */
|
| this.extensionName_ = (opt_params && opt_params.extensionName) || '';
|
| +
|
| + /** @private {Destination.ProvisionalType} */
|
| + this.provisionalType_ = Destination.ProvisionalType.NONE;
|
| +
|
| + /** @private {?number} */
|
| + this.usbId_ = (opt_params && opt_params.usbId) || null;
|
| };
|
|
|
| /**
|
| @@ -225,6 +232,11 @@ cr.define('print_preview', function() {
|
| UNREGISTERED: 'UNREGISTERED'
|
| };
|
|
|
| + Destination.ProvisionalType = {
|
| + NONE: 'NONE',
|
| + NEEDS_USB_PERMISSION: 'NEEDS_USB_PERMISSION'
|
| + };
|
| +
|
| /**
|
| * Enumeration of relative icon URLs for various types of destinations.
|
| * @enum {string}
|
| @@ -501,6 +513,32 @@ cr.define('print_preview', function() {
|
| this.extraPropertiesToMatch.some(function(property) {
|
| return property.match(query);
|
| });
|
| + },
|
| +
|
| + /** @return {Destination.ProvisionalType} */
|
| + get provisionalType() {
|
| + return this.provisionalType_;
|
| + },
|
| +
|
| + /** @param {Destination.ProvisionalType} type */
|
| + set provisionalType(type) {
|
| + if (type == Destination.ProvisionalType.NEDS_USB_PERMISSION) {
|
| + assert(this.extensionId != null,
|
| + 'Provisional USB destination with no extension ID set.');
|
| + assert(this.usbId != null,
|
| + 'Provisional USB destination with no USB ID set.');
|
| + }
|
| + this.provisionalType_ = type;
|
| + },
|
| +
|
| + /** @return {boolean} */
|
| + get isProvisional() {
|
| + return this.provisionalType_ != Destination.ProvisionalType.NONE;
|
| + },
|
| +
|
| + /** @return {?number} */
|
| + get usbId() {
|
| + return this.usbId_;
|
| }
|
| };
|
|
|
|
|