Commit 376b2999 authored by My Nguyen's avatar My Nguyen Committed by Commit Bot

[OsSettingsLanguages] Update Keyboard section link to input

View when flag is on: http://screen/4hzTLaxE66FMnce
Normally, this would link to the full Languages and Inputs page.
But with Languages and Inputs being in separate page, UX thinks
linking to Inputs directly is more suitable as users are in Keyboard
section.

Bug: 1113439
Test: Manual test
Change-Id: I6087e7ff4d974daf6648b2bc45638e5f27805815
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2437717Reviewed-by: default avatarRegan Hsu <hsuregan@chromium.org>
Commit-Queue: My Nguyen <myy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#812061}
parent 632104a8
...@@ -3021,6 +3021,9 @@ ...@@ -3021,6 +3021,9 @@
<message name="IDS_SETTINGS_KEYBOARD_SHOW_LANGUAGE_AND_INPUT" desc="The link to navigate to the language and input method settings."> <message name="IDS_SETTINGS_KEYBOARD_SHOW_LANGUAGE_AND_INPUT" desc="The link to navigate to the language and input method settings.">
Change language and input settings Change language and input settings
</message> </message>
<message name="IDS_SETTINGS_KEYBOARD_SHOW_INPUT_SETTINGS" desc="The link to navigate to input method settings.">
Change input settings
</message>
<message name="IDS_SETTINGS_KEYBOARD_KEY_LAUNCHER" desc="In Device Settings, the label and dropdown list item for the Search key on keyboard layouts of newer Chromebooks."> <message name="IDS_SETTINGS_KEYBOARD_KEY_LAUNCHER" desc="In Device Settings, the label and dropdown list item for the Search key on keyboard layouts of newer Chromebooks.">
Launcher Launcher
</message> </message>
......
c8ce809043d039ed17430698fbbf5bdd8d3adbde
\ No newline at end of file
...@@ -141,9 +141,18 @@ ...@@ -141,9 +141,18 @@
on-click="onShowKeyboardShortcutViewerTap_" on-click="onShowKeyboardShortcutViewerTap_"
label="$i18n{showKeyboardShortcutViewer}" external label="$i18n{showKeyboardShortcutViewer}" external
deep-link-focus-id$="[[Setting.kKeyboardShortcuts]]"></cr-link-row> deep-link-focus-id$="[[Setting.kKeyboardShortcuts]]"></cr-link-row>
<cr-link-row class="hr" on-click="onShowLanguageInputTap_" <template is="dom-if" if="[[!languageSettingsV2Enabled_]]">
label="$i18n{keyboardShowLanguageAndInput}" <cr-link-row class="hr" on-click="onShowLanguageInputTap_"
role-description="$i18n{subpageArrowRoleDescription}"></cr-link-row> label="$i18n{keyboardShowLanguageAndInput}"
role-description="$i18n{subpageArrowRoleDescription}">
</cr-link-row>
</template>
<template is="dom-if" if="[[languageSettingsV2Enabled_]]">
<cr-link-row class="hr" on-click="onShowInputSettingsTap_"
label="$i18n{keyboardShowInputSettings}"
role-description="$i18n{subpageArrowRoleDescription}">
</cr-link-row>
</template>
</template> </template>
<script src="keyboard.js"></script> <script src="keyboard.js"></script>
</dom-module> </dom-module>
...@@ -98,6 +98,17 @@ cr.define('settings', function() { ...@@ -98,6 +98,17 @@ cr.define('settings', function() {
chromeos.settings.mojom.Setting.kKeyboardShortcuts, chromeos.settings.mojom.Setting.kKeyboardShortcuts,
]), ]),
}, },
/**
* This is enabled when language settings update feature flag is enabled.
* @private
*/
languageSettingsV2Enabled_: {
type: Boolean,
value() {
return loadTimeData.getBoolean('enableLanguageSettingsV2');
},
},
}, },
/** @override */ /** @override */
...@@ -176,22 +187,33 @@ cr.define('settings', function() { ...@@ -176,22 +187,33 @@ cr.define('settings', function() {
this.showAppleCommandKey_ = keyboardParams['showAppleCommandKey']; this.showAppleCommandKey_ = keyboardParams['showAppleCommandKey'];
}, },
/** @private */
onShowKeyboardShortcutViewerTap_() { onShowKeyboardShortcutViewerTap_() {
settings.DevicePageBrowserProxyImpl.getInstance() settings.DevicePageBrowserProxyImpl.getInstance()
.showKeyboardShortcutViewer(); .showKeyboardShortcutViewer();
}, },
/** @private */
onShowLanguageInputTap_() { onShowLanguageInputTap_() {
settings.Router.getInstance().navigateTo( settings.Router.getInstance().navigateTo(
settings.routes.OS_LANGUAGES_DETAILS, settings.routes.OS_LANGUAGES_DETAILS,
/* dynamicParams */ null, /* removeSearch */ true); /*dynamicParams=*/ null, /*removeSearch=*/ true);
},
/** @private */
onShowInputSettingsTap_() {
settings.Router.getInstance().navigateTo(
settings.routes.OS_LANGUAGES_INPUT,
/*dynamicParams=*/ null, /*removeSearch=*/ true);
}, },
/** @private */
getExternalMetaKeyLabel_(hasInternalKeyboard) { getExternalMetaKeyLabel_(hasInternalKeyboard) {
return loadTimeData.getString( return loadTimeData.getString(
hasInternalKeyboard ? 'keyboardKeyExternalMeta' : 'keyboardKeyMeta'); hasInternalKeyboard ? 'keyboardKeyExternalMeta' : 'keyboardKeyMeta');
}, },
/** @private */
getExternalCommandKeyLabel_(hasInternalKeyboard) { getExternalCommandKeyLabel_(hasInternalKeyboard) {
return loadTimeData.getString( return loadTimeData.getString(
hasInternalKeyboard ? 'keyboardKeyExternalCommand' : hasInternalKeyboard ? 'keyboardKeyExternalCommand' :
......
...@@ -493,6 +493,7 @@ void AddDeviceKeyboardStrings(content::WebUIDataSource* html_source) { ...@@ -493,6 +493,7 @@ void AddDeviceKeyboardStrings(content::WebUIDataSource* html_source) {
IDS_SETTINGS_KEYBOARD_SHOW_SHORTCUT_VIEWER}, IDS_SETTINGS_KEYBOARD_SHOW_SHORTCUT_VIEWER},
{"keyboardShowLanguageAndInput", {"keyboardShowLanguageAndInput",
IDS_SETTINGS_KEYBOARD_SHOW_LANGUAGE_AND_INPUT}, IDS_SETTINGS_KEYBOARD_SHOW_LANGUAGE_AND_INPUT},
{"keyboardShowInputSettings", IDS_SETTINGS_KEYBOARD_SHOW_INPUT_SETTINGS},
}; };
AddLocalizedStringsBulk(html_source, keyboard_strings); AddLocalizedStringsBulk(html_source, keyboard_strings);
...@@ -793,6 +794,9 @@ void DeviceSection::AddLoadTimeData(content::WebUIDataSource* html_source) { ...@@ -793,6 +794,9 @@ void DeviceSection::AddLoadTimeData(content::WebUIDataSource* html_source) {
html_source->AddBoolean("isDemoSession", html_source->AddBoolean("isDemoSession",
chromeos::DemoSession::IsDeviceInDemoMode()); chromeos::DemoSession::IsDeviceInDemoMode());
html_source->AddBoolean("enableLanguageSettingsV2",
base::FeatureList::IsEnabled(
::chromeos::features::kLanguageSettingsUpdate));
AddDevicePointersStrings(html_source); AddDevicePointersStrings(html_source);
AddDeviceKeyboardStrings(html_source); AddDeviceKeyboardStrings(html_source);
......
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