Index: chrome/renderer/printing/print_web_view_helper.cc |
diff --git a/chrome/renderer/printing/print_web_view_helper.cc b/chrome/renderer/printing/print_web_view_helper.cc |
index 76db5846a5b8b87ebe500ffbf0cbfd0768bd6c76..777eb69fa183c52236578b34969c60e803511b5e 100644 |
--- a/chrome/renderer/printing/print_web_view_helper.cc |
+++ b/chrome/renderer/printing/print_web_view_helper.cc |
@@ -1025,13 +1025,13 @@ void PrintWebViewHelper::OnPrintPreview(const base::DictionaryValue& settings) { |
return; |
} |
- // If we are previewing a pdf and the print scaling is disabled, send a |
+ // Set the options from document if we are previewing a pdf and send a |
// message to browser. |
if (print_pages_params_->params.is_first_request && |
- !print_preview_context_.IsModifiable() && |
- print_preview_context_.source_frame()->isPrintScalingDisabledForPlugin( |
- print_preview_context_.source_node())) { |
- Send(new PrintHostMsg_PrintPreviewScalingDisabled(routing_id())); |
+ !print_preview_context_.IsModifiable()) { |
+ PrintHostMsg_SetOptionsFromDocument_Params params; |
+ SetOptionsFromDocument(params); |
+ Send(new PrintHostMsg_SetOptionsFromDocument(routing_id(), params)); |
} |
is_print_ready_metafile_sent_ = false; |
@@ -1466,6 +1466,15 @@ bool PrintWebViewHelper::CalculateNumberOfPages(blink::WebLocalFrame* frame, |
return true; |
} |
+void PrintWebViewHelper::SetOptionsFromDocument( |
+ PrintHostMsg_SetOptionsFromDocument_Params& params) { |
+ blink::WebLocalFrame* source_frame = print_preview_context_.source_frame(); |
+ const blink::WebNode& source_node = print_preview_context_.source_node(); |
+ |
+ params.is_scaling_disabled = |
+ source_frame->isPrintScalingDisabledForPlugin(source_node); |
+} |
+ |
bool PrintWebViewHelper::UpdatePrintSettings( |
blink::WebLocalFrame* frame, |
const blink::WebNode& node, |