| 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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 var key = this.getDestinationKey_( | 294 var key = this.getDestinationKey_( |
| 295 this.appState_.selectedDestinationOrigin, | 295 this.appState_.selectedDestinationOrigin, |
| 296 this.appState_.selectedDestinationId, | 296 this.appState_.selectedDestinationId, |
| 297 this.appState_.selectedDestinationAccount); | 297 assert(this.appState_.selectedDestinationAccount)); |
| 298 var candidate = this.destinationMap_[key]; | 298 var candidate = this.destinationMap_[key]; |
| 299 if (candidate != null) { | 299 if (candidate != null) { |
| 300 this.selectDestination(candidate); | 300 this.selectDestination(candidate); |
| 301 } else if (this.appState_.selectedDestinationOrigin == | 301 } else if (this.appState_.selectedDestinationOrigin == |
| 302 print_preview.Destination.Origin.LOCAL) { | 302 print_preview.Destination.Origin.LOCAL) { |
| 303 this.nativeLayer_.startGetLocalDestinationCapabilities( | 303 this.nativeLayer_.startGetLocalDestinationCapabilities( |
| 304 this.appState_.selectedDestinationId); | 304 this.appState_.selectedDestinationId); |
| 305 } else if (this.cloudPrintInterface_ && | 305 } else if (this.cloudPrintInterface_ && |
| 306 (this.appState_.selectedDestinationOrigin == | 306 (this.appState_.selectedDestinationOrigin == |
| 307 print_preview.Destination.Origin.COOKIES || | 307 print_preview.Destination.Origin.COOKIES || |
| (...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 928 return id == this.appState_.selectedDestinationId && | 928 return id == this.appState_.selectedDestinationId && |
| 929 origin == this.appState_.selectedDestinationOrigin; | 929 origin == this.appState_.selectedDestinationOrigin; |
| 930 } | 930 } |
| 931 }; | 931 }; |
| 932 | 932 |
| 933 // Export | 933 // Export |
| 934 return { | 934 return { |
| 935 DestinationStore: DestinationStore | 935 DestinationStore: DestinationStore |
| 936 }; | 936 }; |
| 937 }); | 937 }); |
| OLD | NEW |