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

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

Issue 9006027: Rip Out the Sidebar API (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 9 years 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 115251)
+++ chrome/browser/resources/print_preview/print_preview.js (working copy)
@@ -149,7 +149,6 @@
cancelPendingPrintRequest);
if (!checkCompatiblePluginExists()) {
- disableInputElementsInSidebar();
$('cancel-button').focus();
previewArea.displayErrorMessageWithButtonAndNotify(
localStrings.getString('noPlugin'),
@@ -200,49 +199,25 @@
}
/**
- * Disables the input elements in the sidebar.
+ * Shows the throbber and instructs the backend to open the native print dialog.
*/
-function disableInputElementsInSidebar() {
- var els = $('navbar-container').querySelectorAll('input, button, select');
- for (var i = 0; i < els.length; i++) {
- if (els[i] == printHeader.cancelButton)
- continue;
- els[i].disabled = true;
- }
-}
-
-/**
- * Enables the input elements in the sidebar.
- */
-function enableInputElementsInSidebar() {
- var els = $('navbar-container').querySelectorAll('input, button, select');
- for (var i = 0; i < els.length; i++)
- els[i].disabled = false;
-}
-
-/**
- * Disables the controls in the sidebar, shows the throbber and instructs the
- * backend to open the native print dialog.
- */
function onSystemDialogLinkClicked() {
if (showingSystemDialog)
return;
showingSystemDialog = true;
- disableInputElementsInSidebar();
printHeader.disableCancelButton();
$('system-dialog-throbber').hidden = false;
chrome.send('showSystemDialog');
}
/**
- * Disables the controls in the sidebar, shows the throbber and instructs the
- * backend to open the pdf in native preview app. This is only for Mac.
+ * Shows the throbber and instructs the backend to open the pdf in native
+ * preview app. This is only for Mac.
*/
function onOpenPdfInPreviewLinkClicked() {
if (previewAppRequested)
return;
previewAppRequested = true;
- disableInputElementsInSidebar();
$('open-preview-app-throbber').hidden = false;
printHeader.disableCancelButton();
requestToPrintDocument();
@@ -509,7 +484,6 @@
} else if (printWithCloudPrint) {
previewArea.showCustomMessage(
localStrings.getString('printWithCloudPrintWait'));
- disableInputElementsInSidebar();
} else {
isTabHidden = true;
chrome.send('hidePreview');
@@ -611,7 +585,6 @@
function fileSelectionCompleted() {
// If the file selection is completed and the tab is not already closed it
// means that a pending print to pdf request exists.
- disableInputElementsInSidebar();
previewArea.showCustomMessage(
localStrings.getString('printingToPDFInProgress'));
}
@@ -802,7 +775,6 @@
previewArea.clearCustomMessageWithDots();
previewAppRequested = false;
hasPendingPrintDocumentRequest = false;
- enableInputElementsInSidebar();
}
$('open-pdf-in-preview-link').disabled = true;
}

Powered by Google App Engine
This is Rietveld 408576698