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

Side by Side Diff: ui/views/controls/menu/menu_controller.cc

Issue 1177503003: Remove the 2-level input method system & InputMethodBridge. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits. Created 5 years, 5 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 unified diff | Download patch
« no previous file with comments | « ui/views/controls/combobox/combobox_unittest.cc ('k') | ui/views/controls/menu/submenu_view.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/views/controls/menu/menu_controller.h" 5 #include "ui/views/controls/menu/menu_controller.h"
6 6
7 #include "base/i18n/case_conversion.h" 7 #include "base/i18n/case_conversion.h"
8 #include "base/i18n/rtl.h" 8 #include "base/i18n/rtl.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 2060 matching lines...) Expand 10 before | Expand all | Expand 10 after
2071 if (item->GetSubmenu()->GetMenuItemCount() == 0) 2071 if (item->GetSubmenu()->GetMenuItemCount() == 0)
2072 return false; 2072 return false;
2073 2073
2074 // Look for matches based on mnemonic first. 2074 // Look for matches based on mnemonic first.
2075 SelectByCharDetails details = 2075 SelectByCharDetails details =
2076 FindChildForMnemonic(item, key, &MatchesMnemonic); 2076 FindChildForMnemonic(item, key, &MatchesMnemonic);
2077 if (details.first_match != -1) 2077 if (details.first_match != -1)
2078 return AcceptOrSelect(item, details); 2078 return AcceptOrSelect(item, details);
2079 2079
2080 if (is_combobox_) { 2080 if (is_combobox_) {
2081 item->GetSubmenu()->GetTextInputClient()->InsertChar(character, 0); 2081 item->GetSubmenu()->GetPrefixSelector()->InsertChar(character, 0);
2082 } else { 2082 } else {
2083 // If no mnemonics found, look at first character of titles. 2083 // If no mnemonics found, look at first character of titles.
2084 details = FindChildForMnemonic(item, key, &TitleMatchesMnemonic); 2084 details = FindChildForMnemonic(item, key, &TitleMatchesMnemonic);
2085 if (details.first_match != -1) 2085 if (details.first_match != -1)
2086 return AcceptOrSelect(item, details); 2086 return AcceptOrSelect(item, details);
2087 } 2087 }
2088 2088
2089 return false; 2089 return false;
2090 } 2090 }
2091 2091
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
2357 } 2357 }
2358 } 2358 }
2359 2359
2360 gfx::Screen* MenuController::GetScreen() { 2360 gfx::Screen* MenuController::GetScreen() {
2361 Widget* root = owner_ ? owner_->GetTopLevelWidget() : NULL; 2361 Widget* root = owner_ ? owner_->GetTopLevelWidget() : NULL;
2362 return root ? gfx::Screen::GetScreenFor(root->GetNativeView()) 2362 return root ? gfx::Screen::GetScreenFor(root->GetNativeView())
2363 : gfx::Screen::GetNativeScreen(); 2363 : gfx::Screen::GetNativeScreen();
2364 } 2364 }
2365 2365
2366 } // namespace views 2366 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/combobox/combobox_unittest.cc ('k') | ui/views/controls/menu/submenu_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698