| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // require: cr/ui/print_preview_cloud.js | 5 // require: cr/ui/print_preview_cloud.js |
| 6 | 6 |
| 7 var localStrings = new LocalStrings(); | 7 var localStrings = new LocalStrings(); |
| 8 | 8 |
| 9 // If useCloudPrint is true we attempt to connect to cloud print | 9 // If useCloudPrint is true we attempt to connect to cloud print |
| 10 // and populate the list of printers with cloud print printers. | 10 // and populate the list of printers with cloud print printers. |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 */ | 142 */ |
| 143 function launchNativePrintDialog() { | 143 function launchNativePrintDialog() { |
| 144 showingSystemDialog = true; | 144 showingSystemDialog = true; |
| 145 $('error-button').disabled = true; | 145 $('error-button').disabled = true; |
| 146 $('native-print-dialog-throbber').classList.remove('hidden'); | 146 $('native-print-dialog-throbber').classList.remove('hidden'); |
| 147 chrome.send('showSystemDialog'); | 147 chrome.send('showSystemDialog'); |
| 148 } | 148 } |
| 149 | 149 |
| 150 /** | 150 /** |
| 151 * Disables the controls which need the initiator tab to generate preview | 151 * Disables the controls which need the initiator tab to generate preview |
| 152 * data. This function is called when the initiator tab has crashed. |
| 153 * @param {string} initiatorTabURL The URL of the initiator tab. |
| 154 */ |
| 155 function onInitiatorTabCrashed(initiatorTabURL) { |
| 156 disableInputElementsInSidebar(); |
| 157 displayErrorMessageWithButton( |
| 158 localStrings.getString('initiatorTabCrashed'), |
| 159 localStrings.getString('reopenPage'), |
| 160 function() { chrome.send('reloadCrashedInitiatorTab'); }); |
| 161 } |
| 162 |
| 163 /** |
| 164 * Disables the controls which need the initiator tab to generate preview |
| 152 * data. This function is called when the initiator tab is closed. | 165 * data. This function is called when the initiator tab is closed. |
| 153 * @param {string} initiatorTabURL The URL of the initiator tab. | 166 * @param {string} initiatorTabURL The URL of the initiator tab. |
| 154 */ | 167 */ |
| 155 function onInitiatorTabClosed(initiatorTabURL) { | 168 function onInitiatorTabClosed(initiatorTabURL) { |
| 156 disableInputElementsInSidebar(); | 169 disableInputElementsInSidebar(); |
| 157 displayErrorMessageWithButton( | 170 displayErrorMessageWithButton( |
| 158 localStrings.getString('initiatorTabClosed'), | 171 localStrings.getString('initiatorTabClosed'), |
| 159 localStrings.getString('reopenPage'), | 172 localStrings.getString('reopenPage'), |
| 160 function() { window.location = initiatorTabURL; }); | 173 function() { window.location = initiatorTabURL; }); |
| 161 } | 174 } |
| (...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 939 | 952 |
| 940 /// Pull in all other scripts in a single shot. | 953 /// Pull in all other scripts in a single shot. |
| 941 <include src="print_preview_animations.js"/> | 954 <include src="print_preview_animations.js"/> |
| 942 <include src="print_preview_cloud.js"/> | 955 <include src="print_preview_cloud.js"/> |
| 943 <include src="print_preview_utils.js"/> | 956 <include src="print_preview_utils.js"/> |
| 944 <include src="print_header.js"/> | 957 <include src="print_header.js"/> |
| 945 <include src="page_settings.js"/> | 958 <include src="page_settings.js"/> |
| 946 <include src="copies_settings.js"/> | 959 <include src="copies_settings.js"/> |
| 947 <include src="layout_settings.js"/> | 960 <include src="layout_settings.js"/> |
| 948 <include src="color_settings.js"/> | 961 <include src="color_settings.js"/> |
| OLD | NEW |