summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-23 10:28:20 +0000
committerthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-23 10:28:20 +0000
commit9e9a1743db15851b86086fc7486dd70ce07027f0 (patch)
tree318ef3ddd5f51224b3370e3301106ba2b48a2a00
parent7f994184c31d7172c0a0454e14dddf309eda3604 (diff)
downloadchromium_src-9e9a1743db15851b86086fc7486dd70ce07027f0.zip
chromium_src-9e9a1743db15851b86086fc7486dd70ce07027f0.tar.gz
chromium_src-9e9a1743db15851b86086fc7486dd70ce07027f0.tar.bz2
Print Preview: Don't display a reopen button when a print preview fails and there is no initiator tab url.
BUG=none TEST=The following HTML should cause print preview to fail. It should not have a reload button that does not work. <a href="#foo" onclick="return window.print()">test</a> Review URL: http://codereview.chromium.org/7711022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97845 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/resources/print_preview/print_preview.js24
1 files changed, 16 insertions, 8 deletions
diff --git a/chrome/browser/resources/print_preview/print_preview.js b/chrome/browser/resources/print_preview/print_preview.js
index ca49d74..124a567 100644
--- a/chrome/browser/resources/print_preview/print_preview.js
+++ b/chrome/browser/resources/print_preview/print_preview.js
@@ -159,10 +159,14 @@ function launchNativePrintDialog() {
*/
function onInitiatorTabCrashed(initiatorTabURL) {
disableInputElementsInSidebar();
- displayErrorMessageWithButton(
- localStrings.getString('initiatorTabCrashed'),
- localStrings.getString('reopenPage'),
- function() { chrome.send('reloadCrashedInitiatorTab'); });
+ if (initiatorTabURL) {
+ displayErrorMessageWithButton(
+ localStrings.getString('initiatorTabCrashed'),
+ localStrings.getString('reopenPage'),
+ function() { chrome.send('reloadCrashedInitiatorTab'); });
+ } else {
+ displayErrorMessage(localStrings.getString('initiatorTabCrashed'));
+ }
}
/**
@@ -172,10 +176,14 @@ function onInitiatorTabCrashed(initiatorTabURL) {
*/
function onInitiatorTabClosed(initiatorTabURL) {
disableInputElementsInSidebar();
- displayErrorMessageWithButton(
- localStrings.getString('initiatorTabClosed'),
- localStrings.getString('reopenPage'),
- function() { window.location = initiatorTabURL; });
+ if (initiatorTabURL) {
+ displayErrorMessageWithButton(
+ localStrings.getString('initiatorTabClosed'),
+ localStrings.getString('reopenPage'),
+ function() { window.location = initiatorTabURL; });
+ } else {
+ displayErrorMessage(localStrings.getString('initiatorTabClosed'));
+ }
}
/**