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

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

Issue 588713002: Compile print_preview, part 3: reduce down to 185 errors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@I_print_preview_2
Patch Set: fix assert 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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 * Kiosk mode. 284 * Kiosk mode.
285 */ 285 */
286 init: function(isInAppKioskMode) { 286 init: function(isInAppKioskMode) {
287 this.pdfPrinterEnabled_ = !isInAppKioskMode; 287 this.pdfPrinterEnabled_ = !isInAppKioskMode;
288 this.isInAutoSelectMode_ = true; 288 this.isInAutoSelectMode_ = true;
289 this.createLocalPdfPrintDestination_(); 289 this.createLocalPdfPrintDestination_();
290 if (!this.appState_.selectedDestinationId || 290 if (!this.appState_.selectedDestinationId ||
291 !this.appState_.selectedDestinationOrigin) { 291 !this.appState_.selectedDestinationOrigin) {
292 this.selectDefaultDestination_(); 292 this.selectDefaultDestination_();
293 } else { 293 } else {
294 assert(typeof this.appState_.selectedDestinationAccount == 'string');
294 var key = this.getDestinationKey_( 295 var key = this.getDestinationKey_(
295 this.appState_.selectedDestinationOrigin, 296 this.appState_.selectedDestinationOrigin,
296 this.appState_.selectedDestinationId, 297 this.appState_.selectedDestinationId,
297 this.appState_.selectedDestinationAccount); 298 this.appState_.selectedDestinationAccount);
298 var candidate = this.destinationMap_[key]; 299 var candidate = this.destinationMap_[key];
299 if (candidate != null) { 300 if (candidate != null) {
300 this.selectDestination(candidate); 301 this.selectDestination(candidate);
301 } else if (this.appState_.selectedDestinationOrigin == 302 } else if (this.appState_.selectedDestinationOrigin ==
302 print_preview.Destination.Origin.LOCAL) { 303 print_preview.Destination.Origin.LOCAL) {
303 this.nativeLayer_.startGetLocalDestinationCapabilities( 304 this.nativeLayer_.startGetLocalDestinationCapabilities(
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after
951 return id == this.appState_.selectedDestinationId && 952 return id == this.appState_.selectedDestinationId &&
952 origin == this.appState_.selectedDestinationOrigin; 953 origin == this.appState_.selectedDestinationOrigin;
953 } 954 }
954 }; 955 };
955 956
956 // Export 957 // Export
957 return { 958 return {
958 DestinationStore: DestinationStore 959 DestinationStore: DestinationStore
959 }; 960 };
960 }); 961 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698