[Lacros] Save the list of Lacros accounts in local state

This CL adds a new Lacros-only preference that is saved in local state.
This new pref is managed by the AccountProfileMapper class.

The full list of accounts allows Lacros to distinguish between newly
added accounts and "unassigned" accounts that don't belong to any
profile.

This distinction is important to make because Lacros automatically
assigns new accounts to the primary profile if the user has only one
profile. However, Lacros should not automatically add old "unassigned"
accounts to the primary profile.

We could have stored only unassigned accounts instead of a full list of
accounts. However, maintaining a list of unassigned accounts is more
difficult than storing a list of all accounts and there is little
benefit in doing so.

Bug: 1260376
Change-Id: I01fc5601d4d658281eba57f4731d025c3e184f2a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3296028
Reviewed-by: David Roger <[email protected]>
Commit-Queue: Alex Ilin <[email protected]>
Cr-Commit-Position: refs/heads/main@{#945641}
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
index 75c7c35..23b2491d 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -427,6 +427,7 @@
 #endif
 
 #if BUILDFLAG(IS_CHROMEOS_LACROS)
+#include "chrome/browser/lacros/account_manager/account_cache.h"
 #include "chrome/browser/lacros/lacros_prefs.h"
 #include "chrome/browser/lacros/net/proxy_config_service_lacros.h"
 #endif
@@ -1059,6 +1060,7 @@
 #endif
 
 #if BUILDFLAG(IS_CHROMEOS_LACROS)
+  AccountCache::RegisterLocalStatePrefs(registry);
   lacros_prefs::RegisterLocalStatePrefs(registry);
 #endif