| 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 2e62d5dd80d37ad34b6d31b79f3e53cc41251f6d..6946a8b59bd787791343836784b99b25b4ca2264 100644
|
| --- a/chrome/browser/chromeos/input_method/input_method_util.cc
|
| +++ b/chrome/browser/chromeos/input_method/input_method_util.cc
|
| @@ -603,6 +603,17 @@ void InputMethodUtil::GetLanguageCodesFromInputMethodIds(
|
| }
|
| }
|
|
|
| +std::string InputMethodUtil::GetLanguageDefaultInputMethodId(
|
| + const std::string& language_code) {
|
| + std::vector<std::string> candidates;
|
| + GetInputMethodIdsFromLanguageCode(
|
| + language_code, input_method::kKeyboardLayoutsOnly, &candidates);
|
| + if (candidates.size())
|
| + return candidates.front();
|
| +
|
| + return std::string();
|
| +}
|
| +
|
| std::string InputMethodUtil::GetHardwareInputMethodId() const {
|
| const std::string input_method_id = delegate_->GetHardwareKeyboardLayout();
|
|
|
| @@ -615,6 +626,22 @@ std::string InputMethodUtil::GetHardwareInputMethodId() const {
|
| return input_method_id;
|
| }
|
|
|
| +std::string InputMethodUtil::GetHardwareLoginInputMethodId() const {
|
| + const std::string input_method_id = GetHardwareInputMethodId();
|
| +
|
| + if (!IsLoginKeyboard(input_method_id))
|
| + return GetFallbackInputMethodDescriptor().id();
|
| +
|
| + return input_method_id;
|
| +}
|
| +
|
| +bool InputMethodUtil::IsLoginKeyboard(const std::string& input_method_id)
|
| + const {
|
| + const InputMethodDescriptor* ime =
|
| + GetInputMethodDescriptorFromId(input_method_id);
|
| + return ime ? ime->is_login_keyboard() : false;
|
| +}
|
| +
|
| void InputMethodUtil::SetComponentExtensions(
|
| const InputMethodDescriptors& imes) {
|
| component_extension_ime_id_to_descriptor_.clear();
|
|
|