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

Unified Diff: chrome/browser/ui/app_list/app_list_view_delegate.cc

Issue 33753002: Sooper experimental refactoring of the profile info cache. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 7 years, 2 months 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
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);
}
« no previous file with comments | « chrome/browser/ui/app_list/app_list_service_impl.cc ('k') | chrome/browser/ui/sync/one_click_signin_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698