Skip to content

Commit

Permalink
Merge pull request #8800 from brave/maxk-fix-settings-ui-privacy-page
Browse files Browse the repository at this point in the history
Fixes Settings UI privacy page missing settings.
  • Loading branch information
mkarolin committed May 18, 2021
1 parent 83b1516 commit 33d82b0
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 20 deletions.
1 change: 1 addition & 0 deletions browser/resources/settings/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ preprocess_if_expr("preprocess") {
"brave_overrides/passwords_section.js",
"brave_overrides/payments_section.js",
"brave_overrides/people_page.js",
"brave_overrides/personalization_options.js",
"brave_overrides/printing_page.js",
"brave_overrides/reset_profile_dialog.js",
"brave_overrides/safety_check_passwords_child.js",
Expand Down
1 change: 1 addition & 0 deletions browser/resources/settings/brave_overrides/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import './page_visibility.js'
import './passwords_section.js'
import './payments_section.js'
import './people_page.js'
import './personalization_options.js'
import './printing_page.js'
import './safety_check_passwords_child.js'
import './security_page.js'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Copyright (c) 2021 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 http://mozilla.org/MPL/2.0/.

import {RegisterPolymerTemplateModifications} from 'chrome://brave-resources/polymer_overriding.js'

import '../brave_privacy_page/brave_personalization_options.m.js'

RegisterPolymerTemplateModifications({
'settings-personalization-options': (templateContent) => {
const searchSuggestToggle = templateContent.getElementById('searchSuggestToggle')
if (!searchSuggestToggle) {
console.error(`[Brave Settings Overrides] Couldn't find search suggest toggle`)
} else {
searchSuggestToggle.insertAdjacentHTML('afterend', `
<settings-brave-personalization-options prefs="{{prefs}}"></settings-brave-personalization-options>
`)
}
},
})
Original file line number Diff line number Diff line change
@@ -1,37 +1,24 @@
diff --git a/chrome/browser/resources/settings/privacy_page/personalization_options.html b/chrome/browser/resources/settings/privacy_page/personalization_options.html
index 70eeec029bfbf19f8419aa5176acfc7dd8f13732..51308b5bf609288edb885cc6ad82f7ba76c654ab 100644
index 70eeec029bfbf19f8419aa5176acfc7dd8f13732..1be168dddf273d27d28935d2d4d2e64a57796779 100644
--- a/chrome/browser/resources/settings/privacy_page/personalization_options.html
+++ b/chrome/browser/resources/settings/privacy_page/personalization_options.html
@@ -1,3 +1,4 @@
+<link rel="import" href="../brave_privacy_page/brave_personalization_options.html">
<style include="settings-shared">
:host(.list-frame) settings-toggle-button {
padding-inline-end: 0;
@@ -8,6 +9,7 @@
@@ -8,6 +8,7 @@
border-top: none;
}
</style>
+<if expr="_google_chrome">
<if expr="not chromeos">
<settings-toggle-button id="signinAllowedToggle"
class="hr"
@@ -20,6 +22,7 @@
@@ -20,6 +21,7 @@
no-set-pref>
</settings-toggle-button>
</if><!-- not chromeos -->
+</if>
<settings-toggle-button id="searchSuggestToggle"
class="hr"
hidden="[[!pageVisibility.searchPrediction]]"
@@ -27,6 +30,7 @@
label="$i18n{searchSuggestPref}"
sub-label="$i18n{searchSuggestPrefDesc}">
</settings-toggle-button>
+ <settings-brave-personalization-options prefs="{{prefs}}"></settings-brave-personalization-options>
<if expr="_google_chrome">
<if expr="chromeos">
<settings-toggle-button class="hr"
@@ -35,6 +39,8 @@
@@ -35,6 +37,8 @@
sub-label="$i18n{enablePersonalizationLoggingDesc}">
</settings-toggle-button>
</if><!-- chromeos -->
Expand All @@ -40,7 +27,7 @@ index 70eeec029bfbf19f8419aa5176acfc7dd8f13732..51308b5bf609288edb885cc6ad82f7ba
<if expr="not chromeos">
<settings-toggle-button id="metricsReportingControl"
class="hr"
@@ -50,13 +56,15 @@
@@ -50,13 +54,15 @@
</template>
</settings-toggle-button>
</if><!-- not chromeos -->
Expand All @@ -57,15 +44,15 @@ index 70eeec029bfbf19f8419aa5176acfc7dd8f13732..51308b5bf609288edb885cc6ad82f7ba
<if expr="_google_chrome">
<settings-toggle-button id="spellCheckControl"
class="hr"
@@ -76,6 +84,7 @@
@@ -76,6 +82,7 @@
</settings-toggle-button>
</template>

+<if expr="_google_chrome">
<template is="dom-if" if="[[showSignoutDialog_]]" restamp>
<settings-signout-dialog sync-status="[[syncStatus]]"
on-close="onSignoutDialogClosed_">
@@ -88,3 +97,4 @@
@@ -88,3 +95,4 @@
<cr-button on-click="onRestartTap_">$i18n{restart}</cr-button>
</cr-toast>
</if>
Expand Down

0 comments on commit 33d82b0

Please sign in to comment.