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