From 2dbbbe128d7957d8dc9d1486846677464a47230c Mon Sep 17 00:00:00 2001 From: Emerick Rogul Date: Sat, 12 Oct 2024 13:59:57 -0400 Subject: [PATCH 1/2] Remove performance settings from basic page Chromium change: https://source.chromium.org/chromium/chromium/src/+/719b8cd15b7e53209f1d0b1688ac8e96b4845377 commit 719b8cd15b7e53209f1d0b1688ac8e96b4845377 Author: Charles Meng Date: Thu Feb 8 19:40:12 2024 +0000 Clean up functions for showing performance settings sections Previously these functions were checking if feature flags were enabled. Now that those feature flags are enabled by default, these functions may be replaced by showPage_. Bug: 1523807 --- .../settings/brave_overrides/basic_page.ts | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/browser/resources/settings/brave_overrides/basic_page.ts b/browser/resources/settings/brave_overrides/basic_page.ts index 037efbe7c093..134bcaa965ae 100644 --- a/browser/resources/settings/brave_overrides/basic_page.ts +++ b/browser/resources/settings/brave_overrides/basic_page.ts @@ -369,21 +369,11 @@ RegisterPolymerTemplateModifications({ // Remove all hidden performance options from basic page. // We moved performance elements into system settings. const performanceTemplate = actualTemplate.content.querySelector( - 'template[if="[[showPerformancePage_(pageVisibility.performance)]]"]') + 'template[if="[[showPage_(pageVisibility.performance)]]"]') if (performanceTemplate) { performanceTemplate.remove() - } - - const batteryTemplate = actualTemplate.content.querySelector( - 'template[if="[[showBatteryPage_(pageVisibility.performance)]]"]') - if (batteryTemplate) { - batteryTemplate.remove() - } - - const speedTemplate = actualTemplate.content.querySelector( - 'template[if="[[showSpeedPage_(pageVisibility.performance)]]"]') - if (speedTemplate) { - speedTemplate.remove() + } else { + console.error('[Settings] Could not find performance section') } // Get Started at top From 1bf07c9d77319c89fd3d12f89bc971fed349b484 Mon Sep 17 00:00:00 2001 From: Emerick Rogul Date: Sat, 12 Oct 2024 14:02:02 -0400 Subject: [PATCH 2/2] Avoid throwing an associated-control exception on settings pages --- .../brave_default_extensions_page.html | 2 +- .../resources/settings/brave_wallet_page/brave_wallet_page.html | 2 +- .../default_brave_shields_page/default_brave_shields_page.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/browser/resources/settings/brave_default_extensions_page/brave_default_extensions_page.html b/browser/resources/settings/brave_default_extensions_page/brave_default_extensions_page.html index feb36950c1a3..afeb2ec5a58c 100644 --- a/browser/resources/settings/brave_default_extensions_page/brave_default_extensions_page.html +++ b/browser/resources/settings/brave_default_extensions_page/brave_default_extensions_page.html @@ -116,7 +116,7 @@ -