Index: chrome/browser/resources/print_preview/print_preview.js |
diff --git a/chrome/browser/resources/print_preview/print_preview.js b/chrome/browser/resources/print_preview/print_preview.js |
index e6dfa3334bb39e663626421c5fd8ea531248b4aa..b585073d9da085f425576bd64ac7fd7a611a2f97 100644 |
--- a/chrome/browser/resources/print_preview/print_preview.js |
+++ b/chrome/browser/resources/print_preview/print_preview.js |
@@ -87,7 +87,6 @@ function onLoad() { |
lastPreviewRequestID = initialPreviewRequestID; |
if (!checkCompatiblePluginExists()) { |
- disableInputElementsInSidebar(); |
displayErrorMessageWithButton(localStrings.getString('noPlugin'), |
localStrings.getString('launchNativeDialog'), |
launchNativePrintDialog); |
@@ -149,11 +148,22 @@ function launchNativePrintDialog() { |
/** |
* Disables the controls which need the initiator tab to generate preview |
+ * data. This function is called when the initiator tab has crashed. |
+ * @param {string} initiatorTabURL The URL of the initiator tab. |
+ */ |
+function onInitiatorTabCrashed(initiatorTabURL) { |
+ displayErrorMessageWithButton( |
+ localStrings.getString('initiatorTabCrashed'), |
+ localStrings.getString('reopenPage'), |
+ function() { chrome.send('reloadCrashedInitiatorTab'); }); |
+} |
+ |
+/** |
+ * Disables the controls which need the initiator tab to generate preview |
* data. This function is called when the initiator tab is closed. |
* @param {string} initiatorTabURL The URL of the initiator tab. |
*/ |
function onInitiatorTabClosed(initiatorTabURL) { |
- disableInputElementsInSidebar(); |
displayErrorMessageWithButton( |
localStrings.getString('initiatorTabClosed'), |
localStrings.getString('reopenPage'), |
@@ -732,6 +742,8 @@ function setColor(color) { |
* @param {string} errorMessage The error message to be displayed. |
*/ |
function displayErrorMessage(errorMessage) { |
+ disableInputElementsInSidebar(); |
Lei Zhang
2011/08/16 00:59:23
This will change the behavior for printPreviewFail
kmadhusu
2011/08/16 01:31:37
Done.
|
+ |
$('print-button').disabled = true; |
$('overlay-layer').classList.remove('invisible'); |
$('dancing-dots-text').classList.add('hidden'); |
@@ -755,6 +767,8 @@ function displayErrorMessage(errorMessage) { |
*/ |
function displayErrorMessageWithButton( |
errorMessage, buttonText, buttonListener) { |
+ disableInputElementsInSidebar(); |
+ |
var errorButton = $('error-button'); |
errorButton.disabled = false; |
errorButton.textContent = buttonText; |