Index: chrome/browser/resources/print_preview/print_preview.js |
=================================================================== |
--- chrome/browser/resources/print_preview/print_preview.js (revision 105366) |
+++ chrome/browser/resources/print_preview/print_preview.js (working copy) |
@@ -171,6 +171,7 @@ |
return; |
showingSystemDialog = true; |
disableInputElementsInSidebar(); |
+ printHeader.disableCancelButton(); |
$('system-dialog-throbber').classList.remove('hidden'); |
chrome.send('showSystemDialog'); |
} |
@@ -190,40 +191,6 @@ |
} |
/** |
- * 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) { |
vandebo (ex-Chrome)
2011/10/14 07:14:05
The initiator tab can still crash. What happens n
Lei Zhang
2011/10/14 20:31:27
Sad tab takes over the tab and we lose the constra
|
- disableInputElementsInSidebar(); |
- if (initiatorTabURL) { |
- displayErrorMessageWithButton( |
- localStrings.getString('initiatorTabCrashed'), |
- localStrings.getString('reopenPage'), |
- function() { chrome.send('reloadCrashedInitiatorTab'); }); |
- } else { |
- displayErrorMessage(localStrings.getString('initiatorTabCrashed')); |
- } |
-} |
- |
-/** |
- * 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(); |
- if (initiatorTabURL) { |
- displayErrorMessageWithButton( |
- localStrings.getString('initiatorTabClosed'), |
- localStrings.getString('reopenPage'), |
- function() { window.location = initiatorTabURL; }); |
- } else { |
- displayErrorMessage(localStrings.getString('initiatorTabClosed')); |
- } |
-} |
- |
-/** |
* Gets the selected printer capabilities and updates the controls accordingly. |
*/ |
function updateControlsWithSelectedPrinterCapabilities() { |
@@ -532,7 +499,7 @@ |
* preview tab regarding the file selection cancel event. |
*/ |
function fileSelectionCancelled() { |
- // TODO(thestig) re-enable controls here. |
+ printHeader.enableCancelButton(); |
} |
/** |
@@ -1081,7 +1048,7 @@ |
* Closes this print preview tab. |
*/ |
function closePrintPreviewTab() { |
- chrome.send('closePrintPreviewTab'); |
+ chrome.send('DialogClose', []); |
} |
/** |
@@ -1094,6 +1061,13 @@ |
printHeader.disableCancelButton(); |
closePrintPreviewTab(); |
} |
+ if (e.keyCode == 80) { |
+ if ((cr.isMac && e.shiftKey && e.metaKey && !e.ctrlKey && !e.altKey) || |
kmadhusu
2011/10/14 00:21:09
On mac, we use cmd+opt+P and not cmd+shift+p
Lei Zhang
2011/10/14 20:31:27
Shows you how much I know about macs. :)
_
\_ is
|
+ (!cr.isMac && e.shiftKey && e.ctrlKey && !e.altKey && !e.metaKey)) { |
+ window.onkeydown = null; |
+ onSystemDialogLinkClicked(); |
+ } |
+ } |
} |
window.addEventListener('DOMContentLoaded', onLoad); |