| 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 939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 950 // Pass certain directional keyboard events to the PDF viewer. | 950 // Pass certain directional keyboard events to the PDF viewer. |
| 951 this.previewArea_.handleDirectionalKeyEvent(e); | 951 this.previewArea_.handleDirectionalKeyEvent(e); |
| 952 }, | 952 }, |
| 953 | 953 |
| 954 /** | 954 /** |
| 955 * Called when native layer receives invalid settings for a print request. | 955 * Called when native layer receives invalid settings for a print request. |
| 956 * @private | 956 * @private |
| 957 */ | 957 */ |
| 958 onSettingsInvalid_: function() { | 958 onSettingsInvalid_: function() { |
| 959 this.uiState_ = PrintPreview.UiState_.ERROR; | 959 this.uiState_ = PrintPreview.UiState_.ERROR; |
| 960 this.isPreviewGenerationInProgress_ = false; |
| 961 this.printHeader_.isPrintButtonEnabled = false; |
| 960 console.error('Invalid settings error reported from native layer'); | 962 console.error('Invalid settings error reported from native layer'); |
| 963 this.previewArea_.cancelTimeout(); |
| 961 this.previewArea_.showCustomMessage( | 964 this.previewArea_.showCustomMessage( |
| 962 loadTimeData.getString('invalidPrinterSettings')); | 965 loadTimeData.getString('invalidPrinterSettings')); |
| 963 }, | 966 }, |
| 964 | 967 |
| 965 /** | 968 /** |
| 966 * Called when the destination settings' change button is activated. | 969 * Called when the destination settings' change button is activated. |
| 967 * Displays the destination search component. | 970 * Displays the destination search component. |
| 968 * @private | 971 * @private |
| 969 */ | 972 */ |
| 970 onDestinationChangeButtonActivate_: function() { | 973 onDestinationChangeButtonActivate_: function() { |
| (...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1362 // <include src="search/destination_list_item.js"> | 1365 // <include src="search/destination_list_item.js"> |
| 1363 // <include src="search/destination_search.js"> | 1366 // <include src="search/destination_search.js"> |
| 1364 // <include src="search/fedex_tos.js"> | 1367 // <include src="search/fedex_tos.js"> |
| 1365 // <include src="search/cros_destination_resolver.js"> | 1368 // <include src="search/cros_destination_resolver.js"> |
| 1366 // <include src="search/provisional_destination_resolver.js"> | 1369 // <include src="search/provisional_destination_resolver.js"> |
| 1367 | 1370 |
| 1368 window.addEventListener('DOMContentLoaded', function() { | 1371 window.addEventListener('DOMContentLoaded', function() { |
| 1369 printPreview = new print_preview.PrintPreview(); | 1372 printPreview = new print_preview.PrintPreview(); |
| 1370 printPreview.initialize(); | 1373 printPreview.initialize(); |
| 1371 }); | 1374 }); |
| OLD | NEW |