| 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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 }); |
| OLD | NEW |