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 20 matching lines...) Expand all Loading... |
71 virtual int32_t Navigate(PP_Instance instance, | 69 virtual int32_t Navigate(PP_Instance instance, |
72 const URLRequestInfoData& data, | 70 const URLRequestInfoData& data, |
73 const char* target, | 71 const char* target, |
74 PP_Bool from_user_action) OVERRIDE; | 72 PP_Bool from_user_action) OVERRIDE; |
75 virtual double GetLocalTimeZoneOffset(PP_Instance instance, | 73 virtual double GetLocalTimeZoneOffset(PP_Instance instance, |
76 PP_Time t) OVERRIDE; | 74 PP_Time t) OVERRIDE; |
77 virtual PP_Bool IsRectTopmost(PP_Instance instance, | 75 virtual PP_Bool IsRectTopmost(PP_Instance instance, |
78 const PP_Rect* rect) OVERRIDE; | 76 const PP_Rect* rect) OVERRIDE; |
79 virtual PP_Var GetSetting(PP_Instance instance, | 77 virtual PP_Var GetSetting(PP_Instance instance, |
80 PP_FlashSetting setting) OVERRIDE; | 78 PP_FlashSetting setting) OVERRIDE; |
81 virtual bool CreateThreadAdapterForInstance(PP_Instance instance) OVERRIDE; | |
82 virtual void ClearThreadAdapterForInstance(PP_Instance instance) OVERRIDE; | |
83 virtual int32_t OpenFile(PP_Instance instance, | |
84 const char* path, | |
85 int32_t mode, | |
86 PP_FileHandle* file) OVERRIDE; | |
87 virtual int32_t RenameFile(PP_Instance instance, | |
88 const char* path_from, | |
89 const char* path_to) OVERRIDE; | |
90 virtual int32_t DeleteFileOrDir(PP_Instance instance, | |
91 const char* path, | |
92 PP_Bool recursive) OVERRIDE; | |
93 virtual int32_t CreateDir(PP_Instance instance, const char* path) OVERRIDE; | |
94 virtual int32_t QueryFile(PP_Instance instance, | |
95 const char* path, | |
96 PP_FileInfo* info) OVERRIDE; | |
97 virtual int32_t GetDirContents(PP_Instance instance, | |
98 const char* path, | |
99 PP_DirContents_Dev** contents) OVERRIDE; | |
100 virtual int32_t CreateTemporaryFile(PP_Instance instance, | |
101 PP_FileHandle* file) OVERRIDE; | |
102 virtual int32_t OpenFileRef(PP_Instance instance, | |
103 PP_Resource file_ref, | |
104 int32_t mode, | |
105 PP_FileHandle* file) OVERRIDE; | |
106 virtual int32_t QueryFileRef(PP_Instance instance, | |
107 PP_Resource file_ref, | |
108 PP_FileInfo* info) OVERRIDE; | |
109 | 79 |
110 static const ApiID kApiID = API_ID_PPB_FLASH; | 80 static const ApiID kApiID = API_ID_PPB_FLASH; |
111 | 81 |
112 private: | 82 private: |
113 // Message handlers. | 83 // Message handlers. |
114 void OnHostMsgSetInstanceAlwaysOnTop(PP_Instance instance, | 84 void OnHostMsgSetInstanceAlwaysOnTop(PP_Instance instance, |
115 PP_Bool on_top); | 85 PP_Bool on_top); |
116 void OnHostMsgDrawGlyphs(PP_Instance instance, | 86 void OnHostMsgDrawGlyphs(PP_Instance instance, |
117 const PPBFlash_DrawGlyphs_Params& params, | 87 const PPBFlash_DrawGlyphs_Params& params, |
118 PP_Bool* result); | 88 PP_Bool* result); |
119 void OnHostMsgNavigate(PP_Instance instance, | 89 void OnHostMsgNavigate(PP_Instance instance, |
120 const URLRequestInfoData& data, | 90 const URLRequestInfoData& data, |
121 const std::string& target, | 91 const std::string& target, |
122 PP_Bool from_user_action, | 92 PP_Bool from_user_action, |
123 int32_t* result); | 93 int32_t* result); |
124 void OnHostMsgGetLocalTimeZoneOffset(PP_Instance instance, PP_Time t, | 94 void OnHostMsgGetLocalTimeZoneOffset(PP_Instance instance, PP_Time t, |
125 double* result); | 95 double* result); |
126 void OnHostMsgIsRectTopmost(PP_Instance instance, | 96 void OnHostMsgIsRectTopmost(PP_Instance instance, |
127 PP_Rect rect, | 97 PP_Rect rect, |
128 PP_Bool* result); | 98 PP_Bool* result); |
129 void OnHostMsgOpenFileRef(PP_Instance instance, | |
130 const ppapi::HostResource& host_resource, | |
131 int32_t mode, | |
132 IPC::PlatformFileForTransit* file_handle, | |
133 int32_t* result); | |
134 void OnHostMsgQueryFileRef(PP_Instance instance, | |
135 const ppapi::HostResource& host_resource, | |
136 PP_FileInfo* info, | |
137 int32_t* result); | |
138 void OnHostMsgGetSetting(PP_Instance instance, | 99 void OnHostMsgGetSetting(PP_Instance instance, |
139 PP_FlashSetting setting, | 100 PP_FlashSetting setting, |
140 SerializedVarReturnValue result); | 101 SerializedVarReturnValue result); |
141 void OnHostMsgInvokePrinting(PP_Instance instance); | 102 void OnHostMsgInvokePrinting(PP_Instance instance); |
142 | 103 |
143 DISALLOW_COPY_AND_ASSIGN(PPB_Flash_Proxy); | 104 DISALLOW_COPY_AND_ASSIGN(PPB_Flash_Proxy); |
144 }; | 105 }; |
145 | 106 |
146 } // namespace proxy | 107 } // namespace proxy |
147 } // namespace ppapi | 108 } // namespace ppapi |
148 | 109 |
149 #endif // PPAPI_PROXY_PPB_FLASH_PROXY_H_ | 110 #endif // PPAPI_PROXY_PPB_FLASH_PROXY_H_ |
OLD | NEW |