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

Unified Diff: chrome/browser/chromeos/input_method/input_method_manager_impl.cc

Issue 133273032: Guest Mode: input method should default to the underlying latin keyboard layout. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Use EnableInputMethod instead of EnableInputMethods. Created 6 years, 11 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: chrome/browser/chromeos/input_method/input_method_manager_impl.cc
diff --git a/chrome/browser/chromeos/input_method/input_method_manager_impl.cc b/chrome/browser/chromeos/input_method/input_method_manager_impl.cc
index f779aeb9f2276e98bdf7cc0c5eaacea0fb663302..64a4322bd78b4027d6fbe47d3d69782c1073bdce 100644
--- a/chrome/browser/chromeos/input_method/input_method_manager_impl.cc
+++ b/chrome/browser/chromeos/input_method/input_method_manager_impl.cc
@@ -43,9 +43,7 @@ bool Contains(const std::vector<std::string>& container,
bool InputMethodManagerImpl::IsLoginKeyboard(
const std::string& layout) const {
- const InputMethodDescriptor* ime =
- util_.GetInputMethodDescriptorFromId(layout);
- return ime ? ime->is_login_keyboard() : false;
+ return util_.IsLoginKeyboard(layout);
}
InputMethodManagerImpl::InputMethodManagerImpl(
@@ -159,8 +157,9 @@ const InputMethodDescriptor* InputMethodManagerImpl::GetInputMethodFromId(
return ime;
}
-void InputMethodManagerImpl::EnableLayouts(const std::string& language_code,
- const std::string& initial_layout) {
+void InputMethodManagerImpl::EnableLoginLayouts(
+ const std::string& language_code,
+ const std::string& initial_layout) {
if (state_ == STATE_TERMINATING)
return;
@@ -171,17 +170,22 @@ void InputMethodManagerImpl::EnableLayouts(const std::string& language_code,
&candidates);
// Add the hardware keyboard as well. We should always add this so users
// can use the hardware keyboard on the login screen and the screen locker.
- candidates.push_back(util_.GetHardwareInputMethodId());
+ candidates.push_back(util_.GetHardwareLoginInputMethodId());
std::vector<std::string> layouts;
// First, add the initial input method ID, if it's requested, to
// layouts, so it appears first on the list of active input
// methods at the input language status menu.
- if (util_.IsValidInputMethodId(initial_layout) &&
- IsLoginKeyboard(initial_layout)) {
- layouts.push_back(initial_layout);
+ if (util_.IsValidInputMethodId(initial_layout)) {
+ if (!IsLoginKeyboard(initial_layout)) {
+ DVLOG(1)
+ << "EnableLoginLayouts: ignoring non-login initial keyboard layout:"
+ << initial_layout;
+ } else {
+ layouts.push_back(initial_layout);
+ }
} else if (!initial_layout.empty()) {
- DVLOG(1) << "EnableLayouts: ignoring non-keyboard or invalid ID: "
+ DVLOG(1) << "EnableLoginLayouts: ignoring non-keyboard or invalid ID: "
<< initial_layout;
}
@@ -550,7 +554,7 @@ void InputMethodManagerImpl::SetInputMethodDefault() {
initial_input_method_id =
GetInputMethodUtil()->GetHardwareInputMethodId();
}
- EnableLayouts(locale, initial_input_method_id);
+ EnableLoginLayouts(locale, initial_input_method_id);
}
}

Powered by Google App Engine
This is Rietveld 408576698