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

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: Fix error: declaration requires an exit-time destructor. 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..672ad034c637923b90caedb41094f5baa49f5001 100644
--- a/chrome/browser/ui/webui/chromeos/login/network_screen_handler.cc
+++ b/chrome/browser/ui/webui/chromeos/login/network_screen_handler.cc
@@ -36,6 +36,8 @@ const char kJsApiNetworkOnLanguageChanged[] = "networkOnLanguageChanged";
const char kJsApiNetworkOnInputMethodChanged[] = "networkOnInputMethodChanged";
const char kJsApiNetworkOnTimezoneChanged[] = "networkOnTimezoneChanged";
+const char kUSlayout[] = "xkb:us::eng";
+
} // namespace
namespace chromeos {
@@ -274,8 +276,13 @@ 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;
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 +292,17 @@ base::ListValue* NetworkScreenHandler::GetInputMethods() {
ime_id == current_input_method_id);
input_methods_list->Append(input_method);
}
+ // "xkb:us::eng" should always be in the list of available layouts.
+ 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