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

Unified Diff: ui/views/controls/menu/menu_runner.cc

Issue 10916180: Context menus on view elements should be positioned above the finger when (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch Created 8 years, 3 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 | « ui/views/controls/menu/menu_controller.cc ('k') | ui/views/controls/scrollbar/base_scroll_bar.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/menu/menu_runner.cc
diff --git a/ui/views/controls/menu/menu_runner.cc b/ui/views/controls/menu/menu_runner.cc
index 185e52cdd3ec3766fdf6f410277282780c74a166..877fc81ced444fcb96c6b8fcf5e1a2ae36e0c99d 100644
--- a/ui/views/controls/menu/menu_runner.cc
+++ b/ui/views/controls/menu/menu_runner.cc
@@ -10,6 +10,7 @@
#include "ui/views/controls/menu/menu_controller.h"
#include "ui/views/controls/menu/menu_controller_delegate.h"
#include "ui/views/controls/menu/menu_delegate.h"
+#include "ui/views/widget/widget.h"
#if defined(OS_WIN)
#include "base/win/win_util.h"
@@ -284,6 +285,10 @@ MenuRunner::RunResult MenuRunner::RunMenuAt(Widget* parent,
display_change_listener_.reset(
internal::DisplayChangeListener::Create(parent, this));
}
+ if ((types & MenuRunner::CONTEXT_MENU) && parent->GetCurrentEvent())
+ anchor = parent->GetCurrentEvent()->IsGestureEvent() ?
+ MenuItemView::BOTTOMCENTER : MenuItemView::TOPLEFT;
+
return holder_->RunMenuAt(parent, button, bounds, anchor, types);
}
« no previous file with comments | « ui/views/controls/menu/menu_controller.cc ('k') | ui/views/controls/scrollbar/base_scroll_bar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698