Chromium Code Reviews| Index: chrome/browser/ui/webui/chromeos/login/network_screen_handler.cc |
| diff --git a/chrome/browser/ui/webui/chromeos/login/network_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/network_screen_handler.cc |
| index e568e45f267f33e66ae4f6cd6b4c56bf80d6adf8..df5e56fc576bf9a8a95814fa8e9b7f0e12d15fcc 100644 |
| --- a/chrome/browser/ui/webui/chromeos/login/network_screen_handler.cc |
| +++ b/chrome/browser/ui/webui/chromeos/login/network_screen_handler.cc |
| @@ -274,8 +274,14 @@ base::ListValue* NetworkScreenHandler::GetInputMethods() { |
| scoped_ptr<input_method::InputMethodDescriptors> input_methods( |
| manager->GetActiveInputMethods()); |
| std::string current_input_method_id = manager->GetCurrentInputMethod().id(); |
| + bool default_us_layout_added = false; |
| + static const std::string kUSlayout("xkb:us::eng"); // Global default |
|
Nikita (slow)
2014/01/27 15:22:10
nit: Please extract constant.
|
| for (size_t i = 0; i < input_methods->size(); ++i) { |
| const std::string ime_id = input_methods->at(i).id(); |
| + |
| + if (ime_id == kUSlayout) |
| + default_us_layout_added = true; |
| + |
| base::DictionaryValue* input_method = new base::DictionaryValue; |
| input_method->SetString("value", ime_id); |
| input_method->SetString( |
| @@ -285,6 +291,16 @@ base::ListValue* NetworkScreenHandler::GetInputMethods() { |
| ime_id == current_input_method_id); |
| input_methods_list->Append(input_method); |
| } |
| + if (!default_us_layout_added) { |
| + const input_method::InputMethodDescriptor* us_eng_descriptor = |
| + util->GetInputMethodDescriptorFromId(kUSlayout); |
| + DCHECK(us_eng_descriptor != NULL); |
| + base::DictionaryValue* input_method = new base::DictionaryValue; |
| + input_method->SetString("value", kUSlayout); |
| + input_method->SetString("title", |
| + util->GetInputMethodLongName(*us_eng_descriptor)); |
| + input_methods_list->Append(input_method); |
| + } |
| return input_methods_list; |
| } |