Commit 69471a5b authored by Bao-Duy Tran's avatar Bao-Duy Tran Committed by Chromium LUCI CQ

Remove all unused fields in all VK+IME extension manifests.

These are read from manifest.json but never used afterwards. They'd
better go away in the spirit of YAGNI "you aren't gonna need it".

There's no backward compat issues, even for 3P, because corresponding
configs are never used. Not to mention the "schema" of these manifests
has never been documented or specified formally anywhere. Existence of
bloated but unused specs hinders flexibility for future work.

Certain fields, such as "description", are almost always specified with
not-so-helpful config data like empty strings, simply because they are
unnecessarily compulsory.

Bug: 1134465
Change-Id: I7911c8967a7ee1ad0f6130b8f3cd99c765b0c2fc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2593792Reviewed-by: default avatarFinnur Thorarinsson <finnur@chromium.org>
Reviewed-by: default avatarDarren Shen <shend@chromium.org>
Reviewed-by: default avatarAlice Boxhall <aboxhall@chromium.org>
Reviewed-by: default avatarKeith Lee <keithlee@chromium.org>
Commit-Queue: Bao-Duy Tran <tranbaoduy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#838578}
parent 06535cb3
......@@ -19,8 +19,7 @@
"type": "ime",
"id": "braille",
"indicator": "\u2803\u2817\u2807", // Unicode of 'brl' in English (and many other) braille codes.
"language": ["None"],
"description": "Braille hardware keyboard"
"language": ["None"]
}
]
}
......@@ -17,7 +17,6 @@
"type": "ime",
"id": "zh-hant-t-i0-cangjie-1987",
"indicator": "\u5009",
"description": "Cangjie",
"language": [
"zh-TW",
"zh"
......
......@@ -24,7 +24,6 @@
"type": "ime",
"id": "hangul_2set",
"indicator": "\ud55c",
"description": "",
"language": "ko",
"layouts": [
"us"
......@@ -36,7 +35,6 @@
"type": "ime",
"id": "hangul_3set390",
"indicator": "\ud55c",
"description": "",
"language": "ko",
"layouts": [
"us"
......@@ -48,7 +46,6 @@
"type": "ime",
"id": "hangul_3setfinal",
"indicator": "\ud55c",
"description": "",
"language": "ko",
"layouts": [
"us"
......@@ -60,7 +57,6 @@
"type": "ime",
"id": "hangul_3setnoshift",
"indicator": "\ud55c",
"description": "",
"language": "ko",
"layouts": [
"us"
......@@ -72,7 +68,6 @@
"type": "ime",
"id": "hangul_romaja",
"indicator": "\ud55c",
"description": "",
"language": "ko",
"layouts": [
"us"
......@@ -84,7 +79,6 @@
"type": "ime",
"id": "hangul_ahnmatae",
"indicator": "\ud55c",
"description": "",
"language": "ko",
"layouts": [
"us"
......
......@@ -18,7 +18,6 @@
"name": "__MSG_keyboard_bengali_phonetic__",
"type": "ime",
"id": "vkd_bn_phone",
"description": "",
"language": "bn",
"layouts": [
"us"
......@@ -28,7 +27,6 @@
"name": "__MSG_keyboard_gujarati_phonetic__",
"type": "ime",
"id": "vkd_gu_phone",
"description": "",
"language": "gu",
"layouts": [
"us"
......@@ -38,7 +36,6 @@
"name": "__MSG_keyboard_devanagari_phonetic__",
"type": "ime",
"id": "vkd_deva_phone",
"description": "",
"language": [
"hi",
"mr"
......@@ -51,7 +48,6 @@
"name": "__MSG_keyboard_kannada_phonetic__",
"type": "ime",
"id": "vkd_kn_phone",
"description": "",
"language": "kn",
"layouts": [
"us"
......@@ -61,7 +57,6 @@
"name": "__MSG_keyboard_malayalam_phonetic__",
"type": "ime",
"id": "vkd_ml_phone",
"description": "",
"language": "ml",
"layouts": [
"us"
......@@ -71,7 +66,6 @@
"name": "__MSG_keyboard_tamil_inscript__",
"type": "ime",
"id": "vkd_ta_inscript",
"description": "",
"language": "ta",
"layouts": [
"us"
......@@ -81,7 +75,6 @@
"name": "__MSG_keyboard_tamil_phonetic__",
"type": "ime",
"id": "vkd_ta_phone",
"description": "",
"language": "ta",
"layouts": [
"us"
......@@ -91,7 +84,6 @@
"name": "__MSG_keyboard_tamil_tamil99__",
"type": "ime",
"id": "vkd_ta_tamil99",
"description": "",
"language": "ta",
"layouts": [
"us"
......@@ -101,7 +93,6 @@
"name": "__MSG_keyboard_tamil_typewriter__",
"type": "ime",
"id": "vkd_ta_typewriter",
"description": "",
"language": "ta",
"layouts": [
"us"
......@@ -111,7 +102,6 @@
"name": "__MSG_keyboard_tamil_itrans__",
"type": "ime",
"id": "vkd_ta_itrans",
"description": "",
"language": "ta",
"layouts": [
"us"
......@@ -121,7 +111,6 @@
"name": "__MSG_keyboard_telugu_phonetic__",
"type": "ime",
"id": "vkd_te_phone",
"description": "",
"language": "te",
"layouts": [
"us"
......@@ -131,7 +120,6 @@
"name": "__MSG_keyboard_ethiopic__",
"type": "ime",
"id": "vkd_ethi",
"description": "",
"language": "am",
"layouts": [
"us"
......@@ -141,7 +129,6 @@
"name": "__MSG_keyboard_thai_kedmanee__",
"type": "ime",
"id": "vkd_th",
"description": "",
"language": "th",
"layouts": [
"us"
......@@ -151,7 +138,6 @@
"name": "__MSG_keyboard_thai_pattachote__",
"type": "ime",
"id": "vkd_th_pattajoti",
"description": "",
"language": "th",
"layouts": [
"us"
......@@ -161,7 +147,6 @@
"name": "__MSG_keyboard_thai_tis__",
"type": "ime",
"id": "vkd_th_tis",
"description": "",
"language": "th",
"layouts": [
"us"
......@@ -171,7 +156,6 @@
"name": "__MSG_keyboard_persian__",
"type": "ime",
"id": "vkd_fa",
"description": "",
"language": "fa",
"layouts": [
"us"
......@@ -181,7 +165,6 @@
"name": "__MSG_keyboard_vietnamese_tcvn__",
"type": "ime",
"id": "vkd_vi_tcvn",
"description": "",
"language": "vi",
"layouts": [
"us"
......@@ -191,7 +174,6 @@
"name": "__MSG_keyboard_vietnamese_telex__",
"type": "ime",
"id": "vkd_vi_telex",
"description": "",
"language": "vi",
"layouts": [
"us"
......@@ -201,7 +183,6 @@
"name": "__MSG_keyboard_vietnamese_viqr__",
"type": "ime",
"id": "vkd_vi_viqr",
"description": "",
"language": "vi",
"layouts": [
"us"
......@@ -211,7 +192,6 @@
"name": "__MSG_keyboard_vietnamese_vni__",
"type": "ime",
"id": "vkd_vi_vni",
"description": "",
"language": "vi",
"layouts": [
"us"
......@@ -221,7 +201,6 @@
"name": "__MSG_keyboard_arabic__",
"type": "ime",
"id": "vkd_ar",
"description": "",
"language": "ar",
"layouts": [
"us"
......
......@@ -20,7 +20,6 @@
"type": "ime",
"id": "nacl_mozc_us",
"indicator": "\u3042",
"description": "Japanese input method.",
"language": "ja",
"layouts": [
"us"
......@@ -31,7 +30,6 @@
"type": "ime",
"id": "nacl_mozc_jp",
"indicator": "\u3042",
"description": "Japanese input method.",
"language": "ja",
"layouts": [
"jp"
......
......@@ -18,7 +18,6 @@
"type": "ime",
"id": "zh-t-i0-pinyin",
"indicator": "\u62fc",
"description": "Pinyin",
"language": [
"zh-CN",
"zh"
......
......@@ -18,7 +18,6 @@
"type": "ime",
"id": "zh-hant-t-i0-und",
"indicator": "\u6CE8",
"description": "Zhuyin",
"language": [
"zh-TW",
"zh"
......
......@@ -23,12 +23,7 @@ namespace extensions {
namespace keys = manifest_keys;
namespace errors = manifest_errors;
InputComponentInfo::InputComponentInfo()
: type(INPUT_COMPONENT_TYPE_NONE),
shortcut_alt(false),
shortcut_ctrl(false),
shortcut_shift(false) {
}
InputComponentInfo::InputComponentInfo() : type(INPUT_COMPONENT_TYPE_NONE) {}
InputComponentInfo::InputComponentInfo(const InputComponentInfo& other) =
default;
......@@ -65,15 +60,10 @@ bool InputComponentsHandler::Parse(Extension* extension,
std::string name_str;
InputComponentType type;
std::string id_str;
std::string description_str;
std::set<std::string> languages;
std::set<std::string> layouts;
std::string shortcut_keycode_str;
GURL input_view_url;
GURL options_page_url;
bool shortcut_alt = false;
bool shortcut_ctrl = false;
bool shortcut_shift = false;
if (!list_value->GetDictionary(i, &module_value)) {
*error = base::ASCIIToUTF16(errors::kInvalidInputComponents);
......@@ -108,13 +98,6 @@ bool InputComponentsHandler::Parse(Extension* extension,
id_str = "";
}
// Get input_components[i].description.
if (!module_value->GetString(keys::kDescription, &description_str)) {
*error = ErrorUtils::FormatErrorMessageUTF16(
errors::kInvalidInputComponentDescription, base::NumberToString(i));
return false;
}
// Get input_components[i].language.
// Both string and list of string are allowed to be compatibile with old
// input_ime manifest specification.
......@@ -150,39 +133,6 @@ bool InputComponentsHandler::Parse(Extension* extension,
}
}
if (module_value->HasKey(keys::kShortcutKey)) {
const base::DictionaryValue* shortcut_value = NULL;
if (!module_value->GetDictionary(keys::kShortcutKey,
&shortcut_value)) {
*error = ErrorUtils::FormatErrorMessageUTF16(
errors::kInvalidInputComponentShortcutKey, base::NumberToString(i));
return false;
}
// Get input_components[i].shortcut_keycode.
if (!shortcut_value->GetString(keys::kKeycode, &shortcut_keycode_str)) {
*error = ErrorUtils::FormatErrorMessageUTF16(
errors::kInvalidInputComponentShortcutKeycode,
base::NumberToString(i));
return false;
}
// Get input_components[i].shortcut_alt.
if (!shortcut_value->GetBoolean(keys::kAltKey, &shortcut_alt)) {
shortcut_alt = false;
}
// Get input_components[i].shortcut_ctrl.
if (!shortcut_value->GetBoolean(keys::kCtrlKey, &shortcut_ctrl)) {
shortcut_ctrl = false;
}
// Get input_components[i].shortcut_shift.
if (!shortcut_value->GetBoolean(keys::kShiftKey, &shortcut_shift)) {
shortcut_shift = false;
}
}
// Get input_components[i].input_view_url.
// Note: 'input_view' is optional in manifest.
std::string input_view_str;
......@@ -214,14 +164,9 @@ bool InputComponentsHandler::Parse(Extension* extension,
info->input_components.back().name = name_str;
info->input_components.back().type = type;
info->input_components.back().id = id_str;
info->input_components.back().description = description_str;
info->input_components.back().languages = languages;
info->input_components.back().layouts.insert(layouts.begin(),
layouts.end());
info->input_components.back().shortcut_keycode = shortcut_keycode_str;
info->input_components.back().shortcut_alt = shortcut_alt;
info->input_components.back().shortcut_ctrl = shortcut_ctrl;
info->input_components.back().shortcut_shift = shortcut_shift;
info->input_components.back().options_page_url = options_page_url;
info->input_components.back().input_view_url = input_view_url;
}
......
......@@ -33,13 +33,8 @@ struct InputComponentInfo {
std::string name;
InputComponentType type;
std::string id;
std::string description;
std::set<std::string> languages;
std::set<std::string> layouts;
std::string shortcut_keycode;
bool shortcut_alt;
bool shortcut_ctrl;
bool shortcut_shift;
GURL options_page_url;
GURL input_view_url;
};
......
......@@ -14,7 +14,6 @@
"name": "Test IME",
"type": "ime",
"id": "test",
"description": "Test IME", // A user visible description
"language": "en-US", // The primary language this IME is used for
"layouts": ["us::eng"] // The supported keyboard layouts for this IME
}
......
......@@ -12,9 +12,7 @@
"name": "Test IME",
"type": "ime",
"id": "test",
"description": "Test", // A user visible description
"language": "en", // The primary language this IME is used for
"layouts": ["us::eng"]
}]
}
......@@ -15,16 +15,13 @@
"name": "Test IME",
"type": "ime",
"id": "test",
"description": "Test",
"language": "en",
"layouts": ["us::eng"]
}, {
"name": "Test IME2",
"type": "ime",
"id": "test2",
"description": "Test",
"language": "en",
"layouts": ["us::eng"]
}]
}
......@@ -12,9 +12,7 @@
"name": "Test IME",
"type": "ime",
"id": "test",
"description": "Test",
"language": "en",
"layouts": ["us::eng"]
}]
}
......@@ -12,23 +12,19 @@
"name": "IdentityIME",
"type": "ime",
"id": "IdentityIME",
"description": "Works as IME but do nothing",
"language": "en",
"layouts": ["us::eng"]
},{
"name": "ToUpperIME",
"type": "ime",
"id": "ToUpperIME",
"description": "Convert given key character to upper case.",
"language": "en",
"layouts": ["us::eng"]
},{
"name": "APIArgumentIME",
"type": "ime",
"id": "APIArgumentIME",
"description": "Send back argument into Chrome.",
"language": "en",
"layouts": ["us::eng"]
}]
}
......@@ -17,7 +17,6 @@ const char kActionDefaultIcon[] = "default_icon";
const char kActionDefaultPopup[] = "default_popup";
const char kActionDefaultState[] = "default_state";
const char kActionDefaultTitle[] = "default_title";
const char kAltKey[] = "altKey";
const char kApp[] = "app";
const char kAppDisplayMode[] = "app.display_mode";
const char kAppIconColor[] = "app.icon_color";
......@@ -41,7 +40,6 @@ const char kContentSecurityPolicy_ExtensionPagesPath[] =
const char kContentSecurityPolicy_SandboxedPagesPath[] =
"content_security_policy.sandbox";
const char kConvertedFromUserScript[] = "converted_from_user_script";
const char kCtrlKey[] = "ctrlKey";
const char kCurrentLocale[] = "current_locale";
const char kDefaultLocale[] = "default_locale";
const char kDescription[] = "description";
......@@ -75,7 +73,6 @@ const char kInputComponents[] = "input_components";
const char kInputView[] = "input_view";
const char kIsolation[] = "app.isolation";
const char kKey[] = "key";
const char kKeycode[] = "keyCode";
const char kKiosk[] = "kiosk";
const char kKioskAlwaysUpdate[] = "kiosk.always_update";
const char kKioskEnabled[] = "kiosk_enabled";
......@@ -137,8 +134,6 @@ const char kSettingsOverrideAlternateUrls[] =
"chrome_settings_overrides.search_provider.alternate_urls";
const char kSharedModuleAllowlist[] = "allowlist";
const char kSharedModuleLegacyAllowlist[] = "whitelist";
const char kShiftKey[] = "shiftKey";
const char kShortcutKey[] = "shortcutKey";
const char kShortName[] = "short_name";
const char kSignature[] = "signature";
const char kSockets[] = "sockets";
......@@ -454,16 +449,10 @@ const char kInvalidImportVersion[] =
"Invalid value for 'import[*].minimum_version'.";
const char kInvalidInputComponents[] =
"Invalid value for 'input_components'";
const char kInvalidInputComponentDescription[] =
"Invalid value for 'input_components[*].description";
const char kInvalidInputComponentLayoutName[] =
"Invalid value for 'input_components[*].layouts[*]";
const char kInvalidInputComponentName[] =
"Invalid value for 'input_components[*].name";
const char kInvalidInputComponentShortcutKey[] =
"Invalid value for 'input_components[*].shortcutKey";
const char kInvalidInputComponentShortcutKeycode[] =
"Invalid value for 'input_components[*].shortcutKey.keyCode";
const char kInvalidInputComponentType[] =
"Invalid value for 'input_components[*].type";
const char kInvalidInputView[] =
......
......@@ -19,7 +19,6 @@ extern const char kActionDefaultIcon[];
extern const char kActionDefaultPopup[];
extern const char kActionDefaultState[];
extern const char kActionDefaultTitle[];
extern const char kAltKey[];
extern const char kApp[];
extern const char kAppDisplayMode[];
extern const char kAppIconColor[];
......@@ -43,7 +42,6 @@ extern const char kContentSecurityPolicy_ExtensionPagesPath[];
extern const char kContentSecurityPolicy_IsolatedWorldPath[];
extern const char kContentSecurityPolicy_SandboxedPagesPath[];
extern const char kConvertedFromUserScript[];
extern const char kCtrlKey[];
extern const char kCurrentLocale[];
extern const char kDefaultLocale[];
extern const char kDescription[];
......@@ -77,7 +75,6 @@ extern const char kInputComponents[];
extern const char kInputView[];
extern const char kIsolation[];
extern const char kKey[];
extern const char kKeycode[];
extern const char kKiosk[];
extern const char kKioskAlwaysUpdate[];
extern const char kKioskEnabled[];
......@@ -139,8 +136,6 @@ extern const char kSettingsOverride[];
extern const char kSettingsOverrideAlternateUrls[];
extern const char kSharedModuleAllowlist[];
extern const char kSharedModuleLegacyAllowlist[];
extern const char kShiftKey[];
extern const char kShortcutKey[];
extern const char kShortName[];
extern const char kSignature[];
extern const char kSockets[];
......@@ -356,11 +351,8 @@ extern const char kInvalidImportAndExport[];
extern const char kInvalidImportId[];
extern const char kInvalidImportVersion[];
extern const char kInvalidInputComponents[];
extern const char kInvalidInputComponentDescription[];
extern const char kInvalidInputComponentLayoutName[];
extern const char kInvalidInputComponentName[];
extern const char kInvalidInputComponentShortcutKey[];
extern const char kInvalidInputComponentShortcutKeycode[];
extern const char kInvalidInputComponentType[];
extern const char kInvalidInputView[];
extern const char kInvalidIsolation[];
......
......@@ -29,7 +29,6 @@ struct COMPONENT_EXPORT(UI_BASE_IME_CHROMEOS) ComponentExtensionEngine {
std::string display_name;
std::string indicator;
std::vector<std::string> language_codes; // e.g. "en".
std::string description;
std::string layout;
GURL options_page_url;
GURL input_view_url;
......
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