Chromium Code Reviews| Index: chrome/renderer/render_view.cc |
| diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc |
| index 1e2be189e12e8020a132d90d799b4d82b4a3190c..99ac56259b152bff5ec67cf66adca488d824da9e 100644 |
| --- a/chrome/renderer/render_view.cc |
| +++ b/chrome/renderer/render_view.cc |
| @@ -569,7 +569,9 @@ RenderView::RenderView(RenderThreadBase* render_thread, |
| device_orientation_dispatcher_(NULL), |
| accessibility_ack_pending_(false), |
| pending_app_icon_requests_(0), |
| - session_storage_namespace_id_(session_storage_namespace_id) { |
| + session_storage_namespace_id_(session_storage_namespace_id), |
| + has_saved_context_menu_action_(false), |
| + saved_context_menu_action_(0) { |
| #if defined(OS_MACOSX) |
| // On Mac, the select popups are rendered by the browser. |
| // Note that we don't do this in RenderMain otherwise this would not be called |
| @@ -4712,8 +4714,17 @@ void RenderView::OnSetAltErrorPageURL(const GURL& url) { |
| alternate_error_page_url_ = url; |
| } |
| -void RenderView::OnCustomContextMenuAction(unsigned action) { |
| - webview()->performCustomContextMenuAction(action); |
| +void RenderView::OnCustomContextMenuAction( |
| + const webkit_glue::CustomContextMenuContext& custom_context, |
| + unsigned action) { |
| + if (custom_context.is_pepper_menu) { |
| + // Just save the action. |
| + DCHECK(!has_saved_context_menu_action_); |
| + has_saved_context_menu_action_ = true; |
|
brettw
2011/01/29 00:56:52
It would be nice if this was on the PepperPluginDe
viettrungluu
2011/01/29 21:49:14
Done. I just have the RenderView bounce things ove
|
| + saved_context_menu_action_ = action; |
| + } else { |
| + webview()->performCustomContextMenuAction(action); |
| + } |
| } |
| void RenderView::OnTranslatePage(int page_id, |
| @@ -5770,6 +5781,15 @@ void RenderView::OnJavaScriptStressTestControl(int cmd, int param) { |
| } |
| } |
| -void RenderView::OnContextMenuClosed() { |
| - context_menu_node_.reset(); |
| +void RenderView::OnContextMenuClosed( |
| + const webkit_glue::CustomContextMenuContext& custom_context) { |
| + if (custom_context.is_pepper_menu) { |
| + pepper_delegate_.CompleteShowContextMenu(custom_context.request_id, |
| + has_saved_context_menu_action_, |
| + saved_context_menu_action_); |
| + has_saved_context_menu_action_ = false; |
| + saved_context_menu_action_ = 0; |
| + } else { |
| + context_menu_node_.reset(); |
| + } |
| } |