| 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" |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 | 155 |
| 156 struct PPB_Flash_Menu_Proxy::ShowRequest { | 156 struct PPB_Flash_Menu_Proxy::ShowRequest { |
| 157 HostResource menu; | 157 HostResource menu; |
| 158 int32_t selected_id; | 158 int32_t selected_id; |
| 159 }; | 159 }; |
| 160 | 160 |
| 161 void PPB_Flash_Menu_Proxy::OnMsgShow(const HostResource& menu, | 161 void PPB_Flash_Menu_Proxy::OnMsgShow(const HostResource& menu, |
| 162 const PP_Point& location) { | 162 const PP_Point& location) { |
| 163 ShowRequest* request = new ShowRequest; | 163 ShowRequest* request = new ShowRequest; |
| 164 request->menu = menu; | 164 request->menu = menu; |
| 165 CompletionCallback callback = callback_factory_.NewCallback( | 165 CompletionCallback callback = callback_factory_.NewOptionalCallback( |
| 166 &PPB_Flash_Menu_Proxy::SendShowACKToPlugin, request); | 166 &PPB_Flash_Menu_Proxy::SendShowACKToPlugin, request); |
| 167 | 167 |
| 168 EnterHostFromHostResource<PPB_Flash_Menu_API> enter(menu); | 168 EnterHostFromHostResource<PPB_Flash_Menu_API> enter(menu); |
| 169 int32_t result = PP_ERROR_BADRESOURCE; | 169 int32_t result = PP_ERROR_BADRESOURCE; |
| 170 if (enter.succeeded()) { | 170 if (enter.succeeded()) { |
| 171 result = enter.object()->Show(&location, | 171 result = enter.object()->Show(&location, |
| 172 &request->selected_id, | 172 &request->selected_id, |
| 173 callback.pp_completion_callback()); | 173 callback.pp_completion_callback()); |
| 174 } | 174 } |
| 175 if (result != PP_OK_COMPLETIONPENDING) { | 175 if (result != PP_OK_COMPLETIONPENDING) { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 195 dispatcher()->Send(new PpapiMsg_PPBFlashMenu_ShowACK( | 195 dispatcher()->Send(new PpapiMsg_PPBFlashMenu_ShowACK( |
| 196 INTERFACE_ID_PPB_FLASH_MENU, | 196 INTERFACE_ID_PPB_FLASH_MENU, |
| 197 request->menu, | 197 request->menu, |
| 198 request->selected_id, | 198 request->selected_id, |
| 199 result)); | 199 result)); |
| 200 delete request; | 200 delete request; |
| 201 } | 201 } |
| 202 | 202 |
| 203 } // namespace proxy | 203 } // namespace proxy |
| 204 } // namespace pp | 204 } // namespace pp |
| OLD | NEW |