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

Unified Diff: chrome/renderer/pepper/ppb_pdf_impl.cc

Issue 10802004: Experimental flag for HiDPI-aware PDF Viewer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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
Index: chrome/renderer/pepper/ppb_pdf_impl.cc
diff --git a/chrome/renderer/pepper/ppb_pdf_impl.cc b/chrome/renderer/pepper/ppb_pdf_impl.cc
index 388c4dd8d65d224640d56953bdc58c7c4cbd7765..cfbacb427b9c68ef0c63404d73b0f4a1a7ad2be8 100644
--- a/chrome/renderer/pepper/ppb_pdf_impl.cc
+++ b/chrome/renderer/pepper/ppb_pdf_impl.cc
@@ -4,9 +4,11 @@
#include "chrome/renderer/pepper/ppb_pdf_impl.h"
+#include "base/command_line.h"
#include "base/metrics/histogram.h"
#include "base/utf_string_conversions.h"
#include "build/build_config.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/common/render_messages.h"
#include "chrome/renderer/print_web_view_helper.h"
#include "content/public/common/child_process_sandbox_support_linux.h"
@@ -347,6 +349,18 @@ void SaveAs(PP_Instance instance_id) {
instance->delegate()->SaveURLAs(instance->plugin_url());
}
+PP_Bool IsFeatureEnabled(PP_PDFFeature feature) {
+ PP_Bool result = PP_FALSE;
+ switch (feature) {
+ case PP_PDFFEATURE_HIDPI:
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableHighDPIPDFPlugin))
+ result = PP_TRUE;
+ break;
+ }
+ return result;
+}
+
const PPB_PDF ppb_pdf = {
&GetLocalizedString,
&GetResourceImage,
@@ -360,7 +374,8 @@ const PPB_PDF ppb_pdf = {
&UserMetricsRecordAction,
&HasUnsupportedFeature,
&SaveAs,
- &PPB_PDF_Impl::InvokePrintingForInstance
+ &PPB_PDF_Impl::InvokePrintingForInstance,
+ &IsFeatureEnabled
};
} // namespace

Powered by Google App Engine
This is Rietveld 408576698