Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Side by Side Diff: chrome/browser/resources/print_preview/data/destination_store.js

Issue 595153003: Compile print_preview, part 5: reduce down to 104 errors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@I_print_preview_4
Patch Set: revert movement of enums: now handle in compiler pass Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698