| 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_PROXY_H_ | 5 #ifndef PPAPI_PROXY_PPB_FLASH_PROXY_H_ |
| 6 #define PPAPI_PROXY_PPB_FLASH_PROXY_H_ | 6 #define PPAPI_PROXY_PPB_FLASH_PROXY_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "ipc/ipc_platform_file.h" | 12 #include "ipc/ipc_platform_file.h" |
| 13 #include "ppapi/c/pp_bool.h" | 13 #include "ppapi/c/pp_bool.h" |
| 14 #include "ppapi/c/pp_instance.h" | 14 #include "ppapi/c/pp_instance.h" |
| 15 #include "ppapi/c/pp_module.h" | 15 #include "ppapi/c/pp_module.h" |
| 16 #include "ppapi/c/pp_time.h" | 16 #include "ppapi/c/pp_time.h" |
| 17 #include "ppapi/c/private/ppb_flash.h" | 17 #include "ppapi/c/private/ppb_flash.h" |
| 18 #include "ppapi/proxy/interface_proxy.h" | 18 #include "ppapi/proxy/interface_proxy.h" |
| 19 #include "ppapi/proxy/serialized_var.h" |
| 19 #include "ppapi/shared_impl/host_resource.h" | 20 #include "ppapi/shared_impl/host_resource.h" |
| 20 #include "ppapi/thunk/ppb_flash_api.h" | 21 #include "ppapi/shared_impl/ppb_flash_shared.h" |
| 21 | 22 |
| 22 namespace ppapi { | 23 namespace ppapi { |
| 23 | 24 |
| 24 struct PPB_URLRequestInfo_Data; | 25 struct PPB_URLRequestInfo_Data; |
| 25 | 26 |
| 26 namespace proxy { | 27 namespace proxy { |
| 27 | 28 |
| 28 struct PPBFlash_DrawGlyphs_Params; | 29 struct PPBFlash_DrawGlyphs_Params; |
| 29 class SerializedVarReturnValue; | 30 class SerializedVarReturnValue; |
| 30 | 31 |
| 31 class PPB_Flash_Proxy : public InterfaceProxy, | 32 class PPB_Flash_Proxy : public InterfaceProxy, public PPB_Flash_Shared { |
| 32 public thunk::PPB_Flash_API { | |
| 33 public: | 33 public: |
| 34 explicit PPB_Flash_Proxy(Dispatcher* dispatcher); | 34 explicit PPB_Flash_Proxy(Dispatcher* dispatcher); |
| 35 virtual ~PPB_Flash_Proxy(); | 35 virtual ~PPB_Flash_Proxy(); |
| 36 | 36 |
| 37 // InterfaceProxy implementation. | 37 // InterfaceProxy implementation. |
| 38 virtual bool OnMessageReceived(const IPC::Message& msg); | 38 virtual bool OnMessageReceived(const IPC::Message& msg); |
| 39 | 39 |
| 40 // PPB_Flash_API implementation. | 40 // PPB_Flash_API implementation. |
| 41 virtual void SetInstanceAlwaysOnTop(PP_Instance instance, | 41 virtual void SetInstanceAlwaysOnTop(PP_Instance instance, |
| 42 PP_Bool on_top) OVERRIDE; | 42 PP_Bool on_top) OVERRIDE; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 58 PP_Bool from_user_action) OVERRIDE; | 58 PP_Bool from_user_action) OVERRIDE; |
| 59 virtual void RunMessageLoop(PP_Instance instance) OVERRIDE; | 59 virtual void RunMessageLoop(PP_Instance instance) OVERRIDE; |
| 60 virtual void QuitMessageLoop(PP_Instance instance) OVERRIDE; | 60 virtual void QuitMessageLoop(PP_Instance instance) OVERRIDE; |
| 61 virtual double GetLocalTimeZoneOffset(PP_Instance instance, | 61 virtual double GetLocalTimeZoneOffset(PP_Instance instance, |
| 62 PP_Time t) OVERRIDE; | 62 PP_Time t) OVERRIDE; |
| 63 virtual PP_Bool IsRectTopmost(PP_Instance instance, | 63 virtual PP_Bool IsRectTopmost(PP_Instance instance, |
| 64 const PP_Rect* rect) OVERRIDE; | 64 const PP_Rect* rect) OVERRIDE; |
| 65 virtual int32_t InvokePrinting(PP_Instance instance) OVERRIDE; | 65 virtual int32_t InvokePrinting(PP_Instance instance) OVERRIDE; |
| 66 virtual void UpdateActivity(PP_Instance instance) OVERRIDE; | 66 virtual void UpdateActivity(PP_Instance instance) OVERRIDE; |
| 67 virtual PP_Var GetDeviceID(PP_Instance instance) OVERRIDE; | 67 virtual PP_Var GetDeviceID(PP_Instance instance) OVERRIDE; |
| 68 virtual PP_Bool IsClipboardFormatAvailable( |
| 69 PP_Instance instance, |
| 70 PP_Flash_Clipboard_Type clipboard_type, |
| 71 PP_Flash_Clipboard_Format format) OVERRIDE; |
| 72 virtual PP_Var ReadClipboardData(PP_Instance instance, |
| 73 PP_Flash_Clipboard_Type clipboard_type, |
| 74 PP_Flash_Clipboard_Format format) OVERRIDE; |
| 75 virtual int32_t WriteClipboardData(PP_Instance instance, |
| 76 PP_Flash_Clipboard_Type clipboard_type, |
| 77 uint32_t data_item_count, |
| 78 const PP_Flash_Clipboard_Format formats[], |
| 79 const PP_Var data_items[]) OVERRIDE; |
| 68 virtual PP_Bool FlashIsFullscreen(PP_Instance instance) OVERRIDE; | 80 virtual PP_Bool FlashIsFullscreen(PP_Instance instance) OVERRIDE; |
| 69 virtual PP_Bool FlashSetFullscreen(PP_Instance instance, | 81 virtual PP_Bool FlashSetFullscreen(PP_Instance instance, |
| 70 PP_Bool fullscreen) OVERRIDE; | 82 PP_Bool fullscreen) OVERRIDE; |
| 71 virtual PP_Bool FlashGetScreenSize(PP_Instance instance, | 83 virtual PP_Bool FlashGetScreenSize(PP_Instance instance, |
| 72 PP_Size* size) OVERRIDE; | 84 PP_Size* size) OVERRIDE; |
| 73 | 85 |
| 74 static const ApiID kApiID = API_ID_PPB_FLASH; | 86 static const ApiID kApiID = API_ID_PPB_FLASH; |
| 75 | 87 |
| 76 private: | 88 private: |
| 77 // Message handlers. | 89 // Message handlers. |
| 78 void OnHostMsgSetInstanceAlwaysOnTop(PP_Instance instance, | 90 void OnHostMsgSetInstanceAlwaysOnTop(PP_Instance instance, |
| 79 PP_Bool on_top); | 91 PP_Bool on_top); |
| 80 void OnHostMsgDrawGlyphs(const PPBFlash_DrawGlyphs_Params& params, | 92 void OnHostMsgDrawGlyphs(PP_Instance instance, |
| 93 const PPBFlash_DrawGlyphs_Params& params, |
| 81 PP_Bool* result); | 94 PP_Bool* result); |
| 82 void OnHostMsgGetProxyForURL(PP_Instance instance, | 95 void OnHostMsgGetProxyForURL(PP_Instance instance, |
| 83 const std::string& url, | 96 const std::string& url, |
| 84 SerializedVarReturnValue result); | 97 SerializedVarReturnValue result); |
| 85 void OnHostMsgNavigate(PP_Instance instance, | 98 void OnHostMsgNavigate(PP_Instance instance, |
| 86 const PPB_URLRequestInfo_Data& data, | 99 const PPB_URLRequestInfo_Data& data, |
| 87 const std::string& target, | 100 const std::string& target, |
| 88 PP_Bool from_user_action, | 101 PP_Bool from_user_action, |
| 89 int32_t* result); | 102 int32_t* result); |
| 90 void OnHostMsgRunMessageLoop(PP_Instance instance); | 103 void OnHostMsgRunMessageLoop(PP_Instance instance); |
| 91 void OnHostMsgQuitMessageLoop(PP_Instance instance); | 104 void OnHostMsgQuitMessageLoop(PP_Instance instance); |
| 92 void OnHostMsgGetLocalTimeZoneOffset(PP_Instance instance, PP_Time t, | 105 void OnHostMsgGetLocalTimeZoneOffset(PP_Instance instance, PP_Time t, |
| 93 double* result); | 106 double* result); |
| 94 void OnHostMsgIsRectTopmost(PP_Instance instance, | 107 void OnHostMsgIsRectTopmost(PP_Instance instance, |
| 95 PP_Rect rect, | 108 PP_Rect rect, |
| 96 PP_Bool* result); | 109 PP_Bool* result); |
| 97 void OnHostMsgFlashSetFullscreen(PP_Instance instance, | 110 void OnHostMsgFlashSetFullscreen(PP_Instance instance, |
| 98 PP_Bool fullscreen, | 111 PP_Bool fullscreen, |
| 99 PP_Bool* result); | 112 PP_Bool* result); |
| 100 void OnHostMsgFlashGetScreenSize(PP_Instance instance, | 113 void OnHostMsgFlashGetScreenSize(PP_Instance instance, |
| 101 PP_Bool* result, | 114 PP_Bool* result, |
| 102 PP_Size* size); | 115 PP_Size* size); |
| 103 | 116 void OnHostMsgIsClipboardFormatAvailable(PP_Instance instance, |
| 104 // When this proxy is in the host side, this value caches the interface | 117 int clipboard_type, |
| 105 // pointer so we don't have to retrieve it from the dispatcher each time. | 118 int format, |
| 106 // In the plugin, this value is always NULL. | 119 bool* result); |
| 107 const PPB_Flash* ppb_flash_impl_; | 120 void OnHostMsgReadClipboardData(PP_Instance instance, |
| 121 int clipboard_type, |
| 122 int format, |
| 123 SerializedVarReturnValue result); |
| 124 void OnHostMsgWriteClipboardData(PP_Instance instance, |
| 125 int clipboard_type, |
| 126 const std::vector<int>& formats, |
| 127 SerializedVarVectorReceiveInput data_items); |
| 108 | 128 |
| 109 DISALLOW_COPY_AND_ASSIGN(PPB_Flash_Proxy); | 129 DISALLOW_COPY_AND_ASSIGN(PPB_Flash_Proxy); |
| 110 }; | 130 }; |
| 111 | 131 |
| 112 } // namespace proxy | 132 } // namespace proxy |
| 113 } // namespace ppapi | 133 } // namespace ppapi |
| 114 | 134 |
| 115 #endif // PPAPI_PROXY_PPB_FLASH_PROXY_H_ | 135 #endif // PPAPI_PROXY_PPB_FLASH_PROXY_H_ |
| OLD | NEW |