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