Index: chrome/browser/resources/print_preview/margin_settings.js |
diff --git a/chrome/browser/resources/print_preview/margin_settings.js b/chrome/browser/resources/print_preview/margin_settings.js |
index 1bfed187a0a908c88905392414c3b1bfa14fe1cd..14ecac14ef68a86c55daf893ecb9e43a4c6f5b2d 100644 |
--- a/chrome/browser/resources/print_preview/margin_settings.js |
+++ b/chrome/browser/resources/print_preview/margin_settings.js |
@@ -535,8 +535,11 @@ cr.define('print_preview', function() { |
* Called when there is change in the preview position or size. |
*/ |
onPreviewPositionChanged: function() { |
+ if (!previewArea.pdfPlugin) |
+ return; |
if (this.isCustomMarginsSelected() && previewArea.pdfLoaded && |
pageSettings.totalPageCount != undefined) { |
+ this.updatePageData_(); |
kmadhusu
2011/11/21 19:20:22
Can you explain why you need to update the page da
dpapad
2011/11/22 02:05:10
Yes. cutomMargins_ might not be initialized when t
|
this.drawCustomMarginsUI_(); |
} |
}, |
@@ -580,6 +583,10 @@ cr.define('print_preview', function() { |
* @private |
*/ |
onCustomMarginsSelected_: function() { |
+ if (!previewArea.pdfPlugin) { |
+ this.forceMarginsUIOnPDFLoad_ = true; |
+ return; |
+ } |
var customMarginsNotSpecified = !this.customMargins_; |
this.updatePageData_(); |