Do-not-grant-notifications-to-default-search-engine.patch 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. From: csagan5 <32685696+csagan5@users.noreply.github.com>
  2. Date: Sat, 10 Nov 2018 19:47:39 +0100
  3. Subject: Do not grant notifications to default search engine
  4. Block gelocation by default instead of granting it for non-enterprise use cases (almost the totality of users)
  5. ---
  6. .../search_permissions/search_permissions_service.cc | 18 +++++-------------
  7. chrome/common/chrome_features.cc | 2 +-
  8. 2 files changed, 6 insertions(+), 14 deletions(-)
  9. diff --git a/chrome/browser/android/search_permissions/search_permissions_service.cc b/chrome/browser/android/search_permissions/search_permissions_service.cc
  10. --- a/chrome/browser/android/search_permissions/search_permissions_service.cc
  11. +++ b/chrome/browser/android/search_permissions/search_permissions_service.cc
  12. @@ -333,11 +333,7 @@ void SearchPermissionsService::InitializeSettingsIfNeeded() {
  13. return;
  14. }
  15. - // If we get to here, the DSE is not disabled by enterprise policy. If it was
  16. - // previously enterprise controlled, we initialize the setting to BLOCK since
  17. - // we don't know what the user's setting was previously.
  18. - bool was_enterprise_controlled =
  19. - pref_service_->GetBoolean(prefs::kDSEWasDisabledByPolicy);
  20. + // If we get to here, the DSE is not disabled by enterprise policy.
  21. pref_service_->ClearPref(prefs::kDSEWasDisabledByPolicy);
  22. // Initialize the pref for geolocation if it hasn't been initialized yet.
  23. @@ -370,10 +366,8 @@ void SearchPermissionsService::InitializeSettingsIfNeeded() {
  24. pref_service_->ClearPref(prefs::kDSEGeolocationSettingDeprecated);
  25. } else if (dse_geolocation_setting == CONTENT_SETTING_ASK) {
  26. // If the user hasn't explicitly allowed or blocked geolocation for the
  27. - // DSE, initialize it to allowed.
  28. - dse_geolocation_setting = was_enterprise_controlled
  29. - ? CONTENT_SETTING_BLOCK
  30. - : CONTENT_SETTING_ALLOW;
  31. + // DSE, initialize it to disallowed.
  32. + dse_geolocation_setting = CONTENT_SETTING_BLOCK;
  33. }
  34. // Update the content setting with the auto-grants for the DSE.
  35. @@ -398,11 +392,9 @@ void SearchPermissionsService::InitializeSettingsIfNeeded() {
  36. GetContentSetting(dse_origin, CONTENT_SETTINGS_TYPE_NOTIFICATIONS);
  37. ContentSetting dse_notifications_setting = notifications_setting_to_restore;
  38. // If the user hasn't explicitly allowed or blocked notifications for the
  39. - // DSE, initialize it to allowed.
  40. + // DSE, initialize it to disallowed.
  41. if (dse_notifications_setting == CONTENT_SETTING_ASK) {
  42. - dse_notifications_setting = was_enterprise_controlled
  43. - ? CONTENT_SETTING_BLOCK
  44. - : CONTENT_SETTING_ALLOW;
  45. + dse_notifications_setting = CONTENT_SETTING_BLOCK;
  46. }
  47. // Update the content setting with the auto-grants for the DSE.
  48. diff --git a/chrome/common/chrome_features.cc b/chrome/common/chrome_features.cc
  49. --- a/chrome/common/chrome_features.cc
  50. +++ b/chrome/common/chrome_features.cc
  51. @@ -242,7 +242,7 @@ const char kDisallowUnsafeHttpDownloadsParamName[] = "MimeTypeList";
  52. #if defined(OS_ANDROID)
  53. // Enable changing default downloads storage location on Android.
  54. const base::Feature kDownloadsLocationChange{"DownloadsLocationChange",
  55. - base::FEATURE_ENABLED_BY_DEFAULT};
  56. + base::FEATURE_DISABLED_BY_DEFAULT};
  57. #endif
  58. // Show the number of open incognito windows besides incognito icon on the
  59. --
  60. 2.11.0