[passwords/desktop] Use sync SelectedTypes as account storage opt-in
See linked bug for the extensive detail and the long term plan.
This CL should cause no observable behavior changes, only the
the underlying pref that stores the opt-in is changed.
Note: Some of the the "per-account opt-in" logic is not unit tested
in PasswordManagerFeaturesUtilTest anymore, as it now lives in
sync code (and there currently isn't a good way to fake it).
It is still covered by a) sync unit tests, b) password integration
tests added in crrev.com/c/5054059.
Bug: 1484531
Change-Id: I56b882ebd0038b0717bc6afdca74374e47d9223d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4874142
Reviewed-by: Marc Treib <[email protected]>
Code-Coverage: [email protected] <[email protected]>
Reviewed-by: Tommy Martino <[email protected]>
Reviewed-by: Mohamed Amir Yosef <[email protected]>
Commit-Queue: Victor Vianna <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1228364}
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
index 9030309..a123b7be 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -2605,6 +2605,12 @@
profile_prefs->ClearPref(kUserGeolocationAllowed);
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
+#if !BUILDFLAG(IS_ANDROID)
+ // Added 11/2023.
+ password_manager::features_util::MigrateOptInPrefToSyncSelectedTypes(
+ profile_prefs);
+#endif // !BUILDFLAG(IS_ANDROID)
+
// Deprecated 11/2023.
profile_prefs->ClearPref(kPasswordChangeSuccessTrackerFlows);
profile_prefs->ClearPref(kPasswordChangeSuccessTrackerVersion);