Commit 2a95c96b authored by Yuichiro Hanada's avatar Yuichiro Hanada Committed by Commit Bot

Consolidate login keyboard layouts information into input_methods.txt.

kLoginLayoutWhitelist has a list of xkb layout ids that are allowed to
be used on login screen.
However, the same information is already in
//chromeos/ime/input_methods.txt.
This CL removes the array and use the infomation in input_methods.txt
instead.

There is a slight diff between kLoginLayoutWhitelist and
input_methods.txt.
- 'fr' is only in kLoginLayoutWhitelist and xkb_manifest.json uses it.
  I updated xkb_manifest.json to use 'fr(oss)'.
- 'ro(std)' and 'ga' is specified as login layouts in input_methods.txt,
  but not in kLoginLayoutWhitelist. They are considered as login layout
  after this CL.

Bug: None
Change-Id: Ic88846555310e3c534e64dd195bd47aa80befa42
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1490986Reviewed-by: default avatarShu Chen <shuchen@chromium.org>
Commit-Queue: Yuichiro Hanada <yhanada@chromium.org>
Cr-Commit-Position: refs/heads/master@{#638483}
parent f50a50a7
...@@ -214,7 +214,7 @@ ...@@ -214,7 +214,7 @@
"fr-FR" "fr-FR"
], ],
"layouts": [ "layouts": [
"fr" "fr(oss)"
], ],
"input_view": "inputview.html?id=fr.compact.qwerty&language=fr&passwordLayout=fr.compact.qwerty&name=keyboard_french" "input_view": "inputview.html?id=fr.compact.qwerty&language=fr&passwordLayout=fr.compact.qwerty&name=keyboard_french"
}, },
......
...@@ -197,6 +197,7 @@ jumbo_component("ime") { ...@@ -197,6 +197,7 @@ jumbo_component("ime") {
if (is_chromeos) { if (is_chromeos) {
deps += [ deps += [
"//chromeos", "//chromeos",
"//chromeos/ime:gencode",
"//services/ws/public/cpp/input_devices", "//services/ws/public/cpp/input_devices",
"//ui/base/ime/chromeos/public/interfaces", "//ui/base/ime/chromeos/public/interfaces",
"//ui/chromeos/strings", "//ui/chromeos/strings",
......
...@@ -12,62 +12,13 @@ ...@@ -12,62 +12,13 @@
#include "base/stl_util.h" #include "base/stl_util.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "chromeos/constants/chromeos_switches.h" #include "chromeos/constants/chromeos_switches.h"
#include "chromeos/ime/input_methods.h"
#include "ui/base/ime/chromeos/extension_ime_util.h" #include "ui/base/ime/chromeos/extension_ime_util.h"
namespace chromeos { namespace chromeos {
namespace { namespace {
// The whitelist for enabling extension based xkb keyboards at login session.
const char* kLoginLayoutWhitelist[] = {
"be",
"br",
"ca",
"ca(eng)",
"ca(multix)",
"ch",
"ch(fr)",
"cz",
"cz(qwerty)",
"de",
"de(neo)",
"dk",
"ee",
"es",
"es(cat)",
"fi",
"fr",
"fr(bepo)",
"fr(oss)",
"gb(dvorak)",
"gb(extd)",
"hr",
"hu",
"ie",
"is",
"it",
"jp",
"latam",
"lt",
"lv(apostrophe)",
"mt",
"no",
"pl",
"pt",
"ro",
"se",
"si",
"tr",
"us",
"us(altgr-intl)",
"us(colemak)",
"us(dvorak)",
"us(dvp)",
"us(intl)",
"us(workman)",
"us(workman-intl)"
};
// Gets the input method category according to the given input method id. // Gets the input method category according to the given input method id.
// This is used for sorting a list of input methods. // This is used for sorting a list of input methods.
int GetInputMethodCategory(const std::string& id) { int GetInputMethodCategory(const std::string& id) {
...@@ -116,8 +67,9 @@ ComponentExtensionIMEManagerDelegate::~ComponentExtensionIMEManagerDelegate() { ...@@ -116,8 +67,9 @@ ComponentExtensionIMEManagerDelegate::~ComponentExtensionIMEManagerDelegate() {
} }
ComponentExtensionIMEManager::ComponentExtensionIMEManager() { ComponentExtensionIMEManager::ComponentExtensionIMEManager() {
for (size_t i = 0; i < base::size(kLoginLayoutWhitelist); ++i) { for (size_t i = 0; i < base::size(input_method::kInputMethods); ++i) {
login_layout_set_.insert(kLoginLayoutWhitelist[i]); if (input_method::kInputMethods[i].is_login_keyboard)
login_layout_set_.insert(input_method::kInputMethods[i].xkb_layout_id);
} }
} }
......
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