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

Unified Diff: chrome/renderer/printing/print_web_view_helper.cc

Issue 388783003: Add support to send print preset options in one message (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix for Android trybot failure Created 6 years, 5 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 | « chrome/renderer/printing/print_web_view_helper.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « chrome/renderer/printing/print_web_view_helper.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698