OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENT_PDF_RENDERER_PPB_PDF_IMPL_H_ | 5 #ifndef COMPONENT_PDF_RENDERER_PPB_PDF_IMPL_H_ |
6 #define COMPONENT_PDF_RENDERER_PPB_PDF_IMPL_H_ | 6 #define COMPONENT_PDF_RENDERER_PPB_PDF_IMPL_H_ |
7 | 7 |
8 #include "ppapi/c/pp_instance.h" | 8 #include "ppapi/c/pp_instance.h" |
9 | 9 |
10 struct PPB_PDF; | 10 struct PPB_PDF; |
11 | 11 |
12 namespace pdf { | 12 namespace pdf { |
13 | 13 |
14 class PPB_PDF_Impl { | 14 class PPB_PDF_Impl { |
15 public: | 15 public: |
16 class PrintDelegate { | 16 class PrintDelegate { |
17 public: | 17 public: |
18 virtual ~PrintDelegate() {} | 18 virtual ~PrintDelegate() {} |
19 | 19 |
20 virtual bool IsPrintingEnabled(PP_Instance instance_id) = 0; | 20 virtual bool IsPrintingEnabled(PP_Instance instance_id) = 0; |
21 | 21 |
22 virtual void Print(PP_Instance instance_id) = 0; | 22 virtual bool Print(PP_Instance instance_id) = 0; |
23 }; | 23 }; |
24 | 24 |
25 // Returns a pointer to the interface implementing PPB_PDF that is exposed | 25 // Returns a pointer to the interface implementing PPB_PDF that is exposed |
26 // to the plugin. | 26 // to the plugin. |
27 static const PPB_PDF* GetInterface(); | 27 static const PPB_PDF* GetInterface(); |
28 | 28 |
29 // Invokes the "Print" command for the given instance as if the user right | 29 // Invokes the "Print" command for the given instance as if the user right |
30 // clicked on it and selected "Print". | 30 // clicked on it and selected "Print". Returns if the "Print" command was |
31 static void InvokePrintingForInstance(PP_Instance instance); | 31 // issued or not. |
| 32 static bool InvokePrintingForInstance(PP_Instance instance); |
32 | 33 |
33 static void SetPrintDelegate(PrintDelegate* print_delegate); | 34 static void SetPrintDelegate(PrintDelegate* print_delegate); |
34 }; | 35 }; |
35 | 36 |
36 } // namespace pdf | 37 } // namespace pdf |
37 | 38 |
38 #endif // COMPONENT_PDF_RENDERER_PPB_PDF_IMPL_H_ | 39 #endif // COMPONENT_PDF_RENDERER_PPB_PDF_IMPL_H_ |
OLD | NEW |