Skip to content

Commit

Permalink
Remove CookieView-related files from the settings page (uplift to 1.6…
Browse files Browse the repository at this point in the history
…8.x) (#24456)

Merge pull request #24256 from jagadeshjai/fix__settings_cookies_view_leftover

[Cookies] Remove CookieView-related files from the settings page
  • Loading branch information
bsclifton authored Jul 2, 2024
1 parent 8d682ca commit 862c426
Show file tree
Hide file tree
Showing 15 changed files with 4 additions and 543 deletions.
12 changes: 0 additions & 12 deletions app/brave_settings_strings.grdp
Original file line number Diff line number Diff line change
Expand Up @@ -559,18 +559,6 @@
<message name="IDS_SETTINGS_SITE_SETTINGS_USE_EPHEMERAL_STORAGE" desc="Label for sites in site settings enabling cookies cleanup when all windows with the site are clsoed.">
Clear on site close
</message>
<message name="IDS_SETTINGS_SITE_COOKIES_LINK_TITLE" desc="The title of a link to navigate to site cookies subpage.">
Cookies and Site Data
</message>
<message name="IDS_SETTINGS_SITE_COOKIES_LINK_DESC" desc="The description of a link to navigate to site cookies subpage.">
Show all cookies and locally stored data for this site
</message>
<message name="IDS_SETTINGS_SITE_SETTINGS_COOKIE_SUBPAGE" desc="A label for cookie subpage, stating which site we're showing data for.">
<ph name="SITE">$1<ex>www.example.com</ex></ph> locally stored data
</message>
<message name="IDS_SETTINGS_SITE_SETTINGS_COOKIES_REMOVE_ALL" desc="A label for remove all cookies button.">
Remove All
</message>

<!-- Settings / Privacy and security / Cookies and other site data / See all site data and permissions -->
<!-- These settings were reinstated after being deleted upstream -->
Expand Down
1 change: 0 additions & 1 deletion browser/resources/settings/brave_overrides/basic_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import '../brave_ipfs_page/brave_ipfs_page.js'
import '../brave_new_tab_page/brave_new_tab_page.js'
import '../brave_search_engines_page/brave_search_engines_page.js'
import '../brave_sync_page/brave_sync_page.js'
import '../brave_site_settings/brave_site_data_details_subpage.js'
import '../brave_tor_page/brave_tor_subpage.js'
import '../brave_wallet_page/brave_wallet_page.js'
import '../brave_web3_domains_page/brave_web3_domains_page.js'
Expand Down
2 changes: 0 additions & 2 deletions browser/resources/settings/brave_overrides/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,4 @@ import {RegisterPolymerComponentToIgnore} from 'chrome://resources/brave/polymer
RegisterPolymerComponentToIgnore('add-site-dialog')
RegisterPolymerComponentToIgnore('settings-site-settings-page')
RegisterPolymerComponentToIgnore('settings-clear-browsing-data-dialog')
RegisterPolymerComponentToIgnore('site-details')
RegisterPolymerComponentToIgnore('settings-autofill-page')
RegisterPolymerComponentToIgnore('settings-privacy-page')
28 changes: 1 addition & 27 deletions browser/resources/settings/brave_overrides/privacy_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this file,
// you can obtain one at https://mozilla.org/MPL/2.0/.

import {html, RegisterPolymerTemplateModifications, RegisterPolymerComponentReplacement} from 'chrome://resources/brave/polymer_overriding.js'
import {BraveSettingsPrivacyPageElement} from '../brave_privacy_page/brave_privacy_page.js'
import {html, RegisterPolymerTemplateModifications} from 'chrome://resources/brave/polymer_overriding.js'
import {getTrustedHTML} from 'chrome://resources/js/static_types.js'
import {loadTimeData} from '../i18n_setup.js'

Expand Down Expand Up @@ -182,30 +181,6 @@ function InsertShieldsSubpage (pages: Element)
`)
}

function InsertCookiesSubpage (pages: Element)
{
pages.appendChild(
html`
<template is="dom-if" route-path="/cookies/detail" no-search>
<settings-subpage
associated-control="[[$$('#cookiesLink')]]"
page-title="[[pageTitle]]">
<cr-button slot="subpage-title-extra" id="remove-all-button"
on-click="onRemoveAllCookiesFromSite_">
${loadTimeData.getString('siteSettingsCookieRemoveAll')}
</cr-button>
<brave-site-data-details-subpage page-title="{{pageTitle}}">
</brave-site-data-details-subpage>
</settings-subpage>
</template>
`)
}

RegisterPolymerComponentReplacement(
'settings-privacy-page',
BraveSettingsPrivacyPageElement
)

RegisterPolymerTemplateModifications({
'settings-privacy-page': (templateContent) => {
const pages = templateContent.getElementById('pages')
Expand Down Expand Up @@ -241,7 +216,6 @@ RegisterPolymerTemplateModifications({
InsertSolanaSubpage(pages)
}
InsertShieldsSubpage(pages)
InsertCookiesSubpage(pages)
const permissionsLinkRow =
templateContent.getElementById('permissionsLinkRow')
if (!permissionsLinkRow) {
Expand Down
33 changes: 1 addition & 32 deletions browser/resources/settings/brave_overrides/site_details.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,13 @@

// @ts-nocheck TODO(petemill): Define types and remove ts-nocheck

import {RegisterPolymerTemplateModifications,RegisterPolymerComponentReplacement} from 'chrome://resources/brave/polymer_overriding.js'
import {RegisterPolymerTemplateModifications} from 'chrome://resources/brave/polymer_overriding.js'
import {getTrustedHTML} from 'chrome://resources/js/static_types.js'

import {loadTimeData} from '../i18n_setup.js'
import {BraveSiteDetailsElement} from '../brave_site_details/brave_site_details.js'

import 'chrome://resources/brave/leo.bundle.js'

RegisterPolymerComponentReplacement(
'site-details',
BraveSiteDetailsElement
)

RegisterPolymerTemplateModifications({
'site-details': (templateContent) => {
if (!loadTimeData.getBoolean('isIdleDetectionFeatureEnabled')) {
Expand Down Expand Up @@ -147,30 +141,5 @@ RegisterPolymerTemplateModifications({

// In Chromium, the VR and AR icons are the same but we want to have separate ones.
templateContent.querySelector('site-details-permission[icon="settings:vr-headset"]')?.setAttribute('icon', 'smartphone-hand')

const usageSection = templateContent.querySelector('div#usage')
if (!usageSection) {
console.error(`[Brave Settings Overrides] Couldn't find usageSection item`)
} else {
usageSection.insertAdjacentHTML(
'afterend',
getTrustedHTML`
<cr-link-row id="cookiesLink" on-click="onCookiesDetailClicked_">
</cr-link-row>
`)
const cookiesDetail =
templateContent.querySelector('#cookiesLink')
if (!cookiesDetail) {
console.error(
'[Brave Settings Overrides] Couldn\'t find cookies link')
} else {
cookiesDetail.setAttribute('label',
loadTimeData.getString('siteCookiesLinkLabel'))
cookiesDetail.setAttribute('sub-label',
loadTimeData.getString('siteCookiesLinkDesc'))
}
}
}
})

This file was deleted.

7 changes: 1 addition & 6 deletions browser/resources/settings/brave_routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,7 @@ export default function addBraveRoutes(r: Partial<SettingsRoutes>) {
r.BRAVE_WALLET_NETWORKS = r.BRAVE_WALLET.createChild('/wallet/networks')
}
r.BRAVE_NEW_TAB = r.BASIC.createSection('/newTab', 'newTab')
if (r.SITE_SETTINGS_SITE_DETAILS) {
r.BRAVE_SITE_SETTINGS_COOKIES_DETAILS =
r.SITE_SETTINGS_SITE_DETAILS.createChild('/cookies/detail')
} else if (!isGuest) {
console.error('[Brave Settings Overrides] could not find expected route /content/siteDetails')
}

if (pageVisibility.leoAssistant) {
r.BRAVE_LEO_ASSISTANT =
r.BASIC.createSection('/leo-assistant', 'leoAssistant')
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit 862c426

Please sign in to comment.