| 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.define('print_preview', function() { | 5 cr.define('print_preview', function() { |
| 6 'use strict'; | 6 'use strict'; |
| 7 | 7 |
| 8 /** | 8 /** |
| 9 * A data store that stores destinations and dispatches events when the data | 9 * A data store that stores destinations and dispatches events when the data |
| 10 * store changes. | 10 * store changes. |
| (...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 mediaSize.option = categoryStandardNA; | 524 mediaSize.option = categoryStandardNA; |
| 525 mediaSize.option.push(...categoryStandardCN, ...categoryStandardISO, | 525 mediaSize.option.push(...categoryStandardCN, ...categoryStandardISO, |
| 526 ...categoryStandardJP, ...categoryStandardMisc, ...categoryCustom); | 526 ...categoryStandardJP, ...categoryStandardMisc, ...categoryCustom); |
| 527 return capabilities; | 527 return capabilities; |
| 528 }; | 528 }; |
| 529 | 529 |
| 530 DestinationStore.prototype = { | 530 DestinationStore.prototype = { |
| 531 __proto__: cr.EventTarget.prototype, | 531 __proto__: cr.EventTarget.prototype, |
| 532 | 532 |
| 533 /** | 533 /** |
| 534 * @param {string=} opt_account Account to filter destinations by. When | 534 * @param {?string=} opt_account Account to filter destinations by. When |
| 535 * omitted, all destinations are returned. | 535 * null or omitted, all destinations are returned. |
| 536 * @return {!Array<!print_preview.Destination>} List of destinations | 536 * @return {!Array<!print_preview.Destination>} List of destinations |
| 537 * accessible by the {@code account}. | 537 * accessible by the {@code account}. |
| 538 */ | 538 */ |
| 539 destinations: function(opt_account) { | 539 destinations: function(opt_account) { |
| 540 if (opt_account) { | 540 if (opt_account) { |
| 541 return this.destinations_.filter(function(destination) { | 541 return this.destinations_.filter(function(destination) { |
| 542 return !destination.account || destination.account == opt_account; | 542 return !destination.account || destination.account == opt_account; |
| 543 }); | 543 }); |
| 544 } | 544 } |
| 545 return this.destinations_.slice(0); | 545 return this.destinations_.slice(0); |
| (...skipping 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1696 return this.getDestinationKey_( | 1696 return this.getDestinationKey_( |
| 1697 destination.origin, destination.id, destination.account); | 1697 destination.origin, destination.id, destination.account); |
| 1698 } | 1698 } |
| 1699 }; | 1699 }; |
| 1700 | 1700 |
| 1701 // Export | 1701 // Export |
| 1702 return { | 1702 return { |
| 1703 DestinationStore: DestinationStore | 1703 DestinationStore: DestinationStore |
| 1704 }; | 1704 }; |
| 1705 }); | 1705 }); |
| OLD | NEW |