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 #include "ppapi/proxy/ppb_flash_proxy.h" | 5 #include "ppapi/proxy/ppb_flash_proxy.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "ppapi/c/dev/pp_file_info_dev.h" | 9 #include "ppapi/c/dev/pp_file_info_dev.h" |
10 #include "ppapi/c/dev/ppb_font_dev.h" | 10 #include "ppapi/c/dev/ppb_font_dev.h" |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance); | 228 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance); |
229 if (!dispatcher) | 229 if (!dispatcher) |
230 return PP_FALSE; | 230 return PP_FALSE; |
231 | 231 |
232 PP_Bool result = PP_FALSE; | 232 PP_Bool result = PP_FALSE; |
233 dispatcher->Send(new PpapiHostMsg_PPBFlash_NavigateToURL( | 233 dispatcher->Send(new PpapiHostMsg_PPBFlash_NavigateToURL( |
234 INTERFACE_ID_PPB_FLASH, instance, url, target, &result)); | 234 INTERFACE_ID_PPB_FLASH, instance, url, target, &result)); |
235 return result; | 235 return result; |
236 } | 236 } |
237 | 237 |
238 const PPB_Flash ppb_flash = { | 238 const PPB_Flash flash_interface = { |
239 &SetInstanceAlwaysOnTop, | 239 &SetInstanceAlwaysOnTop, |
240 &DrawGlyphs, | 240 &DrawGlyphs, |
241 &GetProxyForURL, | 241 &GetProxyForURL, |
242 &OpenModuleLocalFile, | 242 &OpenModuleLocalFile, |
243 &RenameModuleLocalFile, | 243 &RenameModuleLocalFile, |
244 &DeleteModuleLocalFileOrDir, | 244 &DeleteModuleLocalFileOrDir, |
245 &CreateModuleLocalDir, | 245 &CreateModuleLocalDir, |
246 &QueryModuleLocalFile, | 246 &QueryModuleLocalFile, |
247 &GetModuleLocalDirContents, | 247 &GetModuleLocalDirContents, |
248 &FreeModuleLocalDirContents, | 248 &FreeModuleLocalDirContents, |
249 &NavigateToURL, | 249 &NavigateToURL, |
250 }; | 250 }; |
251 | 251 |
| 252 InterfaceProxy* CreateFlashProxy(Dispatcher* dispatcher, |
| 253 const void* target_interface) { |
| 254 return new PPB_Flash_Proxy(dispatcher, target_interface); |
| 255 } |
| 256 |
252 } // namespace | 257 } // namespace |
253 | 258 |
254 PPB_Flash_Proxy::PPB_Flash_Proxy(Dispatcher* dispatcher, | 259 PPB_Flash_Proxy::PPB_Flash_Proxy(Dispatcher* dispatcher, |
255 const void* target_interface) | 260 const void* target_interface) |
256 : InterfaceProxy(dispatcher, target_interface) { | 261 : InterfaceProxy(dispatcher, target_interface) { |
257 } | 262 } |
258 | 263 |
259 PPB_Flash_Proxy::~PPB_Flash_Proxy() { | 264 PPB_Flash_Proxy::~PPB_Flash_Proxy() { |
260 } | 265 } |
261 | 266 |
262 const void* PPB_Flash_Proxy::GetSourceInterface() const { | 267 // static |
263 return &ppb_flash; | 268 const InterfaceProxy::Info* PPB_Flash_Proxy::GetInfo() { |
264 } | 269 static const Info info = { |
265 | 270 &flash_interface, |
266 InterfaceID PPB_Flash_Proxy::GetInterfaceId() const { | 271 PPB_FLASH_INTERFACE, |
267 return INTERFACE_ID_PPB_FLASH; | 272 INTERFACE_ID_PPB_FLASH, |
| 273 true, |
| 274 &CreateFlashProxy, |
| 275 }; |
| 276 return &info; |
268 } | 277 } |
269 | 278 |
270 bool PPB_Flash_Proxy::OnMessageReceived(const IPC::Message& msg) { | 279 bool PPB_Flash_Proxy::OnMessageReceived(const IPC::Message& msg) { |
271 bool handled = true; | 280 bool handled = true; |
272 IPC_BEGIN_MESSAGE_MAP(PPB_Flash_Proxy, msg) | 281 IPC_BEGIN_MESSAGE_MAP(PPB_Flash_Proxy, msg) |
273 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_SetInstanceAlwaysOnTop, | 282 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_SetInstanceAlwaysOnTop, |
274 OnMsgSetInstanceAlwaysOnTop) | 283 OnMsgSetInstanceAlwaysOnTop) |
275 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_DrawGlyphs, | 284 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_DrawGlyphs, |
276 OnMsgDrawGlyphs) | 285 OnMsgDrawGlyphs) |
277 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_GetProxyForURL, | 286 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_GetProxyForURL, |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 void PPB_Flash_Proxy::OnMsgNavigateToURL(PP_Instance instance, | 409 void PPB_Flash_Proxy::OnMsgNavigateToURL(PP_Instance instance, |
401 const std::string& url, | 410 const std::string& url, |
402 const std::string& target, | 411 const std::string& target, |
403 PP_Bool* result) { | 412 PP_Bool* result) { |
404 *result = ppb_flash_target()->NavigateToURL(instance, url.c_str(), | 413 *result = ppb_flash_target()->NavigateToURL(instance, url.c_str(), |
405 target.c_str()); | 414 target.c_str()); |
406 } | 415 } |
407 | 416 |
408 } // namespace proxy | 417 } // namespace proxy |
409 } // namespace pp | 418 } // namespace pp |
OLD | NEW |