| 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 PrintClient { | 16 class PrintClient { |
| 17 public: | 17 public: |
| 18 virtual ~PrintClient() {} | 18 virtual ~PrintClient() {} |
| 19 | 19 |
| 20 // Returns whether printing is enabled for the plugin instance identified by | 20 // Returns whether printing is enabled for the plugin instance identified by |
| 21 // |instance_id|. | 21 // |instance_id|. |
| 22 virtual bool IsPrintingEnabled(PP_Instance instance_id) = 0; | 22 virtual bool IsPrintingEnabled(PP_Instance instance_id) = 0; |
| 23 | 23 |
| 24 // Invokes the "Print" command for the plugin instance identified by | 24 // Invokes the "Print" command for the plugin instance identified by |
| 25 // |instance_id|. | 25 // |instance_id|. Returns whether the "Print" command was issued or not. |
| 26 virtual void Print(PP_Instance instance_id) = 0; | 26 virtual bool Print(PP_Instance instance_id) = 0; |
| 27 }; | 27 }; |
| 28 | 28 |
| 29 // Returns a pointer to the interface implementing PPB_PDF that is exposed | 29 // Returns a pointer to the interface implementing PPB_PDF that is exposed |
| 30 // to the plugin. | 30 // to the plugin. |
| 31 static const PPB_PDF* GetInterface(); | 31 static const PPB_PDF* GetInterface(); |
| 32 | 32 |
| 33 // Invokes the "Print" command for the given instance as if the user right | 33 // Invokes the "Print" command for the given instance as if the user right |
| 34 // clicked on it and selected "Print". | 34 // clicked on it and selected "Print". Returns if the "Print" command was |
| 35 static void InvokePrintingForInstance(PP_Instance instance); | 35 // issued or not. |
| 36 static bool InvokePrintingForInstance(PP_Instance instance); |
| 36 | 37 |
| 37 // The caller retains the ownership of |print_client|. The client is | 38 // The caller retains the ownership of |print_client|. The client is |
| 38 // allowed to be set only once, and when set, the client must outlive the | 39 // allowed to be set only once, and when set, the client must outlive the |
| 39 // PPB_PDF_Impl instance. | 40 // PPB_PDF_Impl instance. |
| 40 static void SetPrintClient(PrintClient* print_client); | 41 static void SetPrintClient(PrintClient* print_client); |
| 41 }; | 42 }; |
| 42 | 43 |
| 43 } // namespace pdf | 44 } // namespace pdf |
| 44 | 45 |
| 45 #endif // COMPONENT_PDF_RENDERER_PPB_PDF_IMPL_H_ | 46 #endif // COMPONENT_PDF_RENDERER_PPB_PDF_IMPL_H_ |
| OLD | NEW |