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 Inactive tabs setting to Appearance section (uplift to 1.72.x) #25924

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
13 changes: 10 additions & 3 deletions browser/resources/settings/brave_appearance_page/tabs.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@
name="true"
no-extension-indicator>
</controlled-radio-button>
</settings-radio-group>


</settings-radio-group>
</div>
</template> <!-- vertical_tabs_enabled.value -->

Expand Down Expand Up @@ -95,3 +93,12 @@
class="cr-row"
label="$i18n{showHoverCardMemoryUsageStandalone}">
</settings-toggle-button>

<!-- 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>
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
Loading