Skip to content

Commit 9dcad4e

Browse files
committed
Moved element to system section
1 parent f5d652f commit 9dcad4e

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

browser/resources/settings/brave_help_tips_page/brave_help_tips_page.html

-4
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@
99
pref="{{prefs.brave.enable_window_closing_confirm}}"
1010
label="$i18n{braveHelpTipsWarnBeforeClosingWindow}">
1111
</settings-toggle-button>
12-
<settings-toggle-button class="cr-row"
13-
pref="{{prefs.brave.enable_closing_last_tab}}"
14-
label="$i18n{braveHelpTipsClosingLastTab}">
15-
</settings-toggle-button>
1612
<if expr="is_macosx">
1713
<settings-toggle-button class="cr-row"
1814
pref="{{prefs.browser.confirm_to_quit}}"

browser/resources/settings/brave_overrides/basic_page.js

+17
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,19 @@ function createSectionElement (sectionName, titleName, childName, childAttribute
5454
`
5555
}
5656

57+
/**
58+
* Creates a settings-toggle-button element and returns it.
59+
* @param {string} pref - preference path to handle by toggle
60+
* @param {string} label - label for the element
61+
* @returns {Element}
62+
*/
63+
function createToggleButtonElement (pref, label) {
64+
return html`
65+
<settings-toggle-button class="cr-row" pref="{{${pref}}}" label="${loadTimeData.getString(label)}">
66+
</settings-toggle-button>
67+
`
68+
}
69+
5770
RegisterStyleOverride(
5871
'settings-basic-page',
5972
html`
@@ -240,6 +253,10 @@ RegisterPolymerTemplateModifications({
240253
// Move help tips after downloads
241254
const sectionDownloads = getSectionElement(advancedSubSectionsTemplate.content, 'downloads')
242255
sectionDownloads.insertAdjacentElement('afterend', sectionHelpTips)
256+
// Add an element to Chromium's system section
257+
const buttonElement = createToggleButtonElement("prefs.brave.enable_closing_last_tab", "braveHelpTipsClosingLastTab")
258+
const sectionSystem = getSectionElement(advancedSubSectionsTemplate.content, 'system')
259+
sectionSystem.appendChild(buttonElement)
243260
}
244261
}
245262
})

0 commit comments

Comments
 (0)