Index: chrome/browser/ui/app_list/app_list_service_impl.cc |
diff --git a/chrome/browser/ui/app_list/app_list_service_impl.cc b/chrome/browser/ui/app_list/app_list_service_impl.cc |
index 8054e8753103c4099deae6845ff5516775996d2f..d4920ef2aef2804201936ac3148fbef1e5ee1b61 100644 |
--- a/chrome/browser/ui/app_list/app_list_service_impl.cc |
+++ b/chrome/browser/ui/app_list/app_list_service_impl.cc |
@@ -17,6 +17,7 @@ |
#include "chrome/common/pref_names.h" |
#include "content/public/browser/browser_thread.h" |
#include "content/public/browser/notification_details.h" |
+#include "content/public/browser/notification_service.h" |
#include "content/public/browser/notification_source.h" |
namespace { |
@@ -199,6 +200,8 @@ void AppListServiceImpl::SetProfile(Profile* new_profile) { |
if (!profile_) |
return; |
+ registrar_.Add(this, chrome::NOTIFICATION_PROFILE_CACHED_INFO_CHANGED, |
+ content::NotificationService::AllSources()); |
registrar_.Add(this, chrome::NOTIFICATION_GOOGLE_SIGNIN_SUCCESSFUL, |
content::Source<Profile>(profile_)); |
registrar_.Add(this, chrome::NOTIFICATION_GOOGLE_SIGNIN_FAILED, |
@@ -211,6 +214,20 @@ void AppListServiceImpl::InvalidatePendingProfileLoads() { |
profile_loader_.InvalidatePendingProfileLoads(); |
} |
+void AppListServiceImpl::ShowForProfileAtIndex(size_t index) { |
+ ProfileManager* profile_manager = g_browser_process->profile_manager(); |
+ ProfileInfoCache& cache = profile_manager->GetProfileInfoCache(); |
+ if (index >= cache.GetNumberOfProfiles()) { |
+ NOTREACHED(); |
+ return; |
+ } |
+ base::FilePath profile_path = cache.GetPathOfProfileAtIndex(index); |
+ profile_loader().LoadProfileInvalidatingOtherLoads( |
+ profile_path, |
+ base::Bind(&AppListServiceImpl::ShowForProfile, |
+ weak_factory_.GetWeakPtr())); |
+} |
+ |
void AppListServiceImpl::HandleCommandLineFlags(Profile* initial_profile) { |
if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableAppList)) |
EnableAppList(initial_profile); |