Index: chrome/browser/ui/webui/options/managed_user_import_handler.cc |
diff --git a/chrome/browser/ui/webui/options/managed_user_import_handler.cc b/chrome/browser/ui/webui/options/managed_user_import_handler.cc |
index 85806eb52aee1060024929d78e34beb7a4fac17e..1713b831058285440388e99871961bc16131a9d4 100644 |
--- a/chrome/browser/ui/webui/options/managed_user_import_handler.cc |
+++ b/chrome/browser/ui/webui/options/managed_user_import_handler.cc |
@@ -119,8 +119,12 @@ void ManagedUserImportHandler::SendExistingManagedUsers( |
const ProfileInfoCache& cache = |
g_browser_process->profile_manager()->GetProfileInfoCache(); |
std::set<std::string> managed_user_ids; |
- for (size_t i = 0; i < cache.GetNumberOfProfiles(); ++i) |
- managed_user_ids.insert(cache.GetManagedUserIdOfProfileAtIndex(i)); |
+ |
+ const std::vector<ProfileInfoEntry> entries(cache.GetProfilesSortedByName()); |
+ for (std::vector<ProfileInfoEntry>::const_iterator it = entries.begin(); |
+ it != entries.end(); ++it) { |
+ managed_user_ids.insert(it->managed_user_id()); |
+ } |
ListValue managed_users; |
for (DictionaryValue::Iterator it(*dict); !it.IsAtEnd(); it.Advance()) { |