| 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 PPAPI_PROXY_PPB_FLASH_CLIPBOARD_PROXY_H_ | 5 #ifndef PPAPI_PROXY_PPB_FLASH_CLIPBOARD_PROXY_H_ |
| 6 #define PPAPI_PROXY_PPB_FLASH_CLIPBOARD_PROXY_H_ | 6 #define PPAPI_PROXY_PPB_FLASH_CLIPBOARD_PROXY_H_ |
| 7 | 7 |
| 8 #include <vector> |
| 9 |
| 8 #include "ppapi/c/pp_instance.h" | 10 #include "ppapi/c/pp_instance.h" |
| 9 #include "ppapi/proxy/interface_proxy.h" | 11 #include "ppapi/proxy/interface_proxy.h" |
| 10 #include "ppapi/thunk/ppb_flash_clipboard_api.h" | 12 #include "ppapi/thunk/ppb_flash_clipboard_api.h" |
| 11 | 13 |
| 12 namespace ppapi { | 14 namespace ppapi { |
| 13 namespace proxy { | 15 namespace proxy { |
| 14 | 16 |
| 15 class SerializedVarReceiveInput; | 17 class SerializedVarReceiveInput; |
| 16 class SerializedVarReturnValue; | 18 class SerializedVarReturnValue; |
| 19 class SerializedVarVectorReceiveInput; |
| 17 | 20 |
| 18 class PPB_Flash_Clipboard_Proxy | 21 class PPB_Flash_Clipboard_Proxy |
| 19 : public InterfaceProxy, | 22 : public InterfaceProxy, |
| 20 public thunk::PPB_Flash_Clipboard_FunctionAPI { | 23 public thunk::PPB_Flash_Clipboard_FunctionAPI { |
| 21 public: | 24 public: |
| 22 PPB_Flash_Clipboard_Proxy(Dispatcher* dispatcher); | 25 PPB_Flash_Clipboard_Proxy(Dispatcher* dispatcher); |
| 23 virtual ~PPB_Flash_Clipboard_Proxy(); | 26 virtual ~PPB_Flash_Clipboard_Proxy(); |
| 24 | 27 |
| 25 // FunctionGroupBase overrides. | 28 // FunctionGroupBase overrides. |
| 26 thunk::PPB_Flash_Clipboard_FunctionAPI* AsPPB_Flash_Clipboard_FunctionAPI() | 29 thunk::PPB_Flash_Clipboard_FunctionAPI* AsPPB_Flash_Clipboard_FunctionAPI() |
| 27 OVERRIDE; | 30 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 ReadData(PP_Instance instance, |
| 34 PP_Flash_Clipboard_Type clipboard_type) OVERRIDE; | 37 PP_Flash_Clipboard_Type clipboard_type, |
| 35 virtual int32_t WritePlainText(PP_Instance instance, | 38 PP_Flash_Clipboard_Format format) OVERRIDE; |
| 36 PP_Flash_Clipboard_Type clipboard_type, | 39 virtual int32_t WriteData(PP_Instance instance, |
| 37 const PP_Var& text) OVERRIDE; | 40 PP_Flash_Clipboard_Type clipboard_type, |
| 41 uint32_t data_item_count, |
| 42 const PP_Flash_Clipboard_Format formats[], |
| 43 const PP_Var data_items[]) OVERRIDE; |
| 38 | 44 |
| 39 // InterfaceProxy implementation. | 45 // InterfaceProxy implementation. |
| 40 virtual bool OnMessageReceived(const IPC::Message& msg); | 46 virtual bool OnMessageReceived(const IPC::Message& msg); |
| 41 | 47 |
| 42 static const ApiID kApiID = API_ID_PPB_FLASH_CLIPBOARD; | 48 static const ApiID kApiID = API_ID_PPB_FLASH_CLIPBOARD; |
| 43 | 49 |
| 44 private: | 50 private: |
| 45 // Message handlers. | 51 // Message handlers. |
| 46 void OnMsgIsFormatAvailable(PP_Instance instance, | 52 void OnMsgIsFormatAvailable(PP_Instance instance, |
| 47 int clipboard_type, | 53 int clipboard_type, |
| 48 int format, | 54 int format, |
| 49 bool* result); | 55 bool* result); |
| 50 void OnMsgReadPlainText(PP_Instance instance, | 56 void OnMsgReadData(PP_Instance instance, |
| 51 int clipboard_type, | 57 int clipboard_type, |
| 52 SerializedVarReturnValue result); | 58 int format, |
| 53 void OnMsgWritePlainText(PP_Instance instance, | 59 SerializedVarReturnValue result); |
| 54 int clipboard_type, | 60 void OnMsgWriteData(PP_Instance instance, |
| 55 SerializedVarReceiveInput text); | 61 int clipboard_type, |
| 62 std::vector<int> formats, |
| 63 SerializedVarVectorReceiveInput data_items); |
| 56 }; | 64 }; |
| 57 | 65 |
| 58 } // namespace proxy | 66 } // namespace proxy |
| 59 } // namespace ppapi | 67 } // namespace ppapi |
| 60 | 68 |
| 61 #endif // PPAPI_PROXY_PPB_FLASH_CLIPBOARD_PROXY_H_ | 69 #endif // PPAPI_PROXY_PPB_FLASH_CLIPBOARD_PROXY_H_ |
| OLD | NEW |