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

Unified Diff: chrome/browser/chromeos/login/keyboard_switch_menu.cc

Issue 6962012: Convert ChromiumOS input method menu to views::MenuItemView implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix comments. 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 | « no previous file | chrome/browser/chromeos/status/input_method_menu.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/keyboard_switch_menu.cc
diff --git a/chrome/browser/chromeos/login/keyboard_switch_menu.cc b/chrome/browser/chromeos/login/keyboard_switch_menu.cc
index 3bc5dfefb04ee6a5732df19361472d14985b35cb..4cb30b6b457a3cfb533e6a82a0bdc72af83330fd 100644
--- a/chrome/browser/chromeos/login/keyboard_switch_menu.cc
+++ b/chrome/browser/chromeos/login/keyboard_switch_menu.cc
@@ -40,17 +40,20 @@ bool KeyboardSwitchMenu::ShouldSupportConfigUI() {
////////////////////////////////////////////////////////////////////////////////
// views::ViewMenuDelegate implementation.
void KeyboardSwitchMenu::RunMenu(views::View* source, const gfx::Point& pt) {
- PrepareForMenuOpen();
gfx::Point new_pt(pt);
views::MenuButton* button = static_cast<views::MenuButton*>(source);
- // Keyboard switch menu is aligned on left by default.
+ // Keyboard switch menu is aligned on left by default. MenuButton passes
+ // in pt the lower left corner for RTL and the lower right corner for
+ // non-RTL (with menu_offset applied).
int reverse_offset = button->width() + button->menu_offset().x() * 2;
if (base::i18n::IsRTL()) {
new_pt.set_x(pt.x() + reverse_offset);
} else {
new_pt.set_x(pt.x() - reverse_offset);
}
- input_method_menu().RunMenuAt(new_pt, views::Menu2::ALIGN_TOPLEFT);
+
+ set_menu_alignment(views::MenuItemView::TOPLEFT);
+ InputMethodMenu::RunMenu(source, new_pt);
}
string16 KeyboardSwitchMenu::GetCurrentKeyboardName() const {
« no previous file with comments | « no previous file | chrome/browser/chromeos/status/input_method_menu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698