| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "ppapi/c/pp_instance.h" | 8 #include "ppapi/c/pp_instance.h" |
| 9 #include "ppapi/proxy/interface_proxy.h" | 9 #include "ppapi/proxy/interface_proxy.h" |
| 10 #include "ppapi/thunk/ppb_flash_clipboard_api.h" |
| 10 | 11 |
| 11 struct PPB_Flash_Clipboard; | 12 struct PPB_Flash_Clipboard; |
| 12 | 13 |
| 13 namespace ppapi { | 14 namespace ppapi { |
| 14 namespace proxy { | 15 namespace proxy { |
| 15 | 16 |
| 16 class SerializedVarReceiveInput; | 17 class SerializedVarReceiveInput; |
| 17 class SerializedVarReturnValue; | 18 class SerializedVarReturnValue; |
| 18 | 19 |
| 19 class PPB_Flash_Clipboard_Proxy : public InterfaceProxy { | 20 class PPB_Flash_Clipboard_Proxy |
| 21 : public InterfaceProxy, |
| 22 public thunk::PPB_Flash_Clipboard_FunctionAPI { |
| 20 public: | 23 public: |
| 21 PPB_Flash_Clipboard_Proxy(Dispatcher* dispatcher); | 24 PPB_Flash_Clipboard_Proxy(Dispatcher* dispatcher); |
| 22 virtual ~PPB_Flash_Clipboard_Proxy(); | 25 virtual ~PPB_Flash_Clipboard_Proxy(); |
| 23 | 26 |
| 24 static const PPB_Flash_Clipboard* GetInterface(); | 27 // FunctionGroupBase overrides. |
| 28 thunk::PPB_Flash_Clipboard_FunctionAPI* AsPPB_Flash_Clipboard_FunctionAPI() |
| 29 OVERRIDE; |
| 30 |
| 31 // PPB_Flash_Clipboard_FunctionAPI implementation. |
| 32 virtual PP_Bool IsFormatAvailable(PP_Instance instance, |
| 33 PP_Flash_Clipboard_Type clipboard_type, |
| 34 PP_Flash_Clipboard_Format format) OVERRIDE; |
| 35 virtual PP_Var ReadPlainText(PP_Instance instance, |
| 36 PP_Flash_Clipboard_Type clipboard_type) OVERRIDE; |
| 37 virtual int32_t WritePlainText(PP_Instance instance, |
| 38 PP_Flash_Clipboard_Type clipboard_type, |
| 39 const PP_Var& text) OVERRIDE; |
| 25 | 40 |
| 26 // InterfaceProxy implementation. | 41 // InterfaceProxy implementation. |
| 27 virtual bool OnMessageReceived(const IPC::Message& msg); | 42 virtual bool OnMessageReceived(const IPC::Message& msg); |
| 28 | 43 |
| 44 static const ApiID kApiID = API_ID_PPB_FLASH_CLIPBOARD; |
| 45 |
| 29 private: | 46 private: |
| 30 // Message handlers. | 47 // Message handlers. |
| 31 void OnMsgIsFormatAvailable(PP_Instance instance_id, | 48 void OnMsgIsFormatAvailable(PP_Instance instance, |
| 32 int clipboard_type, | 49 int clipboard_type, |
| 33 int format, | 50 int format, |
| 34 bool* result); | 51 bool* result); |
| 35 void OnMsgReadPlainText(PP_Instance instance_id, | 52 void OnMsgReadPlainText(PP_Instance instance, |
| 36 int clipboard_type, | 53 int clipboard_type, |
| 37 SerializedVarReturnValue result); | 54 SerializedVarReturnValue result); |
| 38 void OnMsgWritePlainText(PP_Instance instance_id, | 55 void OnMsgWritePlainText(PP_Instance instance, |
| 39 int clipboard_type, | 56 int clipboard_type, |
| 40 SerializedVarReceiveInput text); | 57 SerializedVarReceiveInput text); |
| 41 | |
| 42 // When this proxy is in the host side, this value caches the interface | |
| 43 // pointer so we don't have to retrieve it from the dispatcher each time. | |
| 44 // In the plugin, this value is always NULL. | |
| 45 const PPB_Flash_Clipboard* ppb_flash_clipboard_impl_; | |
| 46 }; | 58 }; |
| 47 | 59 |
| 48 } // namespace proxy | 60 } // namespace proxy |
| 49 } // namespace ppapi | 61 } // namespace ppapi |
| 50 | 62 |
| 51 #endif // PPAPI_PROXY_PPB_FLASH_CLIPBOARD_PROXY_H_ | 63 #endif // PPAPI_PROXY_PPB_FLASH_CLIPBOARD_PROXY_H_ |
| OLD | NEW |