Index: athena/content/web_contents_view_delegate_factory_impl.cc |
diff --git a/athena/content/web_contents_view_delegate_factory_impl.cc b/athena/content/web_contents_view_delegate_factory_impl.cc |
index 3346aee3ccc7dfbe31d75f5aa0e3aaa007685d71..003957de5a7c5dce4957345aad02254e5ca71447 100644 |
--- a/athena/content/web_contents_view_delegate_factory_impl.cc |
+++ b/athena/content/web_contents_view_delegate_factory_impl.cc |
@@ -81,37 +81,10 @@ class WebContentsViewDelegateImpl : public content::WebContentsViewDelegate { |
void ShowMenu(scoped_ptr<RenderViewContextMenuImpl> menu) { |
context_menu_.reset(menu.release()); |
- if (!context_menu_.get()) |
+ if (!context_menu_) |
return; |
- // Menus need a Widget to work. If we're not the active tab we won't |
- // necessarily be in a widget. |
- views::Widget* top_level_widget = GetTopLevelWidget(); |
- if (!top_level_widget) |
- return; |
- |
- const content::ContextMenuParams& params = context_menu_->params(); |
- // Don't show empty menus. |
- if (context_menu_->menu_model().GetItemCount() == 0) |
- return; |
- |
- gfx::Point screen_point(params.x, params.y); |
- |
- // Convert from target window coordinates to root window coordinates. |
- aura::Window* target_window = GetActiveNativeView(); |
- aura::Window* root_window = target_window->GetRootWindow(); |
- aura::client::ScreenPositionClient* screen_position_client = |
- aura::client::GetScreenPositionClient(root_window); |
- if (screen_position_client) { |
- screen_position_client->ConvertPointToScreen(target_window, |
- &screen_point); |
- } |
- // Enable recursive tasks on the message loop so we can get updates while |
- // the context menu is being displayed. |
- base::MessageLoop::ScopedNestableTaskAllower allow( |
- base::MessageLoop::current()); |
- context_menu_->RunMenuAt( |
- top_level_widget, screen_point, params.source_type); |
+ context_menu_->Show(); |
} |
aura::Window* GetActiveNativeView() { |