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

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

Issue 375253002: [Chrome] Support NumCopies print preset (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 1 month 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 | content/renderer/pepper/pepper_plugin_instance_impl.h » ('j') | 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 494ab7ea024d962eb649c50843cba6b281fa2fb8..bb1ab8fadee51109c7bd115befface4d35b677da 100644
--- a/chrome/renderer/printing/print_web_view_helper.cc
+++ b/chrome/renderer/printing/print_web_view_helper.cc
@@ -38,6 +38,7 @@
#include "third_party/WebKit/public/web/WebPlugin.h"
#include "third_party/WebKit/public/web/WebPluginDocument.h"
#include "third_party/WebKit/public/web/WebPrintParams.h"
+#include "third_party/WebKit/public/web/WebPrintPresetOptions.h"
#include "third_party/WebKit/public/web/WebPrintScalingOption.h"
#include "third_party/WebKit/public/web/WebScriptSource.h"
#include "third_party/WebKit/public/web/WebSettings.h"
@@ -1450,8 +1451,14 @@ void PrintWebViewHelper::SetOptionsFromDocument(
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);
+ blink::WebPrintPresetOptions preset_options;
+ if (!source_frame->getPrintPresetOptionsForPlugin(source_node,
+ &preset_options)) {
+ return;
+ }
+
+ params.is_scaling_disabled = preset_options.isScalingDisabled;
+ params.copies = preset_options.copies;
}
bool PrintWebViewHelper::UpdatePrintSettings(
« no previous file with comments | « no previous file | content/renderer/pepper/pepper_plugin_instance_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698