| 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> | |
| 10 | 9 |
| 11 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 12 #include "ipc/ipc_platform_file.h" | |
| 13 #include "ppapi/c/pp_bool.h" | 11 #include "ppapi/c/pp_bool.h" |
| 14 #include "ppapi/c/pp_instance.h" | 12 #include "ppapi/c/pp_instance.h" |
| 15 #include "ppapi/c/pp_module.h" | 13 #include "ppapi/c/pp_module.h" |
| 16 #include "ppapi/c/pp_time.h" | 14 #include "ppapi/c/pp_time.h" |
| 17 #include "ppapi/c/private/ppb_flash.h" | 15 #include "ppapi/c/private/ppb_flash.h" |
| 18 #include "ppapi/proxy/interface_proxy.h" | 16 #include "ppapi/proxy/interface_proxy.h" |
| 19 #include "ppapi/proxy/serialized_var.h" | 17 #include "ppapi/proxy/serialized_var.h" |
| 20 #include "ppapi/shared_impl/host_resource.h" | 18 #include "ppapi/shared_impl/host_resource.h" |
| 21 #include "ppapi/shared_impl/ppb_flash_shared.h" | 19 #include "ppapi/thunk/ppb_flash_api.h" |
| 22 | 20 |
| 23 struct PPB_Flash_Print_1_0; | 21 struct PPB_Flash_Print_1_0; |
| 24 | 22 |
| 25 namespace ppapi { | 23 namespace ppapi { |
| 26 | 24 |
| 27 struct URLRequestInfoData; | 25 struct URLRequestInfoData; |
| 28 | 26 |
| 29 namespace proxy { | 27 namespace proxy { |
| 30 | 28 |
| 31 struct PPBFlash_DrawGlyphs_Params; | 29 struct PPBFlash_DrawGlyphs_Params; |
| 32 struct SerializedDirEntry; | 30 struct SerializedDirEntry; |
| 33 class SerializedVarReturnValue; | 31 class SerializedVarReturnValue; |
| 34 | 32 |
| 35 /////////////////////////// WARNING:DEPRECTATED //////////////////////////////// | 33 /////////////////////////// WARNING:DEPRECTATED //////////////////////////////// |
| 36 // Please do not add any new functions to this proxy. They should be | 34 // Please do not add any new functions to this proxy. They should be |
| 37 // implemented in the new-style resource proxy (see flash_resource.h). | 35 // implemented in the new-style resource proxy (see flash_resource.h). |
| 38 // TODO(raymes): All of these functions should be moved to the new-style proxy. | 36 // TODO(raymes): All of these functions should be moved to the new-style proxy. |
| 39 //////////////////////////////////////////////////////////////////////////////// | 37 //////////////////////////////////////////////////////////////////////////////// |
| 40 class PPB_Flash_Proxy : public InterfaceProxy, public PPB_Flash_Shared { | 38 class PPB_Flash_Proxy : public InterfaceProxy, public thunk::PPB_Flash_API { |
| 41 public: | 39 public: |
| 42 explicit PPB_Flash_Proxy(Dispatcher* dispatcher); | 40 explicit PPB_Flash_Proxy(Dispatcher* dispatcher); |
| 43 virtual ~PPB_Flash_Proxy(); | 41 virtual ~PPB_Flash_Proxy(); |
| 44 | 42 |
| 45 // This flash proxy also proxies the PPB_Flash_Print interface. This one | 43 // This flash proxy also proxies the PPB_Flash_Print interface. This one |
| 46 // doesn't use the regular thunk system because the _impl side is actually in | 44 // doesn't use the regular thunk system because the _impl side is actually in |
| 47 // Chrome rather than with the rest of the interface implementations. | 45 // Chrome rather than with the rest of the interface implementations. |
| 48 static const PPB_Flash_Print_1_0* GetFlashPrintInterface(); | 46 static const PPB_Flash_Print_1_0* GetFlashPrintInterface(); |
| 49 | 47 |
| 50 // InterfaceProxy implementation. | 48 // InterfaceProxy implementation. |
| (...skipping 21 matching lines...) Expand all Loading... |
| 72 virtual int32_t Navigate(PP_Instance instance, | 70 virtual int32_t Navigate(PP_Instance instance, |
| 73 const URLRequestInfoData& data, | 71 const URLRequestInfoData& data, |
| 74 const char* target, | 72 const char* target, |
| 75 PP_Bool from_user_action) OVERRIDE; | 73 PP_Bool from_user_action) OVERRIDE; |
| 76 virtual double GetLocalTimeZoneOffset(PP_Instance instance, | 74 virtual double GetLocalTimeZoneOffset(PP_Instance instance, |
| 77 PP_Time t) OVERRIDE; | 75 PP_Time t) OVERRIDE; |
| 78 virtual PP_Bool IsRectTopmost(PP_Instance instance, | 76 virtual PP_Bool IsRectTopmost(PP_Instance instance, |
| 79 const PP_Rect* rect) OVERRIDE; | 77 const PP_Rect* rect) OVERRIDE; |
| 80 virtual PP_Var GetSetting(PP_Instance instance, | 78 virtual PP_Var GetSetting(PP_Instance instance, |
| 81 PP_FlashSetting setting) OVERRIDE; | 79 PP_FlashSetting setting) OVERRIDE; |
| 82 virtual bool CreateThreadAdapterForInstance(PP_Instance instance) OVERRIDE; | |
| 83 virtual void ClearThreadAdapterForInstance(PP_Instance instance) OVERRIDE; | |
| 84 virtual int32_t OpenFile(PP_Instance instance, | |
| 85 const char* path, | |
| 86 int32_t mode, | |
| 87 PP_FileHandle* file) OVERRIDE; | |
| 88 virtual int32_t RenameFile(PP_Instance instance, | |
| 89 const char* path_from, | |
| 90 const char* path_to) OVERRIDE; | |
| 91 virtual int32_t DeleteFileOrDir(PP_Instance instance, | |
| 92 const char* path, | |
| 93 PP_Bool recursive) OVERRIDE; | |
| 94 virtual int32_t CreateDir(PP_Instance instance, const char* path) OVERRIDE; | |
| 95 virtual int32_t QueryFile(PP_Instance instance, | |
| 96 const char* path, | |
| 97 PP_FileInfo* info) OVERRIDE; | |
| 98 virtual int32_t GetDirContents(PP_Instance instance, | |
| 99 const char* path, | |
| 100 PP_DirContents_Dev** contents) OVERRIDE; | |
| 101 virtual int32_t CreateTemporaryFile(PP_Instance instance, | |
| 102 PP_FileHandle* file) OVERRIDE; | |
| 103 virtual int32_t OpenFileRef(PP_Instance instance, | |
| 104 PP_Resource file_ref, | |
| 105 int32_t mode, | |
| 106 PP_FileHandle* file) OVERRIDE; | |
| 107 virtual int32_t QueryFileRef(PP_Instance instance, | |
| 108 PP_Resource file_ref, | |
| 109 PP_FileInfo* info) OVERRIDE; | |
| 110 | 80 |
| 111 static const ApiID kApiID = API_ID_PPB_FLASH; | 81 static const ApiID kApiID = API_ID_PPB_FLASH; |
| 112 | 82 |
| 113 private: | 83 private: |
| 114 // Message handlers. | 84 // Message handlers. |
| 115 void OnHostMsgSetInstanceAlwaysOnTop(PP_Instance instance, | 85 void OnHostMsgSetInstanceAlwaysOnTop(PP_Instance instance, |
| 116 PP_Bool on_top); | 86 PP_Bool on_top); |
| 117 void OnHostMsgDrawGlyphs(PP_Instance instance, | 87 void OnHostMsgDrawGlyphs(PP_Instance instance, |
| 118 const PPBFlash_DrawGlyphs_Params& params, | 88 const PPBFlash_DrawGlyphs_Params& params, |
| 119 PP_Bool* result); | 89 PP_Bool* result); |
| 120 void OnHostMsgNavigate(PP_Instance instance, | 90 void OnHostMsgNavigate(PP_Instance instance, |
| 121 const URLRequestInfoData& data, | 91 const URLRequestInfoData& data, |
| 122 const std::string& target, | 92 const std::string& target, |
| 123 PP_Bool from_user_action, | 93 PP_Bool from_user_action, |
| 124 int32_t* result); | 94 int32_t* result); |
| 125 void OnHostMsgGetLocalTimeZoneOffset(PP_Instance instance, PP_Time t, | 95 void OnHostMsgGetLocalTimeZoneOffset(PP_Instance instance, PP_Time t, |
| 126 double* result); | 96 double* result); |
| 127 void OnHostMsgIsRectTopmost(PP_Instance instance, | 97 void OnHostMsgIsRectTopmost(PP_Instance instance, |
| 128 PP_Rect rect, | 98 PP_Rect rect, |
| 129 PP_Bool* result); | 99 PP_Bool* result); |
| 130 void OnHostMsgOpenFileRef(PP_Instance instance, | |
| 131 const ppapi::HostResource& host_resource, | |
| 132 int32_t mode, | |
| 133 IPC::PlatformFileForTransit* file_handle, | |
| 134 int32_t* result); | |
| 135 void OnHostMsgQueryFileRef(PP_Instance instance, | |
| 136 const ppapi::HostResource& host_resource, | |
| 137 PP_FileInfo* info, | |
| 138 int32_t* result); | |
| 139 void OnHostMsgGetSetting(PP_Instance instance, | 100 void OnHostMsgGetSetting(PP_Instance instance, |
| 140 PP_FlashSetting setting, | 101 PP_FlashSetting setting, |
| 141 SerializedVarReturnValue result); | 102 SerializedVarReturnValue result); |
| 142 void OnHostMsgInvokePrinting(PP_Instance instance); | 103 void OnHostMsgInvokePrinting(PP_Instance instance); |
| 143 | 104 |
| 144 DISALLOW_COPY_AND_ASSIGN(PPB_Flash_Proxy); | 105 DISALLOW_COPY_AND_ASSIGN(PPB_Flash_Proxy); |
| 145 }; | 106 }; |
| 146 | 107 |
| 147 } // namespace proxy | 108 } // namespace proxy |
| 148 } // namespace ppapi | 109 } // namespace ppapi |
| 149 | 110 |
| 150 #endif // PPAPI_PROXY_PPB_FLASH_PROXY_H_ | 111 #endif // PPAPI_PROXY_PPB_FLASH_PROXY_H_ |
| OLD | NEW |