Commit 43bbb131 authored by James Cook's avatar James Cook Committed by Commit Bot

SplitSettings: Update per-language context menu in browser settings

We decided to share a single language list between OS and browser, and
to show the list in both settings pages. For consistency between the
two UI surfaces, we're keeping the "Display Chrome OS in this language"
item in both places.

This CL eliminates pageVisibility.uiDisplayedInThisLanguage because it
would always be true.

Bug: 974424, 982299
Test: manual, menu item appears in browser settings after flag flip
Change-Id: Icc0bf8a344038bcc73059e74e5fdab9c88306cbc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1693388
Auto-Submit: James Cook <jamescook@chromium.org>
Reviewed-by: default avatarMichael Giuffrida <michaelpg@chromium.org>
Reviewed-by: default avatarMay Lippert <maybelle@chromium.org>
Commit-Queue: James Cook <jamescook@chromium.org>
Cr-Commit-Position: refs/heads/master@{#676177}
parent 724af495
......@@ -181,8 +181,7 @@
<div class="explain-selected"
hidden="[[!isProspectiveUILanguage_(
item.language.code,
languages.prospectiveUILanguage,
pageVisibility.uiDisplayedInThisLanguage)]]">
languages.prospectiveUILanguage)]]">
$i18n{isDisplayedInThisLanguage}
</div>
</div>
......
......@@ -221,17 +221,9 @@
</div>
<if expr="chromeos or is_win">
<div class="explain-selected"
<if expr="is_win">
hidden="[[!isProspectiveUILanguage_(
item.language.code,
languages.prospectiveUILanguage)]]">
</if>
<if expr="chromeos">
hidden="[[!shouldShowExplanation_(
item.language.code,
languages.prospectiveUILanguage,
pageVisibility.uiDisplayedInThisLanguage)]]">
</if>
$i18n{isDisplayedInThisLanguage}
</div>
</if> <!-- chromeos or is_win -->
......@@ -240,11 +232,7 @@
<template is="dom-if" if="[[isRestartRequired_(
item.language.code, languages.prospectiveUILanguage)]]"
restamp>
<cr-button id="restartButton"
<if expr="chromeos">
hidden="[[!pageVisibility.uiDisplayedInThisLanguage]]"
</if>
on-click="onRestartTap_">
<cr-button id="restartButton" on-click="onRestartTap_">
$i18n{restart}
</cr-button>
</template>
......@@ -421,9 +409,6 @@
class$="[[getMenuClass_(prefs.translate.enabled.value)]]">
<if expr="chromeos or is_win">
<cr-checkbox id="uiLanguageItem"
<if expr="chromeos">
hidden="[[!pageVisibility.uiDisplayedInThisLanguage]]"
</if>
class="dropdown-item"
checked="[[isProspectiveUILanguage_(
detailLanguage_.language.code,
......
......@@ -316,21 +316,6 @@ Polymer({
this.languageHelper.openInputMethodOptions(e.model.item.id);
},
// TODO(hsuregan): Remove when SplitSettings is complete.
/**
* Incorporates pageVisibility check along with isProspectiveUILanguage_().
* @param {string} languageCode The language code identifying a language.
* @param {string} prospectiveUILanguage The prospective UI language.
* @return {boolean} True if the given language matches the prospective UI
* pref (which may be different from the actual UI language).
* @private
*/
shouldShowExplanation_: function(languageCode, prospectiveUILanguage) {
return this.pageVisibility &&
this.pageVisibility.uiDisplayedInThisLanguage &&
this.isProspectiveUILanguage_(languageCode, prospectiveUILanguage);
},
/**
* @param {string} id The input method ID.
* @param {string} currentId The ID of the currently enabled input method.
......
......@@ -84,7 +84,6 @@ let ResetPageVisibility;
/**
* @typedef {{
* uiDisplayedInThisLanguage: boolean,
* manageInputMethods: boolean,
* inputMethodsList: boolean,
* }}
......@@ -152,7 +151,6 @@ cr.define('settings', function() {
extensions: false,
printing: true,
languages: {
uiDisplayedInThisLanguage: showOSSettings,
manageInputMethods: showOSSettings,
inputMethodsList: showOSSettings,
},
......@@ -203,7 +201,6 @@ cr.define('settings', function() {
extensions: true,
printing: true,
languages: {
uiDisplayedInThisLanguage: showOSSettings,
manageInputMethods: showOSSettings,
inputMethodsList: showOSSettings,
},
......
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