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 ++++++------------- 1 file changed, 6 insertions(+), 14 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. -- 2.17.1