Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(207)

Unified Diff: chrome/browser/resources/print_preview/print_preview.js

Issue 7550063: Print Preview: Handle a crashed initiator tab by showing a message in PP. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: '' Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 35ec000338f2f92da3c38462ea19c040f2c210a9..ff6fad26a680fa8c453f52c313aeadb8a08df03f 100644
--- a/chrome/browser/resources/print_preview/print_preview.js
+++ b/chrome/browser/resources/print_preview/print_preview.js
@@ -82,7 +82,6 @@ function onLoad() {
cr.enablePlatformSpecificCSSRules();
if (!checkCompatiblePluginExists()) {
- disableInputElementsInSidebar();
displayErrorMessageWithButton(localStrings.getString('noPlugin'),
localStrings.getString('launchNativeDialog'),
launchNativePrintDialog);
@@ -162,11 +161,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') });
dpapad 2011/08/08 22:01:58 Nit: add a semicolon after chrome.send('reloadCras
kmadhusu 2011/08/10 16:46:59 Done.
+}
+
+/**
+ * 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'),
@@ -750,6 +760,8 @@ function displayErrorMessage(errorMessage) {
*/
function displayErrorMessageWithButton(
errorMessage, buttonText, buttonListener) {
+ disableInputElementsInSidebar();
+
var errorButton = $('error-button');
errorButton.disabled = false;
errorButton.textContent = buttonText;

Powered by Google App Engine
This is Rietveld 408576698