Commit 2db19dca authored by Anastasiia N's avatar Anastasiia N Committed by Chromium LUCI CQ

Move 'Privacy and security' to the 'Basic' section

Note: we don't move privacy page from the lazy bundle to the main bundle
because it was already a part of the main bundle erroneously,
see https://crbug.com/1157207.

Bug: 1148246
Change-Id: Ic2cadf3c129e3f2fb99499aefd35f1c45cde967f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2563460
Commit-Queue: Anastasiia N <anastasiian@chromium.org>
Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#837011}
parent 1cba2f3d
...@@ -11,15 +11,19 @@ export function ensureLazyLoaded() { ...@@ -11,15 +11,19 @@ export function ensureLazyLoaded() {
script.type = 'module'; script.type = 'module';
script.src = './lazy_load.js'; script.src = './lazy_load.js';
document.body.appendChild(script); document.body.appendChild(script);
const lazyLoadPages = [
lazyLoadPromise = Promise.all([
'os-settings-powerwash-dialog', 'os-settings-powerwash-dialog',
'os-settings-privacy-page',
'os-settings-reset-page', 'os-settings-reset-page',
'os-settings-files-page', 'os-settings-files-page',
'settings-smb-shares-page', 'settings-smb-shares-page',
'os-printing-page', 'os-printing-page',
].map(name => customElements.whenDefined(name))); ];
if (!loadTimeData.getBoolean('isAccountManagementFlowsV2Enabled')) {
lazyLoadPages.push('os-settings-privacy-page');
}
lazyLoadPromise = Promise.all(
lazyLoadPages.map(name => customElements.whenDefined(name)));
} }
return lazyLoadPromise; return lazyLoadPromise;
} }
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
<link rel="import" href="os_files_page/os_files_page.html"> <link rel="import" href="os_files_page/os_files_page.html">
<link rel="import" href="os_languages_page/os_languages_section.html"> <link rel="import" href="os_languages_page/os_languages_section.html">
<link rel="import" href="os_printing_page/os_printing_page.html"> <link rel="import" href="os_printing_page/os_printing_page.html">
<link rel="import" href="os_privacy_page/os_privacy_page.html">
<link rel="import" href="os_reset_page/os_reset_page.html"> <link rel="import" href="os_reset_page/os_reset_page.html">
</body> </body>
</html> </html>
...@@ -242,10 +242,11 @@ cr.define('settings', function() { ...@@ -242,10 +242,11 @@ cr.define('settings', function() {
r.DATETIME, mojom.TIME_ZONE_SUBPAGE_PATH, Subpage.kTimeZone); r.DATETIME, mojom.TIME_ZONE_SUBPAGE_PATH, Subpage.kTimeZone);
// Privacy and Security section. // Privacy and Security section.
r.OS_PRIVACY = createSection(
r.ADVANCED, mojom.PRIVACY_AND_SECURITY_SECTION_PATH,
Section.kPrivacyAndSecurity);
if (loadTimeData.getBoolean('isAccountManagementFlowsV2Enabled')) { if (loadTimeData.getBoolean('isAccountManagementFlowsV2Enabled')) {
r.OS_PRIVACY = createSection(
r.BASIC, mojom.PRIVACY_AND_SECURITY_SECTION_PATH,
Section.kPrivacyAndSecurity);
r.LOCK_SCREEN = createSubpage( r.LOCK_SCREEN = createSubpage(
r.OS_PRIVACY, mojom.SECURITY_AND_SIGN_IN_SUBPAGE_PATH_V2, r.OS_PRIVACY, mojom.SECURITY_AND_SIGN_IN_SUBPAGE_PATH_V2,
Subpage.kSecurityAndSignInV2); Subpage.kSecurityAndSignInV2);
...@@ -255,6 +256,10 @@ cr.define('settings', function() { ...@@ -255,6 +256,10 @@ cr.define('settings', function() {
r.ACCOUNTS = createSubpage( r.ACCOUNTS = createSubpage(
r.OS_PRIVACY, mojom.MANAGE_OTHER_PEOPLE_SUBPAGE_PATH_V2, r.OS_PRIVACY, mojom.MANAGE_OTHER_PEOPLE_SUBPAGE_PATH_V2,
Subpage.kManageOtherPeopleV2); Subpage.kManageOtherPeopleV2);
} else {
r.OS_PRIVACY = createSection(
r.ADVANCED, mojom.PRIVACY_AND_SECURITY_SECTION_PATH,
Section.kPrivacyAndSecurity);
} }
// Languages and Input section. // Languages and Input section.
......
...@@ -194,6 +194,12 @@ ...@@ -194,6 +194,12 @@
<iron-icon icon="cr:search"></iron-icon> <iron-icon icon="cr:search"></iron-icon>
$i18n{osSearchPageTitle} $i18n{osSearchPageTitle}
</a> </a>
<template is="dom-if" if="[[isAccountManagementFlowsV2Enabled_]]">
<a href="/osPrivacy" class="item">
<iron-icon icon="cr:security"></iron-icon>
$i18n{privacyPageTitle}
</a>
</template>
<a href="/apps" class="item"> <a href="/apps" class="item">
<iron-icon icon="os-settings:apps"></iron-icon> <iron-icon icon="os-settings:apps"></iron-icon>
$i18n{appsPageTitle} $i18n{appsPageTitle}
...@@ -220,10 +226,12 @@ ...@@ -220,10 +226,12 @@
<iron-icon icon="os-settings:access-time"></iron-icon> <iron-icon icon="os-settings:access-time"></iron-icon>
$i18n{dateTimePageTitle} $i18n{dateTimePageTitle}
</a> </a>
<a href="/osPrivacy" class="item"> <template is="dom-if" if="[[!isAccountManagementFlowsV2Enabled_]]">
<a href="/osPrivacy" class="item">
<iron-icon icon="cr:security"></iron-icon> <iron-icon icon="cr:security"></iron-icon>
$i18n{privacyPageTitle} $i18n{privacyPageTitle}
</a> </a>
</template>
<a href="/osLanguages" class="item"> <a href="/osLanguages" class="item">
<iron-icon icon="os-settings:language"></iron-icon> <iron-icon icon="os-settings:language"></iron-icon>
$i18n{osLanguagesPageTitle} $i18n{osLanguagesPageTitle}
......
...@@ -35,6 +35,18 @@ Polymer({ ...@@ -35,6 +35,18 @@ Polymer({
showReset: Boolean, showReset: Boolean,
showKerberosSection: Boolean, showKerberosSection: Boolean,
/**
* True if redesign of account management flows is enabled.
* @private
*/
isAccountManagementFlowsV2Enabled_: {
type: Boolean,
value() {
return loadTimeData.getBoolean('isAccountManagementFlowsV2Enabled');
},
readOnly: true,
},
}, },
/** @param {!settings.Route} newRoute */ /** @param {!settings.Route} newRoute */
......
...@@ -186,6 +186,13 @@ ...@@ -186,6 +186,13 @@
<os-settings-search-page prefs="{{prefs}}"> <os-settings-search-page prefs="{{prefs}}">
</os-settings-search-page> </os-settings-search-page>
</settings-section> </settings-section>
<template is="dom-if" if="[[isAccountManagementFlowsV2Enabled_]]">
<settings-section page-title="$i18n{privacyPageTitle}"
section="osPrivacy">
<os-settings-privacy-page prefs="{{prefs}}">
</os-settings-privacy-page>
</settings-section>
</template>
<settings-section page-title="$i18n{appsPageTitle}" section="apps"> <settings-section page-title="$i18n{appsPageTitle}" section="apps">
<os-settings-apps-page <os-settings-apps-page
prefs="{{prefs}}" prefs="{{prefs}}"
...@@ -237,11 +244,13 @@ ...@@ -237,11 +244,13 @@
<settings-date-time-page prefs="{{prefs}}"> <settings-date-time-page prefs="{{prefs}}">
</settings-date-time-page> </settings-date-time-page>
</settings-section> </settings-section>
<settings-section page-title="$i18n{privacyPageTitle}" <template is="dom-if" if="[[!isAccountManagementFlowsV2Enabled_]]">
section="osPrivacy"> <settings-section page-title="$i18n{privacyPageTitle}"
<os-settings-privacy-page prefs="{{prefs}}"> section="osPrivacy">
</os-settings-privacy-page> <os-settings-privacy-page prefs="{{prefs}}">
</settings-section> </os-settings-privacy-page>
</settings-section>
</template>
<settings-section page-title="$i18n{osLanguagesPageTitle}" <settings-section page-title="$i18n{osLanguagesPageTitle}"
section="osLanguages"> section="osLanguages">
<os-settings-languages-section prefs="{{prefs}}"> <os-settings-languages-section prefs="{{prefs}}">
......
...@@ -103,6 +103,18 @@ Polymer({ ...@@ -103,6 +103,18 @@ Polymer({
/** @private {!settings.Route|undefined} */ /** @private {!settings.Route|undefined} */
currentRoute_: Object, currentRoute_: Object,
/**
* True if redesign of account management flows is enabled.
* @private
*/
isAccountManagementFlowsV2Enabled_: {
type: Boolean,
value() {
return loadTimeData.getBoolean('isAccountManagementFlowsV2Enabled');
},
readOnly: true,
},
}, },
hostAttributes: { hostAttributes: {
......
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