| Index: chrome/browser/ui/webui/options/browser_options_handler.cc
|
| diff --git a/chrome/browser/ui/webui/options/browser_options_handler.cc b/chrome/browser/ui/webui/options/browser_options_handler.cc
|
| index 60b178fdb055465253c424b79c7a89e1eda235d4..8971e86c0144dfce3eb023577de636cf7f956ff8 100644
|
| --- a/chrome/browser/ui/webui/options/browser_options_handler.cc
|
| +++ b/chrome/browser/ui/webui/options/browser_options_handler.cc
|
| @@ -1061,25 +1061,28 @@ scoped_ptr<ListValue> BrowserOptionsHandler::GetProfilesInfoList() {
|
| base::FilePath current_profile_path =
|
| web_ui()->GetWebContents()->GetBrowserContext()->GetPath();
|
|
|
| - for (size_t i = 0, e = cache.GetNumberOfProfiles(); i < e; ++i) {
|
| + const std::vector<ProfileInfoEntry> entries(cache.GetProfilesSortedByName());
|
| + for (std::vector<ProfileInfoEntry>::const_iterator it = entries.begin();
|
| + it != entries.end(); ++it) {
|
| DictionaryValue* profile_value = new DictionaryValue();
|
| - profile_value->SetString("name", cache.GetNameOfProfileAtIndex(i));
|
| - base::FilePath profile_path = cache.GetPathOfProfileAtIndex(i);
|
| +
|
| + profile_value->SetString("name", it->GetDisplayName());
|
| + base::FilePath profile_path = it->path();
|
| profile_value->Set("filePath", base::CreateFilePathValue(profile_path));
|
| profile_value->SetBoolean("isCurrentProfile",
|
| profile_path == current_profile_path);
|
| - profile_value->SetBoolean("isManaged", cache.ProfileIsManagedAtIndex(i));
|
| + profile_value->SetBoolean("isManaged", it->IsManaged());
|
|
|
| bool is_gaia_picture =
|
| - cache.IsUsingGAIAPictureOfProfileAtIndex(i) &&
|
| - cache.GetGAIAPictureOfProfileAtIndex(i);
|
| + it->is_using_GAIA_picture() &&
|
| + cache.GetGAIAPictureOfProfile(it->path());
|
| if (is_gaia_picture) {
|
| gfx::Image icon = profiles::GetAvatarIconForWebUI(
|
| - cache.GetAvatarIconOfProfileAtIndex(i), true);
|
| + cache.GetAvatarIconOfProfile(it->path()), true);
|
| profile_value->SetString("iconURL",
|
| webui::GetBitmapDataUrl(icon.AsBitmap()));
|
| } else {
|
| - size_t icon_index = cache.GetAvatarIconIndexOfProfileAtIndex(i);
|
| + size_t icon_index = it->icon_index();
|
| profile_value->SetString("iconURL",
|
| cache.GetDefaultAvatarIconUrl(icon_index));
|
| }
|
|
|