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

Unified Diff: components/pdf/renderer/ppb_pdf_impl.h

Issue 477263003: pdf: Create a separate component for using the pdf pepper plugin. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix-gn Created 6 years, 4 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: components/pdf/renderer/ppb_pdf_impl.h
diff --git a/components/pdf/renderer/ppb_pdf_impl.h b/components/pdf/renderer/ppb_pdf_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..91afbcde2ecd99643b8791148896af6ec61f20c9
--- /dev/null
+++ b/components/pdf/renderer/ppb_pdf_impl.h
@@ -0,0 +1,45 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENT_PDF_RENDERER_PPB_PDF_IMPL_H_
+#define COMPONENT_PDF_RENDERER_PPB_PDF_IMPL_H_
+
+#include "ppapi/c/pp_instance.h"
+
+struct PPB_PDF;
+
+namespace pdf {
+
+class PPB_PDF_Impl {
+ public:
+ class PrintDelegate {
+ public:
+ virtual ~PrintDelegate() {}
+
+ // Returns whether printing is enabled for the plugin instance identified by
+ // |instance_id|.
+ virtual bool IsPrintingEnabled(PP_Instance instance_id) = 0;
+
+ // Invokes the "Print" command for the plugin instance identified by
+ // |instance_id|.
+ virtual void Print(PP_Instance instance_id) = 0;
+ };
+
+ // Returns a pointer to the interface implementing PPB_PDF that is exposed
+ // to the plugin.
+ static const PPB_PDF* GetInterface();
+
+ // Invokes the "Print" command for the given instance as if the user right
+ // clicked on it and selected "Print".
+ static void InvokePrintingForInstance(PP_Instance instance);
+
+ // The caller retains the ownership of |print_delegate|. The delegate is
+ // allowed to be set only once, and when set, the delegate must outlive the
+ // PPB_PDF_Impl instance.
+ static void SetPrintDelegate(PrintDelegate* print_delegate);
+};
+
+} // namespace pdf
+
+#endif // COMPONENT_PDF_RENDERER_PPB_PDF_IMPL_H_

Powered by Google App Engine
This is Rietveld 408576698