OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef WEBKIT_PLUGINS_PPAPI_PPB_FLASH_CLIPBOARD_IMPL_H_ | |
6 #define WEBKIT_PLUGINS_PPAPI_PPB_FLASH_CLIPBOARD_IMPL_H_ | |
7 | |
8 #include "base/basictypes.h" | |
9 #include "base/compiler_specific.h" | |
10 #include "base/memory/scoped_ptr.h" | |
11 #include "ppapi/shared_impl/function_group_base.h" | |
12 #include "ppapi/thunk/ppb_flash_clipboard_api.h" | |
13 | |
14 namespace webkit_glue { class ClipboardClient; } | |
15 class ScopedClipboardWriterGlue; | |
16 | |
17 namespace webkit { | |
18 namespace ppapi { | |
19 | |
20 class PluginInstance; | |
21 | |
22 class PPB_Flash_Clipboard_Impl | |
23 : public ::ppapi::FunctionGroupBase, | |
24 public ::ppapi::thunk::PPB_Flash_Clipboard_FunctionAPI { | |
25 public: | |
26 PPB_Flash_Clipboard_Impl(PluginInstance* instance); | |
27 virtual ~PPB_Flash_Clipboard_Impl(); | |
28 | |
29 // FunctionGroupBase overrides. | |
30 virtual ::ppapi::thunk::PPB_Flash_Clipboard_FunctionAPI* | |
31 AsPPB_Flash_Clipboard_FunctionAPI() OVERRIDE; | |
32 | |
33 // PPB_Flash_Clipboard_FunctionAPI implementation. | |
34 virtual PP_Bool IsFormatAvailable(PP_Instance instance, | |
35 PP_Flash_Clipboard_Type clipboard_type, | |
36 PP_Flash_Clipboard_Format format) OVERRIDE; | |
37 virtual PP_Var ReadData(PP_Instance instance, | |
38 PP_Flash_Clipboard_Type clipboard_type, | |
39 PP_Flash_Clipboard_Format format); | |
40 virtual int32_t WriteData(PP_Instance instance, | |
41 PP_Flash_Clipboard_Type clipboard_type, | |
42 uint32_t data_item_count, | |
43 const PP_Flash_Clipboard_Format formats[], | |
44 const PP_Var data_items[]); | |
45 | |
46 private: | |
47 bool Init(); | |
48 int32_t WriteDataItem(const PP_Flash_Clipboard_Format format, | |
49 const PP_Var& data, | |
50 ScopedClipboardWriterGlue* scw); | |
51 | |
52 PluginInstance* instance_; | |
53 scoped_ptr<webkit_glue::ClipboardClient> client_; | |
54 | |
55 DISALLOW_COPY_AND_ASSIGN(PPB_Flash_Clipboard_Impl); | |
56 }; | |
57 | |
58 } // namespace ppapi | |
59 } // namespace webkit | |
60 | |
61 #endif // WEBKIT_PLUGINS_PPAPI_PPB_FLASH_CLIPBOARD_IMPL_H_ | |
OLD | NEW |