OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 WEBKIT_PLUGINS_PPAPI_PPB_FLASH_IMPL_H_ | 5 #ifndef WEBKIT_PLUGINS_PPAPI_PPB_FLASH_IMPL_H_ |
6 #define WEBKIT_PLUGINS_PPAPI_PPB_FLASH_IMPL_H_ | 6 #define WEBKIT_PLUGINS_PPAPI_PPB_FLASH_IMPL_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/scoped_ptr.h" |
10 #include "build/build_config.h" | 11 #include "build/build_config.h" |
11 #include "ppapi/thunk/ppb_flash_api.h" | 12 #include "ppapi/shared_impl/ppb_flash_shared.h" |
| 13 |
| 14 class ScopedClipboardWriterGlue; |
| 15 |
| 16 namespace webkit_glue { |
| 17 class ClipboardClient; |
| 18 } |
12 | 19 |
13 namespace webkit { | 20 namespace webkit { |
14 namespace ppapi { | 21 namespace ppapi { |
15 | 22 |
16 class PluginInstance; | 23 class PluginInstance; |
17 | 24 |
18 class PPB_Flash_Impl : public ::ppapi::thunk::PPB_Flash_API { | 25 class PPB_Flash_Impl : public ::ppapi::PPB_Flash_Shared { |
19 public: | 26 public: |
20 explicit PPB_Flash_Impl(PluginInstance* instance); | 27 explicit PPB_Flash_Impl(PluginInstance* instance); |
21 virtual ~PPB_Flash_Impl(); | 28 virtual ~PPB_Flash_Impl(); |
22 | 29 |
23 // PPB_Flash_API. | 30 // PPB_Flash_API. |
24 virtual void SetInstanceAlwaysOnTop(PP_Instance instance, | 31 virtual void SetInstanceAlwaysOnTop(PP_Instance instance, |
25 PP_Bool on_top) OVERRIDE; | 32 PP_Bool on_top) OVERRIDE; |
26 virtual PP_Bool DrawGlyphs(PP_Instance instance, | 33 virtual PP_Bool DrawGlyphs(PP_Instance instance, |
27 PP_Resource pp_image_data, | 34 PP_Resource pp_image_data, |
28 const PP_FontDescription_Dev* font_desc, | 35 const PP_FontDescription_Dev* font_desc, |
(...skipping 12 matching lines...) Expand all Loading... |
41 PP_Bool from_user_action) OVERRIDE; | 48 PP_Bool from_user_action) OVERRIDE; |
42 virtual void RunMessageLoop(PP_Instance instance) OVERRIDE; | 49 virtual void RunMessageLoop(PP_Instance instance) OVERRIDE; |
43 virtual void QuitMessageLoop(PP_Instance instance) OVERRIDE; | 50 virtual void QuitMessageLoop(PP_Instance instance) OVERRIDE; |
44 virtual double GetLocalTimeZoneOffset(PP_Instance instance, | 51 virtual double GetLocalTimeZoneOffset(PP_Instance instance, |
45 PP_Time t) OVERRIDE; | 52 PP_Time t) OVERRIDE; |
46 virtual PP_Bool IsRectTopmost(PP_Instance instance, | 53 virtual PP_Bool IsRectTopmost(PP_Instance instance, |
47 const PP_Rect* rect) OVERRIDE; | 54 const PP_Rect* rect) OVERRIDE; |
48 virtual int32_t InvokePrinting(PP_Instance instance) OVERRIDE; | 55 virtual int32_t InvokePrinting(PP_Instance instance) OVERRIDE; |
49 virtual void UpdateActivity(PP_Instance instance) OVERRIDE; | 56 virtual void UpdateActivity(PP_Instance instance) OVERRIDE; |
50 virtual PP_Var GetDeviceID(PP_Instance instance) OVERRIDE; | 57 virtual PP_Var GetDeviceID(PP_Instance instance) OVERRIDE; |
| 58 virtual PP_Bool IsClipboardFormatAvailable( |
| 59 PP_Instance instance, |
| 60 PP_Flash_Clipboard_Type clipboard_type, |
| 61 PP_Flash_Clipboard_Format format) OVERRIDE; |
| 62 virtual PP_Var ReadClipboardData(PP_Instance instance, |
| 63 PP_Flash_Clipboard_Type clipboard_type, |
| 64 PP_Flash_Clipboard_Format format) OVERRIDE; |
| 65 virtual int32_t WriteClipboardData(PP_Instance instance, |
| 66 PP_Flash_Clipboard_Type clipboard_type, |
| 67 uint32_t data_item_count, |
| 68 const PP_Flash_Clipboard_Format formats[], |
| 69 const PP_Var data_items[]) OVERRIDE; |
51 virtual PP_Bool FlashIsFullscreen(PP_Instance instance) OVERRIDE; | 70 virtual PP_Bool FlashIsFullscreen(PP_Instance instance) OVERRIDE; |
52 virtual PP_Bool FlashSetFullscreen(PP_Instance instance, | 71 virtual PP_Bool FlashSetFullscreen(PP_Instance instance, |
53 PP_Bool fullscreen) OVERRIDE; | 72 PP_Bool fullscreen) OVERRIDE; |
54 virtual PP_Bool FlashGetScreenSize(PP_Instance instance, | 73 virtual PP_Bool FlashGetScreenSize(PP_Instance instance, |
55 PP_Size* size) OVERRIDE; | 74 PP_Size* size) OVERRIDE; |
56 | 75 |
57 private: | 76 private: |
| 77 // Call to ensure that the clipboard_client is properly initialized. Returns |
| 78 // true on success. On failure, you should not use the client. |
| 79 bool InitClipboard(); |
| 80 |
| 81 int32_t WriteClipboardDataItem(const PP_Flash_Clipboard_Format format, |
| 82 const PP_Var& data, |
| 83 ScopedClipboardWriterGlue* scw); |
| 84 |
58 PluginInstance* instance_; | 85 PluginInstance* instance_; |
59 | 86 |
| 87 // This object is lazily created by InitClipboard. |
| 88 scoped_ptr<webkit_glue::ClipboardClient> clipboard_client_; |
| 89 |
60 DISALLOW_COPY_AND_ASSIGN(PPB_Flash_Impl); | 90 DISALLOW_COPY_AND_ASSIGN(PPB_Flash_Impl); |
61 }; | 91 }; |
62 | 92 |
63 } // namespace ppapi | 93 } // namespace ppapi |
64 } // namespace webkit | 94 } // namespace webkit |
65 | 95 |
66 #endif // WEBKIT_PLUGINS_PPAPI_PPB_FLASH_IMPL_H_ | 96 #endif // WEBKIT_PLUGINS_PPAPI_PPB_FLASH_IMPL_H_ |
OLD | NEW |