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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 var els = $('sidebar').querySelectorAll('input, button, select'); | 133 var els = $('sidebar').querySelectorAll('input, button, select'); |
134 for (var i = 0; i < els.length; i++) | 134 for (var i = 0; i < els.length; i++) |
135 els[i].disabled = true; | 135 els[i].disabled = true; |
136 } | 136 } |
137 | 137 |
138 /** | 138 /** |
139 * Disables the controls in the sidebar, shows the throbber and instructs the | 139 * Disables the controls in the sidebar, shows the throbber and instructs the |
140 * backend to open the native print dialog. | 140 * backend to open the native print dialog. |
141 */ | 141 */ |
142 function onSystemDialogLinkClicked() { | 142 function onSystemDialogLinkClicked() { |
| 143 if (showingSystemDialog) |
| 144 return; |
143 showingSystemDialog = true; | 145 showingSystemDialog = true; |
144 disableInputElementsInSidebar(); | 146 disableInputElementsInSidebar(); |
145 $('system-dialog-throbber').classList.remove('hidden'); | 147 $('system-dialog-throbber').classList.remove('hidden'); |
146 chrome.send('showSystemDialog'); | 148 chrome.send('showSystemDialog'); |
147 } | 149 } |
148 | 150 |
149 /** | 151 /** |
150 * Similar to onSystemDialogLinkClicked(), but specific to the | 152 * Similar to onSystemDialogLinkClicked(), but specific to the |
151 * 'Launch native print dialog' UI. | 153 * 'Launch native print dialog' UI. |
152 */ | 154 */ |
153 function launchNativePrintDialog() { | 155 function launchNativePrintDialog() { |
| 156 if (showingSystemDialog) |
| 157 return; |
154 showingSystemDialog = true; | 158 showingSystemDialog = true; |
155 $('error-button').disabled = true; | 159 $('error-button').disabled = true; |
156 $('native-print-dialog-throbber').classList.remove('hidden'); | 160 $('native-print-dialog-throbber').classList.remove('hidden'); |
157 chrome.send('showSystemDialog'); | 161 chrome.send('showSystemDialog'); |
158 } | 162 } |
159 | 163 |
160 /** | 164 /** |
161 * Disables the controls which need the initiator tab to generate preview | 165 * Disables the controls which need the initiator tab to generate preview |
162 * data. This function is called when the initiator tab has crashed. | 166 * data. This function is called when the initiator tab has crashed. |
163 * @param {string} initiatorTabURL The URL of the initiator tab. | 167 * @param {string} initiatorTabURL The URL of the initiator tab. |
(...skipping 816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
980 <include src="print_preview_animations.js"/> | 984 <include src="print_preview_animations.js"/> |
981 <include src="print_preview_cloud.js"/> | 985 <include src="print_preview_cloud.js"/> |
982 <include src="print_preview_utils.js"/> | 986 <include src="print_preview_utils.js"/> |
983 <include src="print_header.js"/> | 987 <include src="print_header.js"/> |
984 <include src="page_settings.js"/> | 988 <include src="page_settings.js"/> |
985 <include src="copies_settings.js"/> | 989 <include src="copies_settings.js"/> |
986 <include src="header_footer_settings.js"/> | 990 <include src="header_footer_settings.js"/> |
987 <include src="layout_settings.js"/> | 991 <include src="layout_settings.js"/> |
988 <include src="color_settings.js"/> | 992 <include src="color_settings.js"/> |
989 <include src="margin_settings.js"/> | 993 <include src="margin_settings.js"/> |
OLD | NEW |