Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Side by Side Diff: ppapi/proxy/ppb_flash_proxy.cc

Issue 6432001: Implement proxy for FlashMenu and Run/QuitMessageLoop (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "base/message_loop.h"
8 #include "build/build_config.h" 9 #include "build/build_config.h"
9 #include "ppapi/c/dev/pp_file_info_dev.h" 10 #include "ppapi/c/dev/pp_file_info_dev.h"
10 #include "ppapi/c/dev/ppb_font_dev.h" 11 #include "ppapi/c/dev/ppb_font_dev.h"
11 #include "ppapi/c/pp_completion_callback.h" 12 #include "ppapi/c/pp_completion_callback.h"
12 #include "ppapi/c/pp_errors.h" 13 #include "ppapi/c/pp_errors.h"
13 #include "ppapi/c/pp_resource.h" 14 #include "ppapi/c/pp_resource.h"
14 #include "ppapi/c/private/ppb_flash.h" 15 #include "ppapi/c/private/ppb_flash.h"
15 #include "ppapi/proxy/plugin_dispatcher.h" 16 #include "ppapi/proxy/plugin_dispatcher.h"
16 #include "ppapi/proxy/plugin_resource.h" 17 #include "ppapi/proxy/plugin_resource.h"
17 #include "ppapi/proxy/ppapi_messages.h" 18 #include "ppapi/proxy/ppapi_messages.h"
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance); 229 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance);
229 if (!dispatcher) 230 if (!dispatcher)
230 return PP_FALSE; 231 return PP_FALSE;
231 232
232 PP_Bool result = PP_FALSE; 233 PP_Bool result = PP_FALSE;
233 dispatcher->Send(new PpapiHostMsg_PPBFlash_NavigateToURL( 234 dispatcher->Send(new PpapiHostMsg_PPBFlash_NavigateToURL(
234 INTERFACE_ID_PPB_FLASH, instance, url, target, &result)); 235 INTERFACE_ID_PPB_FLASH, instance, url, target, &result));
235 return result; 236 return result;
236 } 237 }
237 238
239 void RunMessageLoop(PP_Instance instance) {
240 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance);
241 if (!dispatcher)
242 return;
243 IPC::SyncMessage* msg = new PpapiHostMsg_PPBFlash_RunMessageLoop(
244 INTERFACE_ID_PPB_FLASH, instance);
245 msg->EnableMessagePumping();
246 dispatcher->Send(msg);
247 }
248
249 void QuitMessageLoop(PP_Instance instance) {
250 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance);
251 if (!dispatcher)
252 return;
253 dispatcher->Send(new PpapiHostMsg_PPBFlash_QuitMessageLoop(
254 INTERFACE_ID_PPB_FLASH, instance));
255 }
256
238 const PPB_Flash ppb_flash = { 257 const PPB_Flash ppb_flash = {
239 &SetInstanceAlwaysOnTop, 258 &SetInstanceAlwaysOnTop,
240 &DrawGlyphs, 259 &DrawGlyphs,
241 &GetProxyForURL, 260 &GetProxyForURL,
242 &OpenModuleLocalFile, 261 &OpenModuleLocalFile,
243 &RenameModuleLocalFile, 262 &RenameModuleLocalFile,
244 &DeleteModuleLocalFileOrDir, 263 &DeleteModuleLocalFileOrDir,
245 &CreateModuleLocalDir, 264 &CreateModuleLocalDir,
246 &QueryModuleLocalFile, 265 &QueryModuleLocalFile,
247 &GetModuleLocalDirContents, 266 &GetModuleLocalDirContents,
248 &FreeModuleLocalDirContents, 267 &FreeModuleLocalDirContents,
249 &NavigateToURL, 268 &NavigateToURL,
269 &RunMessageLoop,
270 &QuitMessageLoop,
250 }; 271 };
251 272
252 } // namespace 273 } // namespace
253 274
254 PPB_Flash_Proxy::PPB_Flash_Proxy(Dispatcher* dispatcher, 275 PPB_Flash_Proxy::PPB_Flash_Proxy(Dispatcher* dispatcher,
255 const void* target_interface) 276 const void* target_interface)
256 : InterfaceProxy(dispatcher, target_interface) { 277 : InterfaceProxy(dispatcher, target_interface) {
257 } 278 }
258 279
259 PPB_Flash_Proxy::~PPB_Flash_Proxy() { 280 PPB_Flash_Proxy::~PPB_Flash_Proxy() {
(...skipping 22 matching lines...) Expand all
282 OnMsgRenameModuleLocalFile) 303 OnMsgRenameModuleLocalFile)
283 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_DeleteModuleLocalFileOrDir, 304 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_DeleteModuleLocalFileOrDir,
284 OnMsgDeleteModuleLocalFileOrDir) 305 OnMsgDeleteModuleLocalFileOrDir)
285 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_CreateModuleLocalDir, 306 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_CreateModuleLocalDir,
286 OnMsgCreateModuleLocalDir) 307 OnMsgCreateModuleLocalDir)
287 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_QueryModuleLocalFile, 308 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_QueryModuleLocalFile,
288 OnMsgQueryModuleLocalFile) 309 OnMsgQueryModuleLocalFile)
289 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_GetModuleLocalDirContents, 310 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_GetModuleLocalDirContents,
290 OnMsgGetModuleLocalDirContents) 311 OnMsgGetModuleLocalDirContents)
291 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_NavigateToURL, OnMsgNavigateToURL) 312 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_NavigateToURL, OnMsgNavigateToURL)
313 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_RunMessageLoop,
314 OnMsgRunMessageLoop)
315 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_QuitMessageLoop,
316 OnMsgQuitMessageLoop)
292 IPC_MESSAGE_UNHANDLED(handled = false) 317 IPC_MESSAGE_UNHANDLED(handled = false)
293 IPC_END_MESSAGE_MAP() 318 IPC_END_MESSAGE_MAP()
294 // TODO(brettw) handle bad messages! 319 // TODO(brettw) handle bad messages!
295 return handled; 320 return handled;
296 } 321 }
297 322
298 void PPB_Flash_Proxy::OnMsgSetInstanceAlwaysOnTop( 323 void PPB_Flash_Proxy::OnMsgSetInstanceAlwaysOnTop(
299 PP_Instance instance, 324 PP_Instance instance,
300 PP_Bool on_top) { 325 PP_Bool on_top) {
301 ppb_flash_target()->SetInstanceAlwaysOnTop(instance, on_top); 326 ppb_flash_target()->SetInstanceAlwaysOnTop(instance, on_top);
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 } 423 }
399 424
400 void PPB_Flash_Proxy::OnMsgNavigateToURL(PP_Instance instance, 425 void PPB_Flash_Proxy::OnMsgNavigateToURL(PP_Instance instance,
401 const std::string& url, 426 const std::string& url,
402 const std::string& target, 427 const std::string& target,
403 PP_Bool* result) { 428 PP_Bool* result) {
404 *result = ppb_flash_target()->NavigateToURL(instance, url.c_str(), 429 *result = ppb_flash_target()->NavigateToURL(instance, url.c_str(),
405 target.c_str()); 430 target.c_str());
406 } 431 }
407 432
433 void PPB_Flash_Proxy::OnMsgRunMessageLoop(PP_Instance instance) {
434 ppb_flash_target()->RunMessageLoop(instance);
435 }
436
437 void PPB_Flash_Proxy::OnMsgQuitMessageLoop(PP_Instance instance) {
438 ppb_flash_target()->QuitMessageLoop(instance);
439 }
440
408 } // namespace proxy 441 } // namespace proxy
409 } // namespace pp 442 } // namespace pp
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698