Chromium Code Reviews| Index: chrome/renderer/render_view.cc |
| =================================================================== |
| --- chrome/renderer/render_view.cc (revision 67601) |
| +++ chrome/renderer/render_view.cc (working copy) |
| @@ -517,7 +517,8 @@ |
| accessibility_ack_pending_(false), |
| pending_app_icon_requests_(0), |
| session_storage_namespace_id_(session_storage_namespace_id), |
| - decrement_shared_popup_at_destruction_(false) { |
| + decrement_shared_popup_at_destruction_(false), |
| + plugin_menu_event_listener_(NULL) { |
| #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 |
| @@ -807,6 +808,15 @@ |
| return CreateNPAPIPlugin(frame, params, info.path, mime_type); |
| } |
| +void RenderView::PluginMenuEventListenerInstall(BlockedPlugin* listening) { |
| + plugin_menu_event_listener_ = listening; |
|
Bernhard Bauer
2010/12/07 17:03:33
I'm not happy that we add a generic menu event lis
|
| +} |
| + |
| +void RenderView::PluginMenuEventListenerDestroyed(BlockedPlugin* dead) { |
| + if (plugin_menu_event_listener_ == dead) |
| + plugin_menu_event_listener_ = NULL; |
| +} |
| + |
| void RenderView::RegisterPluginDelegate(WebPluginDelegateProxy* delegate) { |
| plugin_delegates_.insert(delegate); |
| // If the renderer is visible, set initial visibility and focus state. |
| @@ -2391,6 +2401,7 @@ |
| void RenderView::showContextMenu( |
| WebFrame* frame, const WebContextMenuData& data) { |
| + plugin_menu_event_listener_ = NULL; |
| ContextMenuParams params = ContextMenuParams(data); |
| if (!params.misspelled_word.empty() && RenderThread::current()) { |
| int misspelled_offset, misspelled_length; |
| @@ -4690,7 +4701,10 @@ |
| } |
| void RenderView::OnCustomContextMenuAction(unsigned action) { |
| - webview()->performCustomContextMenuAction(action); |
| + if (plugin_menu_event_listener_) |
| + plugin_menu_event_listener_->MenuOptionSelected(action); |
| + else |
| + webview()->performCustomContextMenuAction(action); |
| } |
| void RenderView::OnTranslatePage(int page_id, |