Commit eb9114cd authored by alemate@chromium.org's avatar alemate@chromium.org

xkb:us::eng is now always in list of available input methods at OOBE.

It seems reasonable to have US qwerty as a last resort option for the keyboard
selection at OOBE.

So, basically add US qwerty as the last item of the keyboard selection drop
down if it's not already surfaced through other means (e.g. VPD or preferred
list based on the currently selected locale).

Note: to test this modification, you need hardware layout set to
non "xkb:us::eng", but to some other latin layout. Because hardware
latin layout is always first in the list of available layouts at OOBE.

BUG=327195
TEST=manual

Review URL: https://codereview.chromium.org/148093003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@247991 0039d316-1c4b-4281-b951-d872f2087c98
parent c74f12cc
...@@ -36,6 +36,8 @@ const char kJsApiNetworkOnLanguageChanged[] = "networkOnLanguageChanged"; ...@@ -36,6 +36,8 @@ const char kJsApiNetworkOnLanguageChanged[] = "networkOnLanguageChanged";
const char kJsApiNetworkOnInputMethodChanged[] = "networkOnInputMethodChanged"; const char kJsApiNetworkOnInputMethodChanged[] = "networkOnInputMethodChanged";
const char kJsApiNetworkOnTimezoneChanged[] = "networkOnTimezoneChanged"; const char kJsApiNetworkOnTimezoneChanged[] = "networkOnTimezoneChanged";
const char kUSlayout[] = "xkb:us::eng";
} // namespace } // namespace
namespace chromeos { namespace chromeos {
...@@ -277,8 +279,13 @@ base::ListValue* NetworkScreenHandler::GetInputMethods() { ...@@ -277,8 +279,13 @@ base::ListValue* NetworkScreenHandler::GetInputMethods() {
scoped_ptr<input_method::InputMethodDescriptors> input_methods( scoped_ptr<input_method::InputMethodDescriptors> input_methods(
manager->GetActiveInputMethods()); manager->GetActiveInputMethods());
std::string current_input_method_id = manager->GetCurrentInputMethod().id(); 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) { for (size_t i = 0; i < input_methods->size(); ++i) {
const std::string ime_id = input_methods->at(i).id(); 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; base::DictionaryValue* input_method = new base::DictionaryValue;
input_method->SetString("value", ime_id); input_method->SetString("value", ime_id);
input_method->SetString( input_method->SetString(
...@@ -288,6 +295,17 @@ base::ListValue* NetworkScreenHandler::GetInputMethods() { ...@@ -288,6 +295,17 @@ base::ListValue* NetworkScreenHandler::GetInputMethods() {
ime_id == current_input_method_id); ime_id == current_input_method_id);
input_methods_list->Append(input_method); 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; return input_methods_list;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment