Changes to `kAutofillWalletImportEnabled`-related code have been done
upstream, which involved moving the flag to a different header, and
namespace. Additional changes were done to other autofill functions
which we merely override to deactivate wallet autofill.
Chromium change:
commit 33cd6f21098bf910194f09ca52b8d31036099d2b
Author: Mikel Astiz <mastiz@chromium.org>
Date: Fri Jul 7 14:10:06 2023 +0000
Move kAutofillWalletImportEnabled into components/sync
No expected behavioral changes, although some of the
observer-notification codepaths are hard to prove.
Motivation: the user preference can only be toggled from Sync settings
and isn't actually any different to other toggles in the same UI
(modulo https://crbug.com/1435431). Most code can be simplified by
moving this pref closer to analogous prefs for other features, under
SyncPrefs.
In this patch, as a first step, the APIs in autofill_prefs.h, namely
`IsPaymentsIntegrationEnabled` and `SetPaymentsIntegrationEnabled` are
replaced with analogous APIs in SyncUserSettings. This is achieved
without actually extending the UserSelectableType enum to make the
patch smaller, but TODOs are added to track follow-up work to unify
things further.
Internally, the pref is handled by SyncPrefs, which now takes ownership
of the pre-existing autofill pref, without data migrations. Data
migrations are planned for the near future due to unrelated reasons, so
the preference name itself will not exist for long (which is desirable
given that it starts with "autofill." and yet the code lives under
sync/).
To support observing changes to the preference, SyncServiceObserver
is extended with a dedicated function. This is rather intrusive and
not desirable in the long term, but it is a convenient way to unblock
the change and minimize the risk for accidental behavioral changes.
Change-Id: I90220ab70fc40cbc61680a05f94aef13ff7667fa
Bug: 1459963