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 var localStrings = new LocalStrings(templateData); | 7 var localStrings = new LocalStrings(templateData); |
8 | 8 |
9 <include src="component.js"/> | 9 <include src="component.js"/> |
10 | 10 |
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 cloudprint.CloudPrintInterface.EventType.SUBMIT_DONE, | 471 cloudprint.CloudPrintInterface.EventType.SUBMIT_DONE, |
472 this.onCloudPrintSubmitDone_.bind(this)); | 472 this.onCloudPrintSubmitDone_.bind(this)); |
473 this.tracker.add( | 473 this.tracker.add( |
474 this.cloudPrintInterface_, | 474 this.cloudPrintInterface_, |
475 cloudprint.CloudPrintInterface.EventType.ERROR, | 475 cloudprint.CloudPrintInterface.EventType.ERROR, |
476 this.onCloudPrintError_.bind(this)); | 476 this.onCloudPrintError_.bind(this)); |
477 | 477 |
478 this.userInfo_.setCloudPrintInterface(this.cloudPrintInterface_); | 478 this.userInfo_.setCloudPrintInterface(this.cloudPrintInterface_); |
479 this.destinationStore_.setCloudPrintInterface(this.cloudPrintInterface_); | 479 this.destinationStore_.setCloudPrintInterface(this.cloudPrintInterface_); |
480 this.destinationStore_.startLoadRecentCloudDestinations(); | 480 this.destinationStore_.startLoadRecentCloudDestinations(); |
| 481 if (this.destinationSearch_.getIsVisible()) { |
| 482 this.destinationStore_.startLoadAllCloudDestinations(); |
| 483 } |
481 }, | 484 }, |
482 | 485 |
483 /** | 486 /** |
484 * Called from the native layer when ready to print to Google Cloud Print. | 487 * Called from the native layer when ready to print to Google Cloud Print. |
485 * @param {cr.Event} event Contains the body to send in the HTTP request. | 488 * @param {cr.Event} event Contains the body to send in the HTTP request. |
486 * @private | 489 * @private |
487 */ | 490 */ |
488 onPrintToCloud_: function(event) { | 491 onPrintToCloud_: function(event) { |
489 assert(this.uiState_ == PrintPreview.UiState_.PRINTING, | 492 assert(this.uiState_ == PrintPreview.UiState_.PRINTING, |
490 'Document ready to be sent to the cloud when not in printing ' + | 493 'Document ready to be sent to the cloud when not in printing ' + |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
798 <include src="search/cloud_destination_list.js"/> | 801 <include src="search/cloud_destination_list.js"/> |
799 <include src="search/destination_list_item.js"/> | 802 <include src="search/destination_list_item.js"/> |
800 <include src="search/destination_search.js"/> | 803 <include src="search/destination_search.js"/> |
801 <include src="search/search_box.js"/> | 804 <include src="search/search_box.js"/> |
802 <include src="search/fedex_tos.js"/> | 805 <include src="search/fedex_tos.js"/> |
803 | 806 |
804 window.addEventListener('DOMContentLoaded', function() { | 807 window.addEventListener('DOMContentLoaded', function() { |
805 printPreview = new print_preview.PrintPreview(); | 808 printPreview = new print_preview.PrintPreview(); |
806 printPreview.initialize(); | 809 printPreview.initialize(); |
807 }); | 810 }); |
OLD | NEW |