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

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

Issue 7003107: Print Preview: Set color correctly if there is no printers; Make some optional PDF plugin feature... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/print_preview.js
===================================================================
--- chrome/browser/resources/print_preview.js (revision 88601)
+++ chrome/browser/resources/print_preview.js (working copy)
@@ -202,7 +202,6 @@
if (colorOption.checked != setColorAsDefault) {
colorOption.checked = setColorAsDefault;
bwOption.checked = !setColorAsDefault;
- setColor(colorOption.checked);
Lei Zhang 2011/06/10 04:11:47 on first load, this fails because the PDF plugin h
}
}
@@ -473,6 +472,8 @@
else
$('pdf-viewer').fitToHeight();
+ setColor($('color').checked);
+
hideLoadingAnimation();
if (!previewModifiable)
@@ -542,13 +543,10 @@
var pdfViewer = $('pdf-viewer');
if (pdfViewer) {
- // Older version of the PDF plugin may not have this method.
- // TODO(thestig) Eventually remove this check.
- if (pdfViewer.goToPage) {
- // Need to call this before the reload(), where the plugin resets its
- // internal page count.
- pdfViewer.goToPage('0');
- }
+ // Need to call this before the reload(), where the plugin resets its
+ // internal page count.
+ pdfViewer.goToPage('0');
+
pdfViewer.reload();
pdfViewer.grayscale(!isColor());
return;
@@ -561,13 +559,7 @@
var mainView = $('mainview');
mainView.appendChild(pdfPlugin);
pdfPlugin.onload('onPDFLoad()');
-
- // Older version of the PDF plugin may not have this method.
- // TODO(thestig) Eventually remove this check.
- if (pdfPlugin.removePrintButton) {
- pdfPlugin.removePrintButton();
- }
-
+ pdfPlugin.removePrintButton();
pdfPlugin.grayscale(true);
}
@@ -576,7 +568,9 @@
*/
function checkCompatiblePluginExists() {
var dummyPlugin = $('dummy-viewer')
- return !!dummyPlugin.onload;
+ return (dummyPlugin.onload &&
+ dummyPlugin.goToPage &&
+ dummyPlugin.removePrintButton);
}
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698