Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move security and privacy settings out of additional menu #9243

Merged
merged 1 commit into from
Jun 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 16 additions & 14 deletions browser/resources/settings/brave_overrides/basic_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
}
}
})
46 changes: 24 additions & 22 deletions browser/resources/settings/brave_overrides/settings_menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,29 +175,14 @@ 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'),
'/shields',
'brave_settings:shields',
'shields',
)
helpTipsEl.insertAdjacentElement('afterend', shieldsEl)
newTabEl.insertAdjacentElement('afterend', shieldsEl)
// Add Embed Blocking item
const embedEl = createMenuElement(
loadTimeData.getString('socialBlocking'),
Expand All @@ -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'),
Expand Down Expand Up @@ -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]')
Expand Down