| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 cr.exportPath('print_preview'); | 5 cr.exportPath('print_preview'); |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * The CDD (Cloud Device Description) describes the capabilities of a print | 8 * The CDD (Cloud Device Description) describes the capabilities of a print |
| 9 * destination. | 9 * destination. |
| 10 * | 10 * |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 * @param {string} id ID of the destination. | 43 * @param {string} id ID of the destination. |
| 44 * @param {!print_preview.Destination.Type} type Type of the destination. | 44 * @param {!print_preview.Destination.Type} type Type of the destination. |
| 45 * @param {!print_preview.Destination.Origin} origin Origin of the | 45 * @param {!print_preview.Destination.Origin} origin Origin of the |
| 46 * destination. | 46 * destination. |
| 47 * @param {string} displayName Display name of the destination. | 47 * @param {string} displayName Display name of the destination. |
| 48 * @param {boolean} isRecent Whether the destination has been used recently. | 48 * @param {boolean} isRecent Whether the destination has been used recently. |
| 49 * @param {!print_preview.Destination.ConnectionStatus} connectionStatus | 49 * @param {!print_preview.Destination.ConnectionStatus} connectionStatus |
| 50 * Connection status of the print destination. | 50 * Connection status of the print destination. |
| 51 * @param {{tags: (Array<string>|undefined), | 51 * @param {{tags: (Array<string>|undefined), |
| 52 * isOwned: (boolean|undefined), | 52 * isOwned: (boolean|undefined), |
| 53 * isEnterprisePrinter: (boolean|undefined), |
| 53 * account: (string|undefined), | 54 * account: (string|undefined), |
| 54 * lastAccessTime: (number|undefined), | 55 * lastAccessTime: (number|undefined), |
| 55 * isTosAccepted: (boolean|undefined), | 56 * isTosAccepted: (boolean|undefined), |
| 56 * cloudID: (string|undefined), | 57 * cloudID: (string|undefined), |
| 57 * provisionalType: | 58 * provisionalType: |
| 58 * (print_preview.Destination.ProvisionalType|undefined), | 59 * (print_preview.Destination.ProvisionalType|undefined), |
| 59 * extensionId: (string|undefined), | 60 * extensionId: (string|undefined), |
| 60 * extensionName: (string|undefined), | 61 * extensionName: (string|undefined), |
| 61 * description: (string|undefined)}=} opt_params Optional parameters | 62 * description: (string|undefined)}=} opt_params Optional parameters |
| 62 * for the destination. | 63 * for the destination. |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 */ | 107 */ |
| 107 this.capabilities_ = null; | 108 this.capabilities_ = null; |
| 108 | 109 |
| 109 /** | 110 /** |
| 110 * Whether the destination is owned by the user. | 111 * Whether the destination is owned by the user. |
| 111 * @private {boolean} | 112 * @private {boolean} |
| 112 */ | 113 */ |
| 113 this.isOwned_ = (opt_params && opt_params.isOwned) || false; | 114 this.isOwned_ = (opt_params && opt_params.isOwned) || false; |
| 114 | 115 |
| 115 /** | 116 /** |
| 117 * Whether the destination is an enterprise policy controlled printer. |
| 118 * @private {boolean} |
| 119 */ |
| 120 this.isEnterprisePrinter_ = |
| 121 (opt_params && opt_params.isEnterprisePrinter) || false; |
| 122 |
| 123 /** |
| 116 * Account this destination is registered for, if known. | 124 * Account this destination is registered for, if known. |
| 117 * @private {string} | 125 * @private {string} |
| 118 */ | 126 */ |
| 119 this.account_ = (opt_params && opt_params.account) || ''; | 127 this.account_ = (opt_params && opt_params.account) || ''; |
| 120 | 128 |
| 121 /** | 129 /** |
| 122 * Cache of destination location fetched from tags. | 130 * Cache of destination location fetched from tags. |
| 123 * @private {?string} | 131 * @private {?string} |
| 124 */ | 132 */ |
| 125 this.location_ = null; | 133 this.location_ = null; |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 */ | 275 */ |
| 268 Destination.IconUrl_ = { | 276 Destination.IconUrl_ = { |
| 269 CLOUD: 'images/printer.png', | 277 CLOUD: 'images/printer.png', |
| 270 CLOUD_SHARED: 'images/printer_shared.png', | 278 CLOUD_SHARED: 'images/printer_shared.png', |
| 271 LOCAL: 'images/printer.png', | 279 LOCAL: 'images/printer.png', |
| 272 MOBILE: 'images/mobile.png', | 280 MOBILE: 'images/mobile.png', |
| 273 MOBILE_SHARED: 'images/mobile_shared.png', | 281 MOBILE_SHARED: 'images/mobile_shared.png', |
| 274 THIRD_PARTY: 'images/third_party.png', | 282 THIRD_PARTY: 'images/third_party.png', |
| 275 PDF: 'images/pdf.png', | 283 PDF: 'images/pdf.png', |
| 276 DOCS: 'images/google_doc.png', | 284 DOCS: 'images/google_doc.png', |
| 277 FEDEX: 'images/third_party_fedex.png' | 285 FEDEX: 'images/third_party_fedex.png', |
| 286 ENTERPRISE: 'images/business.svg' |
| 278 }; | 287 }; |
| 279 | 288 |
| 280 Destination.prototype = { | 289 Destination.prototype = { |
| 281 /** @return {string} ID of the destination. */ | 290 /** @return {string} ID of the destination. */ |
| 282 get id() { | 291 get id() { |
| 283 return this.id_; | 292 return this.id_; |
| 284 }, | 293 }, |
| 285 | 294 |
| 286 /** @return {!print_preview.Destination.Type} Type of the destination. */ | 295 /** @return {!print_preview.Destination.Type} Type of the destination. */ |
| 287 get type() { | 296 get type() { |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 get iconUrl() { | 491 get iconUrl() { |
| 483 if (this.id_ == Destination.GooglePromotedId.DOCS) { | 492 if (this.id_ == Destination.GooglePromotedId.DOCS) { |
| 484 return Destination.IconUrl_.DOCS; | 493 return Destination.IconUrl_.DOCS; |
| 485 } | 494 } |
| 486 if (this.id_ == Destination.GooglePromotedId.FEDEX) { | 495 if (this.id_ == Destination.GooglePromotedId.FEDEX) { |
| 487 return Destination.IconUrl_.FEDEX; | 496 return Destination.IconUrl_.FEDEX; |
| 488 } | 497 } |
| 489 if (this.id_ == Destination.GooglePromotedId.SAVE_AS_PDF) { | 498 if (this.id_ == Destination.GooglePromotedId.SAVE_AS_PDF) { |
| 490 return Destination.IconUrl_.PDF; | 499 return Destination.IconUrl_.PDF; |
| 491 } | 500 } |
| 501 if (this.isEnterprisePrinter) { |
| 502 return Destination.IconUrl_.ENTERPRISE; |
| 503 } |
| 492 if (this.isLocal) { | 504 if (this.isLocal) { |
| 493 return Destination.IconUrl_.LOCAL; | 505 return Destination.IconUrl_.LOCAL; |
| 494 } | 506 } |
| 495 if (this.type_ == Destination.Type.MOBILE && this.isOwned_) { | 507 if (this.type_ == Destination.Type.MOBILE && this.isOwned_) { |
| 496 return Destination.IconUrl_.MOBILE; | 508 return Destination.IconUrl_.MOBILE; |
| 497 } | 509 } |
| 498 if (this.type_ == Destination.Type.MOBILE) { | 510 if (this.type_ == Destination.Type.MOBILE) { |
| 499 return Destination.IconUrl_.MOBILE_SHARED; | 511 return Destination.IconUrl_.MOBILE_SHARED; |
| 500 } | 512 } |
| 501 if (this.isOwned_) { | 513 if (this.isOwned_) { |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 551 get provisionalType() { | 563 get provisionalType() { |
| 552 return this.provisionalType_; | 564 return this.provisionalType_; |
| 553 }, | 565 }, |
| 554 | 566 |
| 555 /** | 567 /** |
| 556 * Whether the destinaion is provisional. | 568 * Whether the destinaion is provisional. |
| 557 * @return {boolean} | 569 * @return {boolean} |
| 558 */ | 570 */ |
| 559 get isProvisional() { | 571 get isProvisional() { |
| 560 return this.provisionalType_ != Destination.ProvisionalType.NONE; | 572 return this.provisionalType_ != Destination.ProvisionalType.NONE; |
| 561 } | 573 }, |
| 574 |
| 575 /** |
| 576 * Whether the printer is enterprise policy controlled printer. |
| 577 * @return {boolean} |
| 578 */ |
| 579 get isEnterprisePrinter() { |
| 580 return this.isEnterprisePrinter_; |
| 581 }, |
| 562 }; | 582 }; |
| 563 | 583 |
| 564 // Export | 584 // Export |
| 565 return { | 585 return { |
| 566 Destination: Destination, | 586 Destination: Destination, |
| 567 }; | 587 }; |
| 568 }); | 588 }); |
| OLD | NEW |