[SigninPrefs] Create the main structure for Accounts SigninPrefs

Add a structure that takes care of all the prefs related to accounts.
Accounts are mapped by their GaiaId which is used as the key of the
main dictionary prefs. The account dictionary pref will hold the
specific data prefs that will be populated in a follow up change.

The structure also allows the deletion of those prefs.
This management is expected to be controlled by changes done
through the IdentityManager. Attached those calls to the
GaiaInfoUpdateService as it already listens to most needed calls and
already update the ProfileAttributesStorage.

The creation of the prefs is done in a lazy mode. Prefs dictionary
and pref data are created when the values are set for the first time.
The GaiaIds used to create the prefs are expected to be valid, point
to a valid account in Chrome. Otherwise the pref, even though it will
be created at first, will probably be deleted after a call to
/ListAccount.

The structure could actually be replaced by some free functions since
it is currently not held anywhere or doesn't hold any independent
run time information, but restricting all access to a class scope
allows to maintain a more coupled relation with the different future
usages and allows for easier extension, such as listening to
preference changes for example that might be needed later on.

The code done is very similar to what is already done in SyncPrefs,
however it is not big/complex enough to actually share the code,
which would have made the logic more complex than it is. Also the
underlying need will have different usages, duplicating some simple
parts of the code is acceptable in this case since it is mainly
around container manipulation.

Bug: b:331767195, b:335437309
Change-Id: Ia209e5de1020bfb012d4cdc8ad43b28e3b393b73
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5487922
Reviewed-by: David Roger <[email protected]>
Commit-Queue: Ryan Sultanem <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1293739}
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
index e1186a23..09569ecc 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -166,6 +166,7 @@
 #include "components/segmentation_platform/public/segmentation_platform_service.h"
 #include "components/sessions/core/session_id_generator.h"
 #include "components/signin/public/base/signin_pref_names.h"
+#include "components/signin/public/base/signin_prefs.h"
 #include "components/signin/public/identity_manager/identity_manager.h"
 #include "components/site_engagement/content/site_engagement_service.h"
 #include "components/subresource_filter/content/shared/browser/ruleset_service.h"
@@ -1893,6 +1894,7 @@
       registry);
   SessionStartupPref::RegisterProfilePrefs(registry);
   SharingSyncPreference::RegisterProfilePrefs(registry);
+  SigninPrefs::RegisterProfilePrefs(registry);
   site_engagement::SiteEngagementService::RegisterProfilePrefs(registry);
   supervised_user::RegisterProfilePrefs(registry);
   sync_sessions::SessionSyncPrefs::RegisterProfilePrefs(registry);