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

Unified Diff: content/renderer/pepper/pepper_plugin_instance_impl.cc

Issue 974183003: Print Preview: Support the duplex preset in PDFs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit Created 5 years, 10 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
Index: content/renderer/pepper/pepper_plugin_instance_impl.cc
diff --git a/content/renderer/pepper/pepper_plugin_instance_impl.cc b/content/renderer/pepper/pepper_plugin_instance_impl.cc
index 7cb8394e4ac9d75a98b67503cef2eecfbd91158d..c50e2c9101744fae2590aca4f926a06a06b3801b 100644
--- a/content/renderer/pepper/pepper_plugin_instance_impl.cc
+++ b/content/renderer/pepper/pepper_plugin_instance_impl.cc
@@ -344,7 +344,7 @@ bool IsReservedSystemInputEvent(const blink::WebInputEvent& event) {
class PluginInstanceLockTarget : public MouseLockDispatcher::LockTarget {
public:
- PluginInstanceLockTarget(PepperPluginInstanceImpl* plugin)
+ explicit PluginInstanceLockTarget(PepperPluginInstanceImpl* plugin)
: plugin_(plugin) {}
void OnLockMouseACK(bool succeeded) override {
@@ -1822,6 +1822,20 @@ bool PepperPluginInstanceImpl::GetPrintPresetOptionsFromDocument(
}
preset_options->isScalingDisabled = PP_ToBool(options.is_scaling_disabled);
+ switch (options.duplex) {
+ case PP_PRINTDUPLEXMODE_SIMPLEX:
+ preset_options->duplexMode = blink::WebSimplex;
+ break;
+ case PP_PRINTDUPLEXMODE_SHORT_EDGE:
+ preset_options->duplexMode = blink::WebShortEdge;
+ break;
+ case PP_PRINTDUPLEXMODE_LONG_EDGE:
+ preset_options->duplexMode = blink::WebLongEdge;
+ break;
+ default:
+ preset_options->duplexMode = blink::WebUnknownDuplexMode;
+ break;
+ }
preset_options->copies = options.copies;
return true;
@@ -2567,7 +2581,6 @@ void PepperPluginInstanceImpl::SetTickmarks(PP_Instance instance,
tickmarks[i].point.y,
tickmarks[i].size.width,
tickmarks[i].size.height);
- ;
}
blink::WebFrame* frame = render_frame_->GetWebFrame();
frame->setTickmarks(tickmarks_converted);

Powered by Google App Engine
This is Rietveld 408576698