0
Files
src/tools/typescript
Jan Keitel c934e43596 Handle AutofillAI opt-in change in custom handler
Motivation:
- AutofillAI opt-in is a boolean profile pref. However, we also want it
  to be keyed by GAIA id. This is to ensure that the following sequence
  of events works:
  * Profile is signed in with account 1. User opts into AutofillAI.
  * Profile is signed out and signed into account 2.
  * Profile should no longer be opted into AutofillAI.
  * Profile signs out of account 2 and back into account 1.
  * Profile should be opted into AutofillAI again.
- Effectively, this means using a dict pref (hashed GAIA id to bool)
  instead of the existing boolean pref.
- However, the CustomToggleButtonElement does not support that and we
  thus need to write our own pref writing.

This CL therefore introduces a fake pref that the
SettingsToggleButtonElement reads to/writes from and adds an
autofillPrivate API to communicate toggle changes to the native side.

The CL does not yet read/write GAIA-keyed prefs. This will come as a
follow-up CL.

Bug: 404485362
Change-Id: I66f42b4ef61c76572c58dc40429f5c28d31fb38d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6375245
Reviewed-by: Tim <tjudkins@chromium.org>
Commit-Queue: Justin Lulejian <jlulejian@chromium.org>
Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org>
Reviewed-by: Justin Lulejian <jlulejian@chromium.org>
Reviewed-by: Theo Cristea <theocristea@google.com>
Auto-Submit: Jan Keitel <jkeitel@google.com>
Cr-Commit-Position: refs/heads/main@{#1436261}
2025-03-21 13:36:22 -07:00
..