Skip to content

Commit

Permalink
Merge pull request #493 from brave/hide-settings
Browse files Browse the repository at this point in the history
Hide settings which do not apply to Brave
  • Loading branch information
darkdh authored Sep 25, 2018
2 parents 7236dd8 + d64fe6b commit fcefe04
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/chrome/browser/resources/settings/privacy_page/privacy_page.html b/chrome/browser/resources/settings/privacy_page/privacy_page.html
index 12aa760c00b9d3d21e49f7ff71618d302fb50c6f..dab841dba7337c6101448b889d4b63d538cbb69a 100644
index 12aa760c00b9d3d21e49f7ff71618d302fb50c6f..615bf73aa5e1a31e832907359d77cd0272fb5a52 100644
--- a/chrome/browser/resources/settings/privacy_page/privacy_page.html
+++ b/chrome/browser/resources/settings/privacy_page/privacy_page.html
@@ -191,6 +191,7 @@
Expand All @@ -18,7 +18,35 @@ index 12aa760c00b9d3d21e49f7ff71618d302fb50c6f..dab841dba7337c6101448b889d4b63d5
<template is="dom-if" route-path="/content/camera" no-search>
<settings-subpage page-title="$i18n{siteSettingsCategoryCamera}">
<media-picker label="$i18n{siteSettingsCameraLabel}" type="camera">
@@ -380,6 +382,19 @@
@@ -227,11 +229,13 @@
toggle-on-label="$i18n{siteSettingsCookiesAllowedRecommended}"
sub-option-label="$i18n{deleteDataPostSession}">
</category-default-setting>
+<if expr="_google_chrome">
<settings-toggle-button
pref="{{prefs.profile.block_third_party_cookies}}"
label="$i18n{thirdPartyCookie}"
sub-label="$i18n{thirdPartyCookieSublabel}">
</settings-toggle-button>
+</if>
<div id="site-data-trigger" class="settings-box" actionable
on-click="onSiteDataTap_">
<div class="start" id="cookiesLink">
@@ -301,11 +305,13 @@
</template>
<template is="dom-if" route-path="/content/javascript" no-search>
<settings-subpage page-title="$i18n{siteSettingsCategoryJavascript}">
+<if expr="_google_chrome">
<category-default-setting
toggle-off-label="$i18n{siteSettingsBlocked}"
toggle-on-label="$i18n{siteSettingsAllowedRecommended}"
category="{{ContentSettingsTypes.JAVASCRIPT}}">
</category-default-setting>
+</if>
<category-setting-exceptions
category="{{ContentSettingsTypes.JAVASCRIPT}}"
block-header="$i18n{siteSettingsBlock}">
@@ -380,6 +386,19 @@
</category-setting-exceptions>
</settings-subpage>
</template>
Expand Down
11 changes: 8 additions & 3 deletions patches/chrome-browser-resources-settings-route.js.patch
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
diff --git a/chrome/browser/resources/settings/route.js b/chrome/browser/resources/settings/route.js
index 866453bdfddf5c899472633b11910ad41de81e35..72aad165de9c687110e3696e3bdbf8c58b8580eb 100644
index 866453bdfddf5c899472633b11910ad41de81e35..eb0a03558de4637cd7df733fc2795023db8d20ed 100644
--- a/chrome/browser/resources/settings/route.js
+++ b/chrome/browser/resources/settings/route.js
@@ -331,6 +331,7 @@ cr.define('settings', function() {
@@ -328,9 +328,12 @@ cr.define('settings', function() {

// TODO(tommycli): Find a way to refactor these repetitive category
// routes.
+<if expr="_google_chrome">
r.SITE_SETTINGS_ADS = r.SITE_SETTINGS.createChild('ads');
+</if>
r.SITE_SETTINGS_AUTOMATIC_DOWNLOADS =
r.SITE_SETTINGS.createChild('automaticDownloads');
+ r.SITE_SETTINGS_AUTOPLAY = r.SITE_SETTINGS.createChild('autoplay');
r.SITE_SETTINGS_BACKGROUND_SYNC =
r.SITE_SETTINGS.createChild('backgroundSync');
r.SITE_SETTINGS_CAMERA = r.SITE_SETTINGS.createChild('camera');
@@ -396,7 +397,9 @@ cr.define('settings', function() {
@@ -396,7 +399,9 @@ cr.define('settings', function() {
}

r.PRINTING = r.ADVANCED.createSection('/printing', 'printing');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/chrome/browser/resources/settings/site_settings_page/site_settings_page.html b/chrome/browser/resources/settings/site_settings_page/site_settings_page.html
index b2894017d199903bb468124871b0a4d1223f923f..84324a86432dc7f47186da91931764d7792c69d7 100644
index b2894017d199903bb468124871b0a4d1223f923f..89ba15f6145479784520630932db317abbdfedee 100644
--- a/chrome/browser/resources/settings/site_settings_page/site_settings_page.html
+++ b/chrome/browser/resources/settings/site_settings_page/site_settings_page.html
@@ -148,6 +148,25 @@
Expand Down Expand Up @@ -28,15 +28,24 @@ index b2894017d199903bb468124871b0a4d1223f923f..84324a86432dc7f47186da91931764d7
<div id="javascript" class="settings-box two-line"
category$="[[ContentSettingsTypes.JAVASCRIPT]]"
data-route="SITE_SETTINGS_JAVASCRIPT" on-click="onTapNavigate_"
@@ -242,6 +261,7 @@
@@ -221,6 +240,7 @@
aria-describedby="popupsSecondary"></button>
</paper-icon-button-light>
</div>
+<if expr="_google_chrome">
<template is="dom-if" if="[[enableSafeBrowsingSubresourceFilter_]]">
<div id="ads" class="settings-box two-line"
category$="[[ContentSettingsTypes.ADS]]"
@@ -242,6 +262,8 @@
</paper-icon-button-light>
</div>
</template>
+</if>
+<if expr="_google_chrome">
<div id="background-sync" class="settings-box two-line"
category$="[[ContentSettingsTypes.BACKGROUND_SYNC]]"
data-route="SITE_SETTINGS_BACKGROUND_SYNC" on-click="onTapNavigate_"
@@ -261,6 +281,7 @@
@@ -261,6 +283,7 @@
aria-describedby="backgroundSyncSecondary"></button>
</paper-icon-button-light>
</div>
Expand Down

0 comments on commit fcefe04

Please sign in to comment.