Index: chrome/browser/chromeos/input_method/input_method_util.cc |
diff --git a/chrome/browser/chromeos/input_method/input_method_util.cc b/chrome/browser/chromeos/input_method/input_method_util.cc |
index 6946a8b59bd787791343836784b99b25b4ca2264..733798dee37e2356a8da44784929e787914f6735 100644 |
--- a/chrome/browser/chromeos/input_method/input_method_util.cc |
+++ b/chrome/browser/chromeos/input_method/input_method_util.cc |
@@ -614,25 +614,34 @@ std::string InputMethodUtil::GetLanguageDefaultInputMethodId( |
return std::string(); |
} |
-std::string InputMethodUtil::GetHardwareInputMethodId() const { |
- const std::string input_method_id = delegate_->GetHardwareKeyboardLayout(); |
+void InputMethodUtil::GetHardwareInputMethodIds( |
+ std::vector<std::string>* out) const { |
+ DCHECK(out); |
+ out->clear(); |
+ delegate_->GetHardwareKeyboardLayout(out); |
- if (input_method_id.empty()) { |
+ if (out->empty()) { |
// This is totally fine if it's empty. The hardware keyboard layout is |
// not stored if startup_manifest.json (OEM customization data) is not |
// present (ex. Cr48 doen't have that file). |
- return GetFallbackInputMethodDescriptor().id(); |
+ out->push_back(GetFallbackInputMethodDescriptor().id()); |
} |
- return input_method_id; |
} |
-std::string InputMethodUtil::GetHardwareLoginInputMethodId() const { |
- const std::string input_method_id = GetHardwareInputMethodId(); |
+void InputMethodUtil::GetHardwareLoginInputMethodId( |
+ std::vector<std::string>* out) const { |
- if (!IsLoginKeyboard(input_method_id)) |
- return GetFallbackInputMethodDescriptor().id(); |
+ std::vector<std::string> candidates; |
+ GetHardwareInputMethodIds(&candidates); |
+ out->clear(); |
+ |
+ for (size_t i = 0; i < candidates.size(); ++i) { |
+ if (IsLoginKeyboard(candidates[i])) |
+ out->push_back(candidates[i]); |
+ } |
- return input_method_id; |
+ if (out->empty()) |
+ out->push_back(GetFallbackInputMethodDescriptor().id()); |
} |
bool InputMethodUtil::IsLoginKeyboard(const std::string& input_method_id) |