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

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

Issue 8136027: Print Preview: Make print preview tab modal. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: rebase, more fixes Created 9 years, 2 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
===================================================================
--- chrome/browser/resources/print_preview/print_preview.js (revision 105275)
+++ 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) {
- 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() {
@@ -1079,7 +1046,7 @@
* Closes this print preview tab.
*/
function closePrintPreviewTab() {
- chrome.send('closePrintPreviewTab');
+ chrome.send('DialogClose', []);
}
/**
@@ -1092,6 +1059,13 @@
printHeader.disableCancelButton();
closePrintPreviewTab();
}
+ if (e.keyCode == 80 || e.keyCode == 112) {
+ if ((cr.isMac && e.shiftKey && e.metaKey && !e.ctrlKey && !e.altKey) ||
kmadhusu 2011/10/13 18:52:18 Why do you need this? If we press the key combinat
Lei Zhang 2011/10/13 21:12:12 When the constrained window has focus, the browser
+ (!cr.isMac && e.shiftKey && e.ctrlKey && !e.altKey && !e.metaKey)) {
+ window.onkeydown = null;
+ onSystemDialogLinkClicked();
+ }
+ }
}
window.addEventListener('DOMContentLoaded', onLoad);

Powered by Google App Engine
This is Rietveld 408576698