| 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 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 * Called from the native layer when ready to print to Google Cloud Print. | 502 * Called from the native layer when ready to print to Google Cloud Print. |
| 503 * @param {cr.Event} event Contains the body to send in the HTTP request. | 503 * @param {cr.Event} event Contains the body to send in the HTTP request. |
| 504 * @private | 504 * @private |
| 505 */ | 505 */ |
| 506 onPrintToCloud_: function(event) { | 506 onPrintToCloud_: function(event) { |
| 507 assert(this.uiState_ == PrintPreview.UiState_.PRINTING, | 507 assert(this.uiState_ == PrintPreview.UiState_.PRINTING, |
| 508 'Document ready to be sent to the cloud when not in printing ' + | 508 'Document ready to be sent to the cloud when not in printing ' + |
| 509 'state: ' + this.uiState_); | 509 'state: ' + this.uiState_); |
| 510 assert(this.cloudPrintInterface_ != null, | 510 assert(this.cloudPrintInterface_ != null, |
| 511 'Google Cloud Print is not enabled'); | 511 'Google Cloud Print is not enabled'); |
| 512 this.cloudPrintInterface_.submit(event.data); | 512 this.cloudPrintInterface_.submit( |
| 513 this.destinationStore_.selectedDestination, |
| 514 this.printTicketStore_, |
| 515 event.data); |
| 513 }, | 516 }, |
| 514 | 517 |
| 515 /** | 518 /** |
| 516 * Called from the native layer when the user cancels the save-to-pdf file | 519 * Called from the native layer when the user cancels the save-to-pdf file |
| 517 * selection dialog. | 520 * selection dialog. |
| 518 * @private | 521 * @private |
| 519 */ | 522 */ |
| 520 onFileSelectionCancel_: function() { | 523 onFileSelectionCancel_: function() { |
| 521 assert(this.uiState_ == PrintPreview.UiState_.FILE_SELECTION, | 524 assert(this.uiState_ == PrintPreview.UiState_.FILE_SELECTION, |
| 522 'File selection cancelled when not in file-selection state: ' + | 525 'File selection cancelled when not in file-selection state: ' + |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 842 <include src="search/recent_destination_list.js"/> | 845 <include src="search/recent_destination_list.js"/> |
| 843 <include src="search/destination_list_item.js"/> | 846 <include src="search/destination_list_item.js"/> |
| 844 <include src="search/destination_search.js"/> | 847 <include src="search/destination_search.js"/> |
| 845 <include src="search/search_box.js"/> | 848 <include src="search/search_box.js"/> |
| 846 <include src="search/fedex_tos.js"/> | 849 <include src="search/fedex_tos.js"/> |
| 847 | 850 |
| 848 window.addEventListener('DOMContentLoaded', function() { | 851 window.addEventListener('DOMContentLoaded', function() { |
| 849 printPreview = new print_preview.PrintPreview(); | 852 printPreview = new print_preview.PrintPreview(); |
| 850 printPreview.initialize(); | 853 printPreview.initialize(); |
| 851 }); | 854 }); |
| OLD | NEW |