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

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

Issue 10917102: Context menus should appear above the touch point if invoked by long press. (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
Index: ui/views/controls/menu/menu_controller.cc
diff --git a/ui/views/controls/menu/menu_controller.cc b/ui/views/controls/menu/menu_controller.cc
index c8e966d66701e3f80a29661b05d0cdea7eb75873..d24124aa2d95a1cfa7e0222469ab3e42bfa47be3 100644
--- a/ui/views/controls/menu/menu_controller.cc
+++ b/ui/views/controls/menu/menu_controller.cc
@@ -1564,6 +1564,9 @@ gfx::Rect MenuController::CalculateMenuBounds(MenuItemView* item,
x = x + state_.initial_bounds.width() - pref.width();
if (MenuConfig::instance().offset_context_menus && state_.context_menu)
x -= 1;
+ } else if (state_.anchor == MenuItemView::BOTTOMCENTER) {
+ x = x - (pref.width() - state_.initial_bounds.width()) / 2;
+ y = std::max(0, state_.initial_bounds.y() - pref.height());
}
if (!state_.monitor_bounds.IsEmpty() &&

Powered by Google App Engine
This is Rietveld 408576698