privacy-hub: Convert `kUserGeolocationAllowed` to tri-state
Change boolean `kUserGeolocationAllowed` preference to an enum pref with
the following values: {Allowed, Only allowed for system services,
Blocked for all}. Adapt System, ARC++ and Browser code to respect the
new values.
Bug: b:298166777
Change-Id: I93d9da15b73de6e3ef3c9559cf4af5f706c03996
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5002166
Reviewed-by: Jorge Lucangeli Obes <[email protected]>
Reviewed-by: James Cook <[email protected]>
Commit-Queue: Jorge Lucangeli Obes <[email protected]>
Auto-Submit: Zauri Meshveliani <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1224504}
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
index 24bebc8..73cab9b 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -953,7 +953,12 @@
constexpr char kNightLightCachedLatitude[] = "ash.night_light.cached_latitude";
constexpr char kNightLightCachedLongitude[] =
"ash.night_light.cached_longitude";
-#endif
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
+
+// Deprecated 11/2023
+#if BUILDFLAG(IS_CHROMEOS_ASH)
+constexpr char kUserGeolocationAllowed[] = "ash.user.geolocation_allowed";
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
// Deprecated 11/2023.
const char kPrivacySandboxAntiAbuseInitialized[] =
@@ -1370,6 +1375,11 @@
#if BUILDFLAG(IS_CHROMEOS_ASH)
registry->RegisterBooleanPref(kSystemTrayExpanded, true);
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
+
+// Deprecated 11/2023
+#if BUILDFLAG(IS_CHROMEOS_ASH)
+ registry->RegisterBooleanPref(kUserGeolocationAllowed, true);
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
}
void ClearSyncRequestedPrefAndMaybeMigrate(PrefService* profile_prefs) {
@@ -2565,6 +2575,11 @@
profile_prefs->ClearPref(kSystemTrayExpanded);
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
+#if BUILDFLAG(IS_CHROMEOS_ASH)
+ // Added 11/2023
+ profile_prefs->ClearPref(kUserGeolocationAllowed);
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
+
// Please don't delete the following line. It is used by PRESUBMIT.py.
// END_MIGRATE_OBSOLETE_PROFILE_PREFS