| 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 "content/renderer/pepper_plugin_delegate_impl.h" | 5 #include "content/renderer/pepper_plugin_delegate_impl.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 #include <queue> | 8 #include <queue> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 1208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1219 pending_context_menus_.Remove(request_id); | 1219 pending_context_menus_.Remove(request_id); |
| 1220 return PP_ERROR_FAILED; | 1220 return PP_ERROR_FAILED; |
| 1221 } | 1221 } |
| 1222 | 1222 |
| 1223 return PP_OK_COMPLETIONPENDING; | 1223 return PP_OK_COMPLETIONPENDING; |
| 1224 } | 1224 } |
| 1225 | 1225 |
| 1226 void PepperPluginDelegateImpl::OnContextMenuClosed( | 1226 void PepperPluginDelegateImpl::OnContextMenuClosed( |
| 1227 const webkit_glue::CustomContextMenuContext& custom_context) { | 1227 const webkit_glue::CustomContextMenuContext& custom_context) { |
| 1228 int request_id = custom_context.request_id; | 1228 int request_id = custom_context.request_id; |
| 1229 scoped_refptr<webkit::ppapi::PPB_Flash_Menu_Impl> menu = | 1229 scoped_refptr<webkit::ppapi::PPB_Flash_Menu_Impl>* menu_ptr = |
| 1230 *pending_context_menus_.Lookup(request_id); | 1230 pending_context_menus_.Lookup(request_id); |
| 1231 if (!menu) { | 1231 if (!menu_ptr) { |
| 1232 NOTREACHED() << "CompleteShowContextMenu() called twice for the same menu."; | 1232 NOTREACHED() << "CompleteShowContextMenu() called twice for the same menu."; |
| 1233 return; | 1233 return; |
| 1234 } | 1234 } |
| 1235 scoped_refptr<webkit::ppapi::PPB_Flash_Menu_Impl> menu = *menu_ptr; |
| 1236 DCHECK(menu.get()); |
| 1235 pending_context_menus_.Remove(request_id); | 1237 pending_context_menus_.Remove(request_id); |
| 1236 | 1238 |
| 1237 if (has_saved_context_menu_action_) { | 1239 if (has_saved_context_menu_action_) { |
| 1238 menu->CompleteShow(PP_OK, saved_context_menu_action_); | 1240 menu->CompleteShow(PP_OK, saved_context_menu_action_); |
| 1239 has_saved_context_menu_action_ = false; | 1241 has_saved_context_menu_action_ = false; |
| 1240 saved_context_menu_action_ = 0; | 1242 saved_context_menu_action_ = 0; |
| 1241 } else { | 1243 } else { |
| 1242 menu->CompleteShow(PP_ERROR_USERCANCEL, 0); | 1244 menu->CompleteShow(PP_ERROR_USERCANCEL, 0); |
| 1243 } | 1245 } |
| 1244 } | 1246 } |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1344 if (!base::SharedMemory::IsHandleValid(handle)) { | 1346 if (!base::SharedMemory::IsHandleValid(handle)) { |
| 1345 DLOG(WARNING) << "Browser failed to allocate shared memory"; | 1347 DLOG(WARNING) << "Browser failed to allocate shared memory"; |
| 1346 return NULL; | 1348 return NULL; |
| 1347 } | 1349 } |
| 1348 return new base::SharedMemory(handle, false); | 1350 return new base::SharedMemory(handle, false); |
| 1349 } | 1351 } |
| 1350 | 1352 |
| 1351 ppapi::Preferences PepperPluginDelegateImpl::GetPreferences() { | 1353 ppapi::Preferences PepperPluginDelegateImpl::GetPreferences() { |
| 1352 return ppapi::Preferences(render_view_->webkit_preferences()); | 1354 return ppapi::Preferences(render_view_->webkit_preferences()); |
| 1353 } | 1355 } |
| OLD | NEW |