Files
cromite/build/patches/Do-not-grant-notifications-to-default-search-engine.patch
2020-03-13 18:52:40 +01:00

78 lines
3.9 KiB
Diff

From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sat, 10 Nov 2018 19:47:39 +0100
Subject: Do not grant notifications to default search engine
Block gelocation by default instead of granting it for non-enterprise use cases (almost the totality of users)
---
.../search_permissions_service.cc | 20 ++++++-------------
chrome/common/chrome_features.cc | 2 +-
2 files changed, 7 insertions(+), 15 deletions(-)
diff --git a/chrome/browser/android/search_permissions/search_permissions_service.cc b/chrome/browser/android/search_permissions/search_permissions_service.cc
--- a/chrome/browser/android/search_permissions/search_permissions_service.cc
+++ b/chrome/browser/android/search_permissions/search_permissions_service.cc
@@ -191,7 +191,7 @@ void SearchPermissionsService::ResetDSEPermission(ContentSettingsType type) {
DCHECK(dse_url.is_empty() || IsPermissionControlledByDSE(type, dse_origin));
if (!dse_url.is_empty())
- SetContentSetting(dse_url, type, CONTENT_SETTING_ALLOW);
+ SetContentSetting(dse_url, type, CONTENT_SETTING_BLOCK);
}
void SearchPermissionsService::ResetDSEPermissions() {
@@ -334,11 +334,7 @@ void SearchPermissionsService::InitializeSettingsIfNeeded() {
return;
}
- // If we get to here, the DSE is not disabled by enterprise policy. If it was
- // previously enterprise controlled, we initialize the setting to BLOCK since
- // we don't know what the user's setting was previously.
- bool was_enterprise_controlled =
- pref_service_->GetBoolean(prefs::kDSEWasDisabledByPolicy);
+ // If this line is reached then DSE is not disabled by enterprise policy.
pref_service_->ClearPref(prefs::kDSEWasDisabledByPolicy);
// Initialize the pref for geolocation if it hasn't been initialized yet.
@@ -371,10 +367,8 @@ void SearchPermissionsService::InitializeSettingsIfNeeded() {
pref_service_->ClearPref(prefs::kDSEGeolocationSettingDeprecated);
} else if (dse_geolocation_setting == CONTENT_SETTING_ASK) {
// If the user hasn't explicitly allowed or blocked geolocation for the
- // DSE, initialize it to allowed.
- dse_geolocation_setting = was_enterprise_controlled
- ? CONTENT_SETTING_BLOCK
- : CONTENT_SETTING_ALLOW;
+ // DSE, initialize it to blocked.
+ dse_geolocation_setting = CONTENT_SETTING_BLOCK;
}
// Update the content setting with the auto-grants for the DSE.
@@ -399,11 +393,9 @@ void SearchPermissionsService::InitializeSettingsIfNeeded() {
GetContentSetting(dse_origin, ContentSettingsType::NOTIFICATIONS);
ContentSetting dse_notifications_setting = notifications_setting_to_restore;
// If the user hasn't explicitly allowed or blocked notifications for the
- // DSE, initialize it to allowed.
+ // DSE, initialize it to blocked.
if (dse_notifications_setting == CONTENT_SETTING_ASK) {
- dse_notifications_setting = was_enterprise_controlled
- ? CONTENT_SETTING_BLOCK
- : CONTENT_SETTING_ALLOW;
+ dse_notifications_setting = CONTENT_SETTING_BLOCK;
}
// Update the content setting with the auto-grants for the DSE.
diff --git a/chrome/common/chrome_features.cc b/chrome/common/chrome_features.cc
--- a/chrome/common/chrome_features.cc
+++ b/chrome/common/chrome_features.cc
@@ -310,7 +310,7 @@ const base::FeatureParam<std::string> kDnsOverHttpsTemplatesParam{
#if defined(OS_ANDROID)
// Enable changing default downloads storage location on Android.
const base::Feature kDownloadsLocationChange{"DownloadsLocationChange",
- base::FEATURE_ENABLED_BY_DEFAULT};
+ base::FEATURE_DISABLED_BY_DEFAULT};
#endif
// If enabled, policies will use FCM (Firebase Cloud Messaging) for its
--
2.17.1