Index: chrome/browser/ui/app_list/app_list_view_delegate.cc |
diff --git a/chrome/browser/ui/app_list/app_list_view_delegate.cc b/chrome/browser/ui/app_list/app_list_view_delegate.cc |
index 89d54fe7b270bf1803104594e0b9793b2c5e246a..ab6f45b04a0539cc8ced125de36d43e7b1c786b8 100644 |
--- a/chrome/browser/ui/app_list/app_list_view_delegate.cc |
+++ b/chrome/browser/ui/app_list/app_list_view_delegate.cc |
@@ -14,6 +14,7 @@ |
#include "chrome/browser/extensions/extension_service.h" |
#include "chrome/browser/feedback/feedback_util.h" |
#include "chrome/browser/profiles/profile_info_cache.h" |
+#include "chrome/browser/profiles/profile_info_entry.h" |
#include "chrome/browser/profiles/profile_manager.h" |
#include "chrome/browser/ui/app_list/app_list_controller_delegate.h" |
#include "chrome/browser/ui/app_list/extension_app_model_builder.h" |
@@ -59,16 +60,19 @@ void CreateShortcutInWebAppDir( |
void PopulateUsers(const ProfileInfoCache& profile_info, |
const base::FilePath& active_profile_path, |
app_list::AppListModel::Users* users) { |
- const size_t count = profile_info.GetNumberOfProfiles(); |
- for (size_t i = 0; i < count; ++i) { |
- // Don't display managed users. |
- if (profile_info.ProfileIsManagedAtIndex(i)) |
+ |
+ const std::vector<ProfileInfoEntry> entries( |
+ profile_info.GetProfilesSortedByName()); |
+ |
+ for (std::vector<ProfileInfoEntry>::const_iterator it = entries.begin(); |
+ it != entries.end(); ++it) { |
+ if (it->IsManaged()) |
continue; |
app_list::AppListModel::User user; |
- user.name = profile_info.GetNameOfProfileAtIndex(i); |
- user.email = profile_info.GetUserNameOfProfileAtIndex(i); |
- user.profile_path = profile_info.GetPathOfProfileAtIndex(i); |
+ user.name = it->GetDisplayName(); |
+ user.email = it->user_name(); |
+ user.profile_path = it->path(); |
user.active = active_profile_path == user.profile_path; |
users->push_back(user); |
} |