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

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

Issue 375253002: [Chrome] Support NumCopies print preset (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review feedback (rename from PPP_.. to PP_..) Created 6 years, 2 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 cc4ae711647f2e151eb344f8663f1c4952e58466..3068ea258f30f3c6cdad35de4707b12c759699a7 100644
--- a/content/renderer/pepper/pepper_plugin_instance_impl.cc
+++ b/content/renderer/pepper/pepper_plugin_instance_impl.cc
@@ -114,6 +114,7 @@
#include "third_party/WebKit/public/web/WebLocalFrame.h"
#include "third_party/WebKit/public/web/WebPluginContainer.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/WebScopedUserGesture.h"
#include "third_party/WebKit/public/web/WebScriptSource.h"
@@ -1523,7 +1524,7 @@ bool PepperPluginInstanceImpl::LoadMouseLockInterface() {
bool PepperPluginInstanceImpl::LoadPdfInterface() {
if (!checked_for_plugin_pdf_interface_) {
checked_for_plugin_pdf_interface_ = true;
- plugin_pdf_interface_ = static_cast<const PPP_Pdf_1*>(
+ plugin_pdf_interface_ = static_cast<const PPP_Pdf*>(
module_->GetPluginInterface(PPP_PDF_INTERFACE_1));
}
@@ -1832,6 +1833,25 @@ void PepperPluginInstanceImpl::PrintEnd() {
#endif // defined(OS_MACOSX)
}
+bool PepperPluginInstanceImpl::GetPrintPresetOptionsFromDocument(
+ blink::WebPrintPresetOptions* preset_options) {
+ // Keep a reference on the stack. See NOTE above.
+ scoped_refptr<PepperPluginInstanceImpl> ref(this);
+ if (!LoadPdfInterface())
+ return false;
+
+ PP_PdfPrintPresetOptions_Dev options;
+ if (!plugin_pdf_interface_->GetPrintPresetOptionsFromDocument(pp_instance(),
+ &options)) {
+ return false;
+ }
+
+ preset_options->isScalingDisabled = options.is_scaling_disabled;
+ preset_options->copies = options.copies;
+
+ return true;
+}
+
bool PepperPluginInstanceImpl::CanRotateView() {
if (!LoadPdfInterface())
return false;
« no previous file with comments | « content/renderer/pepper/pepper_plugin_instance_impl.h ('k') | content/renderer/pepper/pepper_webplugin_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698