[SyncSetup]: Communicate the sWAA state in settings for syncing users.

This CL implements communicating the sWAA to
|chrome://settings/syncSetup| as part of the friendly settings project.
The sWAA bit will be fetched and shown in the sync section. Its value
depends on the following factors:
1- Data is encrypted with custom passphrase or not. If yes, Google has
no access to the data and can not use history to provide personalized
experience. In that case, sWAA is 'Off'.
2- History sync is On/Off. This pref is set per device which means
history from this device can not be used for personalization. We show
'Off' as well.
2- History recording is enabled/disabled in |Web and Activity| in the Activity
control page. If the user does not have encryption and history sync is On, then
sWAA will be On if history recording is enabled and Off otherwise.

The sWAA can be in one of the following states:
1- Not fetched: On startup, sync is off, feature
|kSyncSetupFriendlySettings| is disabled. In that case, no changes is
reflected in the UI.
2- Fetching: we show a spinner. The request is pretty fast and the
spinner is almost not visible.
3- Failed: If we fail for any reason to fetch the sWAA bit. Also, in
that case no changes to the UI.
4- On: We show sWAA state 'On' + hint to reflect how will this affect
the user experience.
5- Off: We 'Off' + hint to indicate the reason why Google can not use
history to provide personalized experience whether it's because of
encryption or history sync off or history recording toggled off.

To guarantee we show the most up to date value, we refresh sWAA on the
following events: On navigation to page, Sync turned on, Encryption,
History sync toggled, sync pref changes in case we previously failed to
fetch (fetch failures sometimes are due to sync service not active yet)
and page is visible.

Bug: 1035421
Change-Id: I0577b0ff76bfd7d66415416fdfba5f91f4e34316
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1973915
Commit-Queue: Monica Basta <[email protected]>
Reviewed-by: Mihai Sardarescu <[email protected]>
Reviewed-by: Nicolas Ouellet-Payeur <[email protected]>
Reviewed-by: Scott Violet <[email protected]>
Reviewed-by: Dan Beam <[email protected]>
Cr-Commit-Position: refs/heads/master@{#730127}
21 files changed