Chromium Code Reviews| Index: chrome/browser/resources/print_preview.js |
| diff --git a/chrome/browser/resources/print_preview.js b/chrome/browser/resources/print_preview.js |
| index b9b935f8406d619802c192c6899e5381c9d9f776..515ddf6298803195fed0cdee5d88343ed2fbeedc 100644 |
| --- a/chrome/browser/resources/print_preview.js |
| +++ b/chrome/browser/resources/print_preview.js |
| @@ -47,7 +47,7 @@ function onLoad() { |
| $('cancel-button').addEventListener('click', handleCancelButtonClick); |
| if (!checkCompatiblePluginExists()) { |
| - displayErrorMessage(localStrings.getString('noPlugin')); |
| + displayErrorMessage(localStrings.getString('noPlugin'), false); |
| $('mainview').parentElement.removeChild($('dummy-viewer')); |
| return; |
| } |
| @@ -101,8 +101,10 @@ function showSystemDialog() { |
| * @param {string} initiatorTabURL The URL of the initiator tab. |
| */ |
| function onInitiatorTabClosed(initiatorTabURL) { |
| - displayErrorMessage(localStrings.getStringF('initiatorTabClosed', |
| - initiatorTabURL)); |
| + $('reopen-page').addEventListener('click', function() { |
|
Lei Zhang
2011/05/23 07:07:04
Show this go in onload()?
dpapad
2011/05/23 16:05:31
It cant go in onload() because |initiatorTabURL| i
|
| + window.location = initiatorTabURL; |
| + }); |
| + displayErrorMessage(localStrings.getString('initiatorTabClosed'), true); |
| } |
| /** |
| @@ -385,12 +387,14 @@ function setColor(color) { |
| * Display an error message in the center of the preview area. |
| * @param (string) errorMessage The error message to be displayed. |
|
Lei Zhang
2011/05/23 07:07:04
update comment.
dpapad
2011/05/23 16:05:31
Done.
|
| */ |
| -function displayErrorMessage(errorMessage) { |
| +function displayErrorMessage(errorMessage, showButton) { |
| isPreviewStillLoading = false; |
| $('dancing-dots').classList.remove('invisible'); |
| $('dancing-dots-text').classList.add('hidden'); |
| $('error-text').innerHTML = errorMessage; |
| $('error-text').classList.remove('hidden'); |
| + if (showButton) |
| + $('reopen-page').classList.remove('hidden'); |
|
Lei Zhang
2011/05/23 07:07:04
can we ever get into a situation where displayErro
dpapad
2011/05/23 16:05:31
I cant think of such a scenario, but I will add th
|
| setControlsDisabled(true); |
| var pdfViewer = $('pdf-viewer'); |
| @@ -403,7 +407,7 @@ function displayErrorMessage(errorMessage) { |
| * Called from PrintPreviewMessageHandler::OnPrintPreviewFailed(). |
| */ |
| function printPreviewFailed() { |
| - displayErrorMessage(localStrings.getString('previewFailed')); |
| + displayErrorMessage(localStrings.getString('previewFailed'), false); |
| } |
| /** |