Index: chrome/browser/automation/testing_automation_provider.cc |
diff --git a/chrome/browser/automation/testing_automation_provider.cc b/chrome/browser/automation/testing_automation_provider.cc |
index a3ee2689a3578345ad8a9eca09ccfc7596eb4e46..98332a2b6ca008b3e816a71b064bff2de2b8a711 100644 |
--- a/chrome/browser/automation/testing_automation_provider.cc |
+++ b/chrome/browser/automation/testing_automation_provider.cc |
@@ -1438,18 +1438,17 @@ void TestingAutomationProvider::GetMultiProfileInfo( |
base::DictionaryValue* args, IPC::Message* reply_message) { |
scoped_ptr<DictionaryValue> return_value(new DictionaryValue); |
ProfileManager* profile_manager = g_browser_process->profile_manager(); |
- const ProfileInfoCache& profile_info_cache = |
- profile_manager->GetProfileInfoCache(); |
+ const ProfileInfoCache& cache = profile_manager->GetProfileInfoCache(); |
return_value->SetBoolean("enabled", |
profile_manager->IsMultipleProfilesEnabled()); |
ListValue* profiles = new ListValue; |
- for (size_t index = 0; index < profile_info_cache.GetNumberOfProfiles(); |
- ++index) { |
+ const std::vector<ProfileInfoEntry> entries(cache.GetProfilesSortedByName()); |
+ for (std::vector<ProfileInfoEntry>::const_iterator it = entries.begin(); |
+ it != entries.end(); ++it) { |
DictionaryValue* item = new DictionaryValue; |
- item->SetString("name", profile_info_cache.GetNameOfProfileAtIndex(index)); |
- item->SetString("path", |
- profile_info_cache.GetPathOfProfileAtIndex(index).value()); |
+ item->SetString("name", it->name()); |
+ item->SetString("path", it->path().value()); |
profiles->Append(item); |
} |
return_value->Set("profiles", profiles); |