Chromium Code Reviews| 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..63ca3b986ef1ab75ce473e3f7fa4d89f4346a0f3 100644 |
| --- a/chrome/browser/chromeos/input_method/input_method_util.cc |
| +++ b/chrome/browser/chromeos/input_method/input_method_util.cc |
| @@ -18,6 +18,7 @@ |
| #include "chromeos/ime/component_extension_ime_manager.h" |
| #include "chromeos/ime/extension_ime_util.h" |
| #include "chromeos/ime/input_method_delegate.h" |
| +#include "chromeos/ime/input_method_manager.h" |
| // TODO(nona): move this header from this file. |
| #include "grit/generated_resources.h" |
| @@ -603,6 +604,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 +627,16 @@ std::string InputMethodUtil::GetHardwareInputMethodId() const { |
| return input_method_id; |
| } |
| +std::string InputMethodUtil::GetHardwareLoginInputMethodId() const { |
| + const std::string input_method_id = GetHardwareInputMethodId(); |
| + |
| + if (!InputMethodManager::Get()->IsLoginKeyboard(input_method_id)) { |
|
Hiro Komatsu
2014/01/21 05:46:01
Please check the actual implementation of IsLoging
Alexander Alekseev
2014/01/21 14:05:27
Done.
|
| + return GetFallbackInputMethodDescriptor().id(); |
| + } |
| + |
| + return input_method_id; |
| +} |
| + |
| void InputMethodUtil::SetComponentExtensions( |
| const InputMethodDescriptors& imes) { |
| component_extension_ime_id_to_descriptor_.clear(); |