Commit eebcc7e1 authored by My Nguyen's avatar My Nguyen Committed by Commit Bot

[OsSettingsLanguages] Remove 'Remove Input Method' dialog

Remove dialog based on UX review feedback
(see question 4 in http://go/cros-lang-settings-ui-review-reply)
Current view: http://screen/BV97nrhiu94mME6

Bug: 1113439
Change-Id: I0865a9d6385661e99c1d560db446904b47c9d31c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2423824Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Reviewed-by: default avatarRegan Hsu <hsuregan@chromium.org>
Commit-Queue: My Nguyen <myy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#809569}
parent f6a44d38
......@@ -298,8 +298,8 @@
<message name="IDS_OS_SETTINGS_LANGUAGES_ADD_INPUT_METHOD_LABEL" translateable="false" desc="Button under the list of input methods which opens a dialog that lets the user add keyboard layouts and input method editors.">
Add input methods
</message>
<message name="IDS_OS_SETTINGS_LANGUAGES_REMOVE_INPUT_METHOD_LABEL" translateable="false" desc="Title of the dialog that lets the user remove a given keyboard layout or input method editor.">
Remove <ph name="INPUT_METHOD_NAME">$1<ex>US keyboard</ex></ph>?
<message name="IDS_OS_SETTINGS_LANGUAGES_REMOVE_INPUT_METHOD_TOOLTIP" desc="Tooltip of the button that lets the user remove a given keyboard layout or input method editor.">
Remove <ph name="INPUT_METHOD_NAME">$1<ex>US keyboard</ex></ph>
</message>
<message name="IDS_OS_SETTINGS_LANGUAGES_SUGGESTED_INPUT_METHODS_LABEL" desc="Title of the list of keyboard layouts or input method editors suggested to users.">
Suggested
......
9d66237b843f52b2ae513fbc0476c0e493775777
\ No newline at end of file
......@@ -20,7 +20,6 @@ js_type_check("closure_compile") {
":os_languages_page",
":os_languages_page_v2",
":os_languages_section",
":remove_input_method_dialog",
":smart_inputs_page",
"../../languages_page:languages",
"../../languages_page:languages_browser_proxy",
......@@ -160,9 +159,6 @@ js_library("os_add_languages_dialog") {
]
}
js_library("remove_input_method_dialog") {
}
js_library("smart_inputs_page") {
deps = [
"..:deep_linking_behavior",
......@@ -188,7 +184,6 @@ js_type_check("closure_compile_module") {
":os_languages_page.m",
":os_languages_page_v2.m",
":os_languages_section.m",
":remove_input_method_dialog.m",
":smart_inputs_page.m",
]
}
......@@ -349,11 +344,6 @@ js_library("os_languages_section.m") {
extra_deps = [ ":os_languages_section_module" ]
}
js_library("remove_input_method_dialog.m") {
sources = [ "$root_gen_dir/chrome/browser/resources/settings/chromeos/os_languages_page/remove_input_method_dialog.m.js" ]
extra_deps = [ ":remove_input_method_dialog_module" ]
}
js_library("smart_inputs_page.m") {
sources = [ "$root_gen_dir/chrome/browser/resources/settings/chromeos/os_languages_page/smart_inputs_page.m.js" ]
deps = [
......@@ -381,7 +371,6 @@ group("polymer3_elements") {
":os_languages_page_module",
":os_languages_page_v2_module",
":os_languages_section_module",
":remove_input_method_dialog_module",
":smart_inputs_page_module",
"../../languages_page:languages_module",
"../../languages_page:modulize",
......@@ -478,15 +467,6 @@ polymer_modulizer("input_page") {
auto_imports = os_settings_auto_imports
}
polymer_modulizer("remove_input_method_dialog") {
js_file = "remove_input_method_dialog.js"
html_file = "remove_input_method_dialog.html"
html_type = "dom-module"
migrated_imports = settings_migrated_imports
namespace_rewrites = os_settings_namespace_rewrites
auto_imports = os_settings_auto_imports
}
polymer_modulizer("smart_inputs_page") {
js_file = "smart_inputs_page.js"
html_file = "smart_inputs_page.html"
......
......@@ -11,8 +11,8 @@
<link rel="import" href="input_method_util.html">
<link rel="import" href="languages_metrics_proxy.html">
<link rel="import" href="os_edit_dictionary_page.html">
<link rel="import" href="remove_input_method_dialog.html">
<link rel="import" href="../deep_linking_behavior.html">
<link rel="import" href="../metrics_recorder.html">
<link rel="import" href="../os_route.html">
<link rel="import" href="../../controls/settings_toggle_button.html">
<link rel="import" href="../../prefs/prefs_behavior.html">
......@@ -263,13 +263,6 @@
on-close="onAddInputMethodsDialogClose_">
</os-settings-add-input-methods-dialog>
</template>
<template is="dom-if" if="[[showRemoveInputMethodDialog_]]" restamp>
<os-settings-remove-input-method-dialog
input-method="[[inputMethodToRemove_]]"
language-helper="[[languageHelper]]"
on-close="onRemoveInputMethodDialogClose_">
</os-settings-remove-input-method-dialog>
</template>
</template>
<script src="input_page.js"></script>
</dom-module>
......@@ -54,15 +54,6 @@ Polymer({
value: false,
},
/** @private {!chrome.languageSettingsPrivate.InputMethod} */
inputMethodToRemove_: Object,
/** @private */
showRemoveInputMethodDialog_: {
type: Boolean,
value: false,
},
/**
* Used by DeepLinkingBehavior to focus this page's deep links.
* @type {!Set<!chromeos.settings.mojom.Setting>}
......@@ -276,7 +267,7 @@ Polymer({
* @private
*/
getRemoveInputMethodTooltip_(inputMethod) {
return this.i18n('removeInputMethodLabel', inputMethod.displayName);
return this.i18n('removeInputMethodTooltip', inputMethod.displayName);
},
/**
......@@ -284,13 +275,8 @@ Polymer({
* @private
*/
onRemoveInputMethodClick_(e) {
this.inputMethodToRemove_ = e.model.item;
this.showRemoveInputMethodDialog_ = true;
},
/** @private */
onRemoveInputMethodDialogClose_() {
this.showRemoveInputMethodDialog_ = false;
this.languageHelper.removeInputMethod(e.model.item.id);
settings.recordSettingChange();
},
/**
......
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/cr_elements/cr_button/cr_button.html">
<link rel="import" href="chrome://resources/cr_elements/cr_dialog/cr_dialog.html">
<link rel="import" href="chrome://resources/html/i18n_behavior.html">
<dom-module id="os-settings-remove-input-method-dialog">
<template>
<cr-dialog id="dialog" close-text="$i18n{close}" show-on-attach>
<div slot="title">[[getTitle_(inputMethod)]]</div>
<div slot="button-container">
<cr-button class="cancel-button" on-click="onCancelButtonTap_">
$i18n{cancel}
</cr-button>
<cr-button class="action-button" on-click="onActionButtonTap_">
$i18n{remove}
</cr-button>
</div>
</cr-dialog>
</template>
<script src="remove_input_method_dialog.js"></script>
</dom-module>
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/**
* @fileoverview 'os-settings-remove-input-method-dialog' is a dialog for
* removing an input method.
*/
Polymer({
is: 'os-settings-remove-input-method-dialog',
behaviors: [
I18nBehavior,
],
properties: {
/** @type {!chrome.languageSettingsPrivate.InputMethod} */
inputMethod: Object,
/** @type {!LanguageHelper} */
languageHelper: Object,
},
/** @private */
getTitle_() {
return this.i18n('removeInputMethodLabel', this.inputMethod.displayName);
},
/** @private */
onCancelButtonTap_() {
this.$.dialog.close();
},
/** @private */
onActionButtonTap_() {
this.languageHelper.removeInputMethod(this.inputMethod.id);
this.$.dialog.close();
},
});
......@@ -159,11 +159,6 @@
use_base_dir="false"
compress="false"
type="BINDATA" />
<include name="IDR_OS_SETTINGS_LANGUAGES_PAGE_REMOVE_INPUT_METHOD_DIALOG_M_JS"
file="${root_gen_dir}/chrome/browser/resources/settings/chromeos/os_languages_page/remove_input_method_dialog.m.js"
use_base_dir="false"
compress="false"
type="BINDATA" />
<include name="IDR_OS_SETTINGS_LANGUAGES_PAGE_SMART_INPUTS_PAGE_M_JS"
file="${root_gen_dir}/chrome/browser/resources/settings/chromeos/os_languages_page/smart_inputs_page.m.js"
use_base_dir="false"
......
......@@ -779,12 +779,6 @@
<structure name="IDR_OS_SETTINGS_LANGUAGES_INPUT_METHOD_UTIL_JS"
file="chromeos/os_languages_page/input_method_util.js"
compress="false" type="chrome_html" />
<structure name="IDR_OS_SETTINGS_LANGUAGES_REMOVE_INPUT_METHOD_DIALOG_HTML"
file="chromeos/os_languages_page/remove_input_method_dialog.html"
compress="false" type="chrome_html" />
<structure name="IDR_OS_SETTINGS_LANGUAGES_REMOVE_INPUT_METHOD_DIALOG_JS"
file="chromeos/os_languages_page/remove_input_method_dialog.js"
compress="false" type="chrome_html" />
<structure name="IDR_OS_SETTINGS_LANGUAGES_SMART_INPUTS_PAGE_HTML"
file="chromeos/os_languages_page/smart_inputs_page.html"
compress="false" type="chrome_html" />
......
......@@ -303,8 +303,8 @@ void AddInputPageStringsV2(content::WebUIDataSource* html_source) {
IDS_OS_SETTINGS_LANGUAGES_INPUT_METHOD_LIST_TITLE},
{"openOptionsPage", IDS_OS_SETTINGS_LANGUAGES_OPEN_OPTIONS_PAGE_LABEL},
{"addInputMethodLabel", IDS_OS_SETTINGS_LANGUAGES_ADD_INPUT_METHOD_LABEL},
{"removeInputMethodLabel",
IDS_OS_SETTINGS_LANGUAGES_REMOVE_INPUT_METHOD_LABEL},
{"removeInputMethodTooltip",
IDS_OS_SETTINGS_LANGUAGES_REMOVE_INPUT_METHOD_TOOLTIP},
{"suggestedInputMethodsLabel",
IDS_OS_SETTINGS_LANGUAGES_SUGGESTED_INPUT_METHODS_LABEL},
{"allInputMethodsLabel",
......
......@@ -121,23 +121,11 @@ suite('input page', () => {
assertEquals(
inputMethodName,
items[0].querySelector('.display-name').textContent.trim());
assertFalse(!!inputPage.$$('os-settings-remove-input-method-dialog'));
// opens the remove input method dialog.
// clicks remove input method button.
items[0].querySelector('.icon-clear').click();
Polymer.dom.flush();
const dialog = inputPage.$$('os-settings-remove-input-method-dialog');
assertTrue(!!dialog);
assertTrue(
dialog.$$('[slot=title]').textContent.includes(inputMethodName));
// removes the input method.
const actionButton = dialog.$$('.action-button');
assertTrue(!!actionButton);
actionButton.click();
Polymer.dom.flush();
inputMethodsList = inputPage.$.inputMethodsList;
items = inputMethodsList.querySelectorAll('.list-item');
assertEquals(2, items.length);
......
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