Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3876)

Unified Diff: chrome/browser/automation/testing_automation_provider.cc

Issue 8539043: Refactor ProfileInfoCache (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/background/background_mode_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | chrome/browser/background/background_mode_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698