| 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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 media.name; | 223 media.name; |
| 224 } | 224 } |
| 225 } | 225 } |
| 226 return capabilities; | 226 return capabilities; |
| 227 }; | 227 }; |
| 228 | 228 |
| 229 DestinationStore.prototype = { | 229 DestinationStore.prototype = { |
| 230 __proto__: cr.EventTarget.prototype, | 230 __proto__: cr.EventTarget.prototype, |
| 231 | 231 |
| 232 /** | 232 /** |
| 233 * @param {string=} opt_account Account to filter destinations by. When | 233 * @param {?string=} opt_account Account to filter destinations by. When |
| 234 * omitted, all destinations are returned. | 234 * null or omitted, all destinations are returned. |
| 235 * @return {!Array.<!print_preview.Destination>} List of destinations | 235 * @return {!Array.<!print_preview.Destination>} List of destinations |
| 236 * accessible by the {@code account}. | 236 * accessible by the {@code account}. |
| 237 */ | 237 */ |
| 238 destinations: function(opt_account) { | 238 destinations: function(opt_account) { |
| 239 if (opt_account) { | 239 if (opt_account) { |
| 240 return this.destinations_.filter(function(destination) { | 240 return this.destinations_.filter(function(destination) { |
| 241 return !destination.account || destination.account == opt_account; | 241 return !destination.account || destination.account == opt_account; |
| 242 }); | 242 }); |
| 243 } else { | 243 } else { |
| 244 return this.destinations_.slice(0); | 244 return this.destinations_.slice(0); |
| (...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 951 return id == this.appState_.selectedDestinationId && | 951 return id == this.appState_.selectedDestinationId && |
| 952 origin == this.appState_.selectedDestinationOrigin; | 952 origin == this.appState_.selectedDestinationOrigin; |
| 953 } | 953 } |
| 954 }; | 954 }; |
| 955 | 955 |
| 956 // Export | 956 // Export |
| 957 return { | 957 return { |
| 958 DestinationStore: DestinationStore | 958 DestinationStore: DestinationStore |
| 959 }; | 959 }; |
| 960 }); | 960 }); |
| OLD | NEW |