Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Unified Diff: athena/content/web_contents_view_delegate_factory_impl.cc

Issue 678653003: Remove Downcasting RVContextMenuBase in ContextMenuDeleagate implementations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove virtual keyword when override is specified Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « athena/content/render_view_context_menu_impl.cc ('k') | chrome/browser/apps/app_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {
« no previous file with comments | « athena/content/render_view_context_menu_impl.cc ('k') | chrome/browser/apps/app_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698