crostini: Remove Duplicate Container Names in Prefs

Currently, duplicate container names may be displayed when
MultiCrostiniContainers flag is enabled.

These duplicate names are removed when browser preferences
are initially loaded


Fixed: chromium:1298250

Change-Id: Ifb221c69754b1dce1aa29d544c5ac05eb00607a6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3469539
Reviewed-by: Timothy Loh <[email protected]>
Reviewed-by: Dominic Battré <[email protected]>
Reviewed-by: Joel Hockey <[email protected]>
Commit-Queue: Sophia Lin <[email protected]>
Cr-Commit-Position: refs/heads/main@{#973420}
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
index dfdaa5e..ad54eae7 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -305,6 +305,7 @@
 #include "chrome/browser/ash/crosapi/browser_util.h"
 #include "chrome/browser/ash/crosapi/network_settings_service_ash.h"
 #include "chrome/browser/ash/crostini/crostini_pref_names.h"
+#include "chrome/browser/ash/crostini/crostini_util.h"
 #include "chrome/browser/ash/cryptauth/client_app_metadata_provider_service.h"
 #include "chrome/browser/ash/cryptauth/cryptauth_device_id_provider_impl.h"
 #include "chrome/browser/ash/customization/customization_document.h"
@@ -1874,6 +1875,12 @@
   profile_prefs->ClearPref(kPhoneHubCameraRollPendingStatePrefName);
 #endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
+#if BUILDFLAG(IS_CHROMEOS_ASH)
+  // Added 02/2022.
+  // TODO(crbug.com/1298250): Remove after M107.
+  crostini::RemoveDuplicateContainerEntries(profile_prefs);
+#endif
+
   // Please don't delete the following line. It is used by PRESUBMIT.py.
   // END_MIGRATE_OBSOLETE_PROFILE_PREFS