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); |
} |
/** |