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

Unified Diff: chrome/browser/ui/webui/chromeos/login/network_screen_handler.cc

Issue 148093003: xkb:us::eng is now always in list of available input methods at OOBE. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698