Skip to content

Commit

Permalink
Uplift of #25907 (squashed) to beta
Browse files Browse the repository at this point in the history
  • Loading branch information
brave-builds committed Oct 10, 2024
1 parent 186dfb9 commit 61ec2cf
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 1 deletion.
9 changes: 9 additions & 0 deletions browser/resources/settings/brave_appearance_page/tabs.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
<!-- This file will be converted into tabs.html.js using //tools/grit/preprocess_if_expr -->
<style include="settings-shared iron-flex"></style>

<!-- Inactive tabs appearance -->
<settings-toggle-button
pref="{{prefs.performance_tuning.discard_ring_treatment.enabled}}"
class="cr-row"
label="$i18n{discardRingTreatmentEnabledLabel}"
sub-label-with-link="$i18n{discardRingTreatmentEnabledDescriptionWithLearnLink}"
on-sub-label-link-clicked="onDiscardRingTreatmentLearnMoreLinkClick_">
</settings-toggle-button>

<!-- Vertical Tab strip -->
<settings-toggle-button
class="cr-row first"
Expand Down
6 changes: 6 additions & 0 deletions browser/resources/settings/brave_appearance_page/tabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import '../settings_vars.css.js'
import {PrefsMixin, PrefsMixinInterface} from '/shared/settings/prefs/prefs_mixin.js';
import {I18nMixin, I18nMixinInterface} from 'chrome://resources/cr_elements/i18n_mixin.js'
import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'
import {OpenWindowProxyImpl} from 'chrome://resources/js/open_window_proxy.js';

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

Expand Down Expand Up @@ -39,6 +40,11 @@ export class SettingsBraveAppearanceTabsElement extends SettingsBraveAppearanceT
private isSharedPinnedTabsEnabled_() {
return loadTimeData.getBoolean('isSharedPinnedTabsEnabled')
}

private onDiscardRingTreatmentLearnMoreLinkClick_() {
OpenWindowProxyImpl.getInstance().openUrl(
loadTimeData.getString('discardRingTreatmentLearnMoreUrl'));
}
}

customElements.define(SettingsBraveAppearanceTabsElement.is, SettingsBraveAppearanceTabsElement)
1 change: 1 addition & 0 deletions browser/resources/settings/brave_overrides/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import './page_visibility.js'
import './passwords_section.js'
import './payments_section.js'
import './people_page.js'
import './performance_page.js'
import './personalization_options.js'
import './printing_page.js'
import './privacy_page.js'
Expand Down
18 changes: 18 additions & 0 deletions browser/resources/settings/brave_overrides/performance_page.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/* Copyright (c) 2024 The Brave Authors. All rights reserved.
* This Source Code Form is subject to the terms of the Mozilla Public
* 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 {RegisterPolymerTemplateModifications} from 'chrome://resources/brave/polymer_overriding.js'

RegisterPolymerTemplateModifications({
'settings-performance-page': (templateContent) => {
const discardRingTreatmentToggleButton =
templateContent.querySelector('#discardRingTreatmentToggleButton')
if (discardRingTreatmentToggleButton) {
discardRingTreatmentToggleButton.remove()
} else {
console.error('[Settings] Could not find discardRingTreatmentToggleButton')
}
}
})
1 change: 1 addition & 0 deletions browser/resources/settings/sources.gni
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ brave_settings_non_web_component_files = [
"brave_overrides/passwords_section.ts",
"brave_overrides/payments_section.ts",
"brave_overrides/people_page.ts",
"brave_overrides/performance_page.ts",
"brave_overrides/personalization_options.ts",
"brave_overrides/printing_page.ts",
"brave_overrides/privacy_page.ts",
Expand Down
2 changes: 1 addition & 1 deletion chromium_src/chrome/common/url_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ inline constexpr char kCrashReasonFeedbackDisplayedURL[] =

// "Learn more" URL for the inactive tabs appearance setting.
inline constexpr char16_t kDiscardRingTreatmentLearnMoreUrl[] =
u"https://support.brave.com/";
u"https://support.brave.com/hc/en-us/articles/30938249371277";

// "Learn more" URL for the "Do not track" setting in the privacy section.
inline constexpr char16_t kDoNotTrackLearnMoreURL[] =
Expand Down

0 comments on commit 61ec2cf

Please sign in to comment.