iwa: Check and Observe Ash pref to enable/disable IWA installer
This CL allows Isolated Web App installer to keep track of the ash pref
to enable/disable the installer. The pref observer is implemented for
both Lacros and Ash browsers.
For Lacros, a new PrefPath is defined in crosapi::prefs.mojom.
ash::prefs::kIsolatedWebAppsEnabled is profile dependent, therefore, We
are moving the pref from a local_state pref to a user profile pref.
Change-Id: Icd6b1669a0f2647777bc8a73d8eb9917c6c7fb1e
Bug: 1479140
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5018184
Reviewed-by: Robbie McElrath <[email protected]>
Reviewed-by: Hidehiko Abe <[email protected]>
Commit-Queue: Zelin Liu <[email protected]>
Reviewed-by: Gabriel Charette <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1238802}
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
index 3bb3c80..86a09cf 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -956,6 +956,11 @@
constexpr char kDownloadDuplicateFilePromptEnabled[] =
"download_duplicate_file_prompt_enabled";
+// Deprecated 12/2023.
+#if BUILDFLAG(IS_CHROMEOS_ASH)
+constexpr char kIsolatedWebAppsEnabled[] = "ash.isolated_web_apps_enabled";
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
+
// Register local state used only for migration (clearing or moving to a new
// key).
void RegisterLocalStatePrefsForMigration(PrefRegistrySimple* registry) {
@@ -1071,6 +1076,11 @@
#if BUILDFLAG(IS_CHROMEOS_ASH)
registry->RegisterBooleanPref(kGestureEducationNotificationShown, true);
#endif
+
+ // Deprecated 11/2023.
+#if BUILDFLAG(IS_CHROMEOS_ASH)
+ registry->RegisterBooleanPref(kIsolatedWebAppsEnabled, false);
+#endif
}
// Register prefs used only for migration (clearing or moving to a new key).
@@ -2213,6 +2223,11 @@
local_state->ClearPref(kGestureEducationNotificationShown);
#endif
+// Added 11/2023.
+#if BUILDFLAG(IS_CHROMEOS_ASH)
+ local_state->ClearPref(kIsolatedWebAppsEnabled);
+#endif
+
// Please don't delete the following line. It is used by PRESUBMIT.py.
// END_MIGRATE_OBSOLETE_LOCAL_STATE_PREFS