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

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

Issue 7115005: Reverse menu anchor position provided to views::MenuItemView for RTL languages. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed BrowserActionOverflowMenuController. Created 9 years, 6 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 | « chrome/browser/ui/views/wrench_menu.cc ('k') | views/controls/menu/menu_item_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/menu/menu_controller.cc
diff --git a/views/controls/menu/menu_controller.cc b/views/controls/menu/menu_controller.cc
index 70f1a8b444a89a37e4525f7c68bd3740242d89c0..e1b38aafa1a3c9256e4f763c74bbcc0332b9926a 100644
--- a/views/controls/menu/menu_controller.cc
+++ b/views/controls/menu/menu_controller.cc
@@ -1031,7 +1031,14 @@ void MenuController::UpdateInitialLocation(
// nicely and menus close prematurely.
pending_state_.initial_bounds.Inset(0, 1);
}
- pending_state_.anchor = position;
+
+ // Reverse anchor position for RTL languages.
+ if (base::i18n::IsRTL()) {
+ pending_state_.anchor = position == MenuItemView::TOPRIGHT ?
+ MenuItemView::TOPLEFT : MenuItemView::TOPRIGHT;
+ } else {
+ pending_state_.anchor = position;
+ }
// Calculate the bounds of the monitor we'll show menus on. Do this once to
// avoid repeated system queries for the info.
« no previous file with comments | « chrome/browser/ui/views/wrench_menu.cc ('k') | views/controls/menu/menu_item_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698