[EnterprisePill] Moving profile name logic for profile reporting

The profile name is set too early for the profile report. When the
profile is first created the profile name is assigned before policies
are loaded. This causes the profile name to be missing the custom
enterprise label when one is set. Therefore for a newly created profile
the name form reported is GAIAName or GAIAName(DefaultProfileName) if
there is another profile with the same gaia name.

This CL fixes this to only set the profile name after policies have been
loaded and the profile name has been updated in the profile storage
entry.

Bug: 383864949
Change-Id: I1bd60e93cbe92a3a46aa9c4228adc9c0e6756f05
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6223914
Reviewed-by: Owen Min <zmin@chromium.org>
Commit-Queue: Salma Elmahallawy <esalma@google.com>
Cr-Commit-Position: refs/heads/main@{#1414960}
NOKEYCHECK=True
GitOrigin-RevId: c761804affb875748dc5771f4348674221697e19
3 files changed
tree: 130f8d17db7a18ae22632b3f4f8a96efe21e6853
  1. build/
  2. chrome/
  3. components/
  4. google_internal/
  5. intents/
  6. net/
  7. public/
  8. testing/
  9. third_party/
  10. tools/
  11. web/
  12. web_view/
  13. .swift-format
  14. BUILD.gn
  15. COMMON_METADATA
  16. DEPS
  17. DIR_METADATA
  18. features.gni
  19. OWNERS
  20. PRESUBMIT.py
  21. PRESUBMIT_test.py
  22. README.md
README.md

This directory holds code related to Chrome for iOS. See this document for a description of the structure underneath this directory.