Merge pull request #9243 from brave/fix/16470

move security and privacy settings out of additional menu
This commit is contained in:
yan
2021-06-28 11:23:06 -07:00
committed by GitHub
2 changed files with 40 additions and 36 deletions
@@ -103,12 +103,11 @@ RegisterPolymerTemplateModifications({
} else if (!isGuest) {
console.error('[Brave Settings Overrides] Could not move autofill route to advanced route', r)
}
// Privacy route is moved to advanced.
if (r.PRIVACY && r.ADVANCED) {
r.PRIVACY.parent = r.ADVANCED
r.CLEAR_BROWSER_DATA.parent = r.ADVANCED
// Safety check route is moved to advanced.
if (r.SAFETY_CHECK && r.ADVANCED) {
r.SAFETY_CHECK.parent = r.ADVANCED
} else if (!isGuest) {
console.error('[Brave Settings Overrides] Could not move privacy route to advanced route', r)
console.error('[Brave Settings Overrides] Could not move safety check route to advanced route', r)
}
// Add 'Getting Started' section
// Entire content is wrapped in another conditional template
@@ -236,15 +235,18 @@ RegisterPolymerTemplateModifications({
sectionGetStarted.insertAdjacentElement('afterend', sectionAppearance)
// Insert New Tab
sectionAppearance.insertAdjacentElement('afterend', sectionNewTab)
// Insert sync
sectionNewTab.insertAdjacentElement('afterend', sectionSync)
// Insert shields
sectionSync.insertAdjacentElement('afterend', sectionShields)
sectionNewTab.insertAdjacentElement('afterend', sectionShields)
// Insert Social Blocking
sectionShields.insertAdjacentElement('afterend', sectionSocialBlocking)
// Move privacy section to after social blocking
const sectionPrivacy = getSectionElement(actualTemplate.content, 'privacy')
sectionSocialBlocking.insertAdjacentElement('afterend', sectionPrivacy)
// Insert sync
sectionPrivacy.insertAdjacentElement('afterend', sectionSync)
// Move search
const sectionSearch = getSectionElement(actualTemplate.content, 'search')
sectionSocialBlocking.insertAdjacentElement('afterend', sectionSearch)
sectionSync.insertAdjacentElement('afterend', sectionSearch)
// Insert extensions
sectionSearch.insertAdjacentElement('afterend', sectionExtensions)
// Insert Wallet
@@ -273,12 +275,12 @@ RegisterPolymerTemplateModifications({
const sectionAutofill = getSectionElement(actualTemplate.content, 'autofill')
const sectionLanguages = getSectionElement(advancedSubSectionsTemplate.content, 'languages')
sectionLanguages.insertAdjacentElement('beforebegin', sectionAutofill)
// Move privacy to before autofill
const sectionPrivacy = getSectionElement(actualTemplate.content, 'privacy')
sectionAutofill.insertAdjacentElement('beforebegin', sectionPrivacy)
// Move help tips after downloads
// Move safety check after downloads
const sectionDownloads = getSectionElement(advancedSubSectionsTemplate.content, 'downloads')
sectionDownloads.insertAdjacentElement('afterend', sectionHelpTips)
const sectionSafetyCheck = getSectionElement(actualTemplate.content, 'safetyCheck')
sectionDownloads.insertAdjacentElement('afterend', sectionSafetyCheck)
// Move help tips after safety check
sectionSafetyCheck.insertAdjacentElement('afterend', sectionHelpTips)
}
}
})
@@ -175,21 +175,6 @@ RegisterPolymerTemplateModifications({
'newTab'
)
appearanceBrowserEl.insertAdjacentElement('afterend', newTabEl)
// Add Sync and Help Tips item
const helpTipsEl = createMenuElement(
loadTimeData.getString('braveHelpTips'),
'/braveHelpTips',
'brave_settings:help',
'braveHelpTips',
)
const syncEl = createMenuElement(
loadTimeData.getString('braveSync'),
'/braveSync',
'brave_settings:sync',
'braveSync',
)
newTabEl.insertAdjacentElement('afterend', syncEl)
syncEl.insertAdjacentElement('afterend', helpTipsEl)
// Add Shields item
const shieldsEl = createMenuElement(
loadTimeData.getString('braveShieldsTitle'),
@@ -197,7 +182,7 @@ RegisterPolymerTemplateModifications({
'brave_settings:shields',
'shields',
)
helpTipsEl.insertAdjacentElement('afterend', shieldsEl)
newTabEl.insertAdjacentElement('afterend', shieldsEl)
// Add Embed Blocking item
const embedEl = createMenuElement(
loadTimeData.getString('socialBlocking'),
@@ -206,9 +191,20 @@ RegisterPolymerTemplateModifications({
'socialBlocking',
)
shieldsEl.insertAdjacentElement('afterend', embedEl)
// Add privacy
const privacyEl = getMenuElement(templateContent, '/privacy')
embedEl.insertAdjacentElement('afterend', privacyEl)
// Add Sync item
const syncEl = createMenuElement(
loadTimeData.getString('braveSync'),
'/braveSync',
'brave_settings:sync',
'braveSync',
)
privacyEl.insertAdjacentElement('afterend', syncEl)
// Move search item
const searchEl = getMenuElement(templateContent, '/search')
embedEl.insertAdjacentElement('afterend', searchEl)
syncEl.insertAdjacentElement('afterend', searchEl)
// Add Extensions item
const extensionEl = createMenuElement(
loadTimeData.getString('braveDefaultExtensions'),
@@ -238,12 +234,18 @@ RegisterPolymerTemplateModifications({
const autofillEl = getMenuElement(templateContent, '/autofill')
const languagesEl = getMenuElement(templateContent, '/languages')
languagesEl.insertAdjacentElement('beforebegin', autofillEl)
// Move privacy to advanced
const privacyEl = getMenuElement(templateContent, '/privacy')
autofillEl.insertAdjacentElement('beforebegin', privacyEl)
// Move helptips to advanced
// Move safety check after downloads
const downloadsEl = getMenuElement(templateContent, '/downloads')
downloadsEl.insertAdjacentElement('afterend', helpTipsEl)
const safetyEl = getMenuElement(templateContent, '/safetyCheck')
downloadsEl.insertAdjacentElement('afterend', safetyEl)
// Move help tips after safety check
const helpTipsEl = createMenuElement(
loadTimeData.getString('braveHelpTips'),
'/braveHelpTips',
'brave_settings:help',
'braveHelpTips',
)
safetyEl.insertAdjacentElement('afterend', helpTipsEl)
// Allow Accessibility to be removed :-(
const a11yEl = getMenuElement(templateContent, '/accessibility')
a11yEl.setAttribute('hidden', '[[!pageVisibility.a11y]')