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 // TODO(rltoscano): Move data/* into print_preview.data namespace | 5 // TODO(rltoscano): Move data/* into print_preview.data namespace |
6 | 6 |
7 <include src="component.js"> | 7 <include src="component.js"> |
8 <include src="print_preview_focus_manager.js"> | 8 <include src="print_preview_focus_manager.js"> |
9 | 9 |
10 cr.define('print_preview', function() { | 10 cr.define('print_preview', function() { |
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
627 assert(this.uiState_ == PrintPreview.UiState_.INITIALIZING, | 627 assert(this.uiState_ == PrintPreview.UiState_.INITIALIZING, |
628 'Updating initial settings when not in initializing state: ' + | 628 'Updating initial settings when not in initializing state: ' + |
629 this.uiState_); | 629 this.uiState_); |
630 this.uiState_ = PrintPreview.UiState_.READY; | 630 this.uiState_ = PrintPreview.UiState_.READY; |
631 | 631 |
632 var settings = event.initialSettings; | 632 var settings = event.initialSettings; |
633 this.isInKioskAutoPrintMode_ = settings.isInKioskAutoPrintMode; | 633 this.isInKioskAutoPrintMode_ = settings.isInKioskAutoPrintMode; |
634 this.isInAppKioskMode_ = settings.isInAppKioskMode; | 634 this.isInAppKioskMode_ = settings.isInAppKioskMode; |
635 | 635 |
636 // The following components must be initialized in this order. | 636 // The following components must be initialized in this order. |
637 this.appState_.init( | 637 this.appState_.init(settings.serializedAppStateStr); |
638 settings.serializedAppStateStr, | |
639 settings.systemDefaultDestinationId); | |
640 this.documentInfo_.init( | 638 this.documentInfo_.init( |
641 settings.isDocumentModifiable, | 639 settings.isDocumentModifiable, |
642 settings.documentTitle, | 640 settings.documentTitle, |
643 settings.documentHasSelection); | 641 settings.documentHasSelection); |
644 this.printTicketStore_.init( | 642 this.printTicketStore_.init( |
645 settings.thousandsDelimeter, | 643 settings.thousandsDelimeter, |
646 settings.decimalDelimeter, | 644 settings.decimalDelimeter, |
647 settings.unitType, | 645 settings.unitType, |
648 settings.selectionOnly); | 646 settings.selectionOnly); |
649 this.destinationStore_.init(settings.isInAppKioskMode); | 647 this.destinationStore_.init( |
| 648 settings.isInAppKioskMode, |
| 649 settings.systemDefaultDestinationId, |
| 650 settings.serializedDefaultDestinationSelectionRulesStr); |
650 this.appState_.setInitialized(); | 651 this.appState_.setInitialized(); |
651 | 652 |
652 $('document-title').innerText = settings.documentTitle; | 653 $('document-title').innerText = settings.documentTitle; |
653 this.hideSystemDialogLink_ = settings.hidePrintWithSystemDialogLink || | 654 this.hideSystemDialogLink_ = settings.hidePrintWithSystemDialogLink || |
654 settings.isInAppKioskMode; | 655 settings.isInAppKioskMode; |
655 if ($('system-dialog-link')) { | 656 if ($('system-dialog-link')) { |
656 setIsVisible($('system-dialog-link'), | 657 setIsVisible($('system-dialog-link'), |
657 this.shouldShowSystemDialogLink_()); | 658 this.shouldShowSystemDialogLink_()); |
658 } | 659 } |
659 }, | 660 }, |
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1326 <include src="search/recent_destination_list.js"> | 1327 <include src="search/recent_destination_list.js"> |
1327 <include src="search/destination_list_item.js"> | 1328 <include src="search/destination_list_item.js"> |
1328 <include src="search/destination_search.js"> | 1329 <include src="search/destination_search.js"> |
1329 <include src="search/fedex_tos.js"> | 1330 <include src="search/fedex_tos.js"> |
1330 <include src="search/provisional_destination_resolver.js"> | 1331 <include src="search/provisional_destination_resolver.js"> |
1331 | 1332 |
1332 window.addEventListener('DOMContentLoaded', function() { | 1333 window.addEventListener('DOMContentLoaded', function() { |
1333 printPreview = new print_preview.PrintPreview(); | 1334 printPreview = new print_preview.PrintPreview(); |
1334 printPreview.initialize(); | 1335 printPreview.initialize(); |
1335 }); | 1336 }); |
OLD | NEW |