Chromium Code Reviews| 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_menu_proxy.h" | 5 #include "ppapi/proxy/ppb_flash_menu_proxy.h" |
| 6 | 6 |
| 7 #include "ppapi/c/pp_errors.h" | 7 #include "ppapi/c/pp_errors.h" |
| 8 #include "ppapi/c/private/ppb_flash_menu.h" | 8 #include "ppapi/c/private/ppb_flash_menu.h" |
| 9 #include "ppapi/proxy/enter_proxy.h" | 9 #include "ppapi/proxy/enter_proxy.h" |
| 10 #include "ppapi/proxy/ppapi_messages.h" | 10 #include "ppapi/proxy/ppapi_messages.h" |
| 11 #include "ppapi/thunk/enter.h" | 11 #include "ppapi/thunk/enter.h" |
| 12 #include "ppapi/thunk/ppb_flash_menu_api.h" | 12 #include "ppapi/thunk/ppb_flash_menu_api.h" |
| 13 #include "ppapi/thunk/resource_creation_api.h" | 13 #include "ppapi/thunk/resource_creation_api.h" |
| 14 #include "ppapi/thunk/thunk.h" | 14 #include "ppapi/thunk/thunk.h" |
|
yzshen1
2011/10/21 04:04:06
You may not need this include any more. (Some othe
| |
| 15 | 15 |
| 16 using ppapi::thunk::EnterFunctionNoLock; | 16 using ppapi::thunk::EnterFunctionNoLock; |
| 17 using ppapi::thunk::PPB_Flash_Menu_API; | 17 using ppapi::thunk::PPB_Flash_Menu_API; |
| 18 using ppapi::thunk::ResourceCreationAPI; | 18 using ppapi::thunk::ResourceCreationAPI; |
| 19 | 19 |
| 20 namespace ppapi { | 20 namespace ppapi { |
| 21 namespace proxy { | 21 namespace proxy { |
| 22 | 22 |
| 23 class FlashMenu : public PPB_Flash_Menu_API, public Resource { | 23 class FlashMenu : public PPB_Flash_Menu_API, public Resource { |
| 24 public: | 24 public: |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 85 | 85 |
| 86 PPB_Flash_Menu_Proxy::PPB_Flash_Menu_Proxy(Dispatcher* dispatcher) | 86 PPB_Flash_Menu_Proxy::PPB_Flash_Menu_Proxy(Dispatcher* dispatcher) |
| 87 : InterfaceProxy(dispatcher), | 87 : InterfaceProxy(dispatcher), |
| 88 callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { | 88 callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { |
| 89 } | 89 } |
| 90 | 90 |
| 91 PPB_Flash_Menu_Proxy::~PPB_Flash_Menu_Proxy() { | 91 PPB_Flash_Menu_Proxy::~PPB_Flash_Menu_Proxy() { |
| 92 } | 92 } |
| 93 | 93 |
| 94 // static | 94 // static |
| 95 const InterfaceProxy::Info* PPB_Flash_Menu_Proxy::GetInfo() { | |
| 96 static const Info info = { | |
| 97 ppapi::thunk::GetPPB_Flash_Menu_Thunk(), | |
| 98 PPB_FLASH_MENU_INTERFACE, | |
| 99 API_ID_PPB_FLASH_MENU, | |
| 100 true, | |
| 101 &CreateFlashMenuProxy, | |
| 102 }; | |
| 103 return &info; | |
| 104 } | |
| 105 | |
| 106 // static | |
| 107 PP_Resource PPB_Flash_Menu_Proxy::CreateProxyResource( | 95 PP_Resource PPB_Flash_Menu_Proxy::CreateProxyResource( |
| 108 PP_Instance instance_id, | 96 PP_Instance instance_id, |
| 109 const PP_Flash_Menu* menu_data) { | 97 const PP_Flash_Menu* menu_data) { |
| 110 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance_id); | 98 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance_id); |
| 111 if (!dispatcher) | 99 if (!dispatcher) |
| 112 return 0; | 100 return 0; |
| 113 | 101 |
| 114 HostResource result; | 102 HostResource result; |
| 115 SerializedFlashMenu serialized_menu; | 103 SerializedFlashMenu serialized_menu; |
| 116 if (!serialized_menu.SetPPMenu(menu_data)) | 104 if (!serialized_menu.SetPPMenu(menu_data)) |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 184 dispatcher()->Send(new PpapiMsg_PPBFlashMenu_ShowACK( | 172 dispatcher()->Send(new PpapiMsg_PPBFlashMenu_ShowACK( |
| 185 API_ID_PPB_FLASH_MENU, | 173 API_ID_PPB_FLASH_MENU, |
| 186 request->menu, | 174 request->menu, |
| 187 request->selected_id, | 175 request->selected_id, |
| 188 result)); | 176 result)); |
| 189 delete request; | 177 delete request; |
| 190 } | 178 } |
| 191 | 179 |
| 192 } // namespace proxy | 180 } // namespace proxy |
| 193 } // namespace ppapi | 181 } // namespace ppapi |
| OLD | NEW |