Chromium Code Reviews| 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 c26a1baf8b17c96543516b4ed8cb081af9b7f8f1..ee2c3c13b70d4583c231987084ed6b6a85baca63 100644 |
| --- a/chrome/browser/ui/app_list/app_list_view_delegate.cc |
| +++ b/chrome/browser/ui/app_list/app_list_view_delegate.cc |
| @@ -6,8 +6,6 @@ |
| #include <stddef.h> |
| -#include <vector> |
| - |
| #include "apps/custom_launcher_page_contents.h" |
| #include "base/callback.h" |
| #include "base/command_line.h" |
| @@ -20,7 +18,8 @@ |
| #include "chrome/browser/apps/scoped_keep_alive.h" |
| #include "chrome/browser/browser_process.h" |
| #include "chrome/browser/chrome_notification_types.h" |
| -#include "chrome/browser/profiles/profile_info_cache.h" |
| +#include "chrome/browser/profiles/profile_attributes_entry.h" |
| +#include "chrome/browser/profiles/profile_attributes_storage.h" |
| #include "chrome/browser/profiles/profile_manager.h" |
| #include "chrome/browser/search/hotword_service.h" |
| #include "chrome/browser/search/hotword_service_factory.h" |
| @@ -107,16 +106,17 @@ void CreateShortcutInWebAppDir( |
| } |
| #endif |
| -void PopulateUsers(const ProfileInfoCache& profile_info, |
| - const base::FilePath& active_profile_path, |
| +void PopulateUsers(const base::FilePath& active_profile_path, |
| app_list::AppListViewDelegate::Users* users) { |
| users->clear(); |
| - const size_t count = profile_info.GetNumberOfProfiles(); |
| - for (size_t i = 0; i < count; ++i) { |
| + std::vector<ProfileAttributesEntry*> entries = g_browser_process-> |
|
lwchkg
2016/01/27 22:37:19
const possible. Will update in the next patch.
|
| + profile_manager()->GetProfileAttributesStorage(). |
| + GetAllProfilesAttributes(); |
|
lwchkg
2016/01/27 22:37:19
Sorting is needed. (Anthony, I need something like
anthonyvd
2016/01/29 15:16:34
I think you're right that all the places that need
lwchkg
2016/01/29 19:01:48
I see. Now I do see why you make a LessThan in you
lwchkg
2016/01/31 16:47:34
I don't know of one here. Anyway, each comparator
|
| + for (const auto& entry : entries) { |
| app_list::AppListViewDelegate::User user; |
| - user.name = profile_info.GetNameOfProfileAtIndex(i); |
| - user.email = profile_info.GetUserNameOfProfileAtIndex(i); |
| - user.profile_path = profile_info.GetPathOfProfileAtIndex(i); |
| + user.name = entry->GetName(); |
| + user.email = entry->GetUserName(); |
| + user.profile_path = entry->GetPath(); |
| user.active = active_profile_path == user.profile_path; |
| users->push_back(user); |
| } |
| @@ -199,7 +199,7 @@ AppListViewDelegate::AppListViewDelegate(AppListControllerDelegate* controller) |
| } |
| } |
| - profile_manager->GetProfileInfoCache().AddObserver(this); |
| + profile_manager->GetProfileAttributesStorage().AddObserver(this); |
| speech_ui_.reset(new app_list::SpeechUIModel); |
| #if defined(GOOGLE_CHROME_BUILD) |
| @@ -225,8 +225,8 @@ AppListViewDelegate::~AppListViewDelegate() { |
| // by a leaky singleton. Essential shutdown work must be done by observing |
| // chrome::NOTIFICATION_APP_TERMINATING. |
| SetProfile(NULL); |
| - g_browser_process->profile_manager()->GetProfileInfoCache().RemoveObserver( |
| - this); |
| + g_browser_process->profile_manager()->GetProfileAttributesStorage(). |
| + RemoveObserver(this); |
| SigninManagerFactory* factory = SigninManagerFactory::GetInstance(); |
| if (factory) |
| @@ -330,9 +330,7 @@ void AppListViewDelegate::SetUpProfileSwitcher() { |
| return; |
| // Populate the app list users. |
| - PopulateUsers(g_browser_process->profile_manager()->GetProfileInfoCache(), |
| - profile_->GetPath(), |
| - &users_); |
| + PopulateUsers(profile_->GetPath(), &users_); |
| FOR_EACH_OBSERVER( |
| app_list::AppListViewDelegateObserver, observers_, OnProfilesChanged()); |