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

Unified Diff: chrome/browser/ui/views/app_list/app_list_controller_win.cc

Issue 20656002: Add profile selector menu to app list. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 5 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/views/app_list/app_list_controller_win.cc
diff --git a/chrome/browser/ui/views/app_list/app_list_controller_win.cc b/chrome/browser/ui/views/app_list/app_list_controller_win.cc
index 6bbb59584622aa70edee1cbf4d2cc11df805a221..1fa329a02b8d043d8c6c311551720acef19f73e0 100644
--- a/chrome/browser/ui/views/app_list/app_list_controller_win.cc
+++ b/chrome/browser/ui/views/app_list/app_list_controller_win.cc
@@ -268,6 +268,7 @@ class AppListControllerDelegateWin : public AppListControllerDelegate {
virtual void LaunchApp(Profile* profile,
const extensions::Extension* extension,
int event_flags) OVERRIDE;
+ virtual void ShowForProfileAtIndex(size_t index) OVERRIDE;
DISALLOW_COPY_AND_ASSIGN(AppListControllerDelegateWin);
};
@@ -308,6 +309,7 @@ class AppListController : public AppListServiceImpl {
virtual void HandleFirstRun() OVERRIDE;
virtual void Init(Profile* initial_profile) OVERRIDE;
virtual void ShowForProfile(Profile* requested_profile) OVERRIDE;
+ virtual void ShowForProfileAtIndex(size_t index) OVERRIDE;
virtual void DismissAppList() OVERRIDE;
virtual bool IsAppListVisible() const OVERRIDE;
virtual gfx::NativeWindow GetAppListWindow() OVERRIDE;
@@ -425,6 +427,10 @@ bool AppListControllerDelegateWin::CanPin() {
return false;
}
+void AppListControllerDelegateWin::ShowForProfileAtIndex(size_t index) {
+ AppListController::GetInstance()->ShowForProfileAtIndex(index);
+}
+
void AppListControllerDelegateWin::OnShowExtensionPrompt() {
AppListController::GetInstance()->set_can_close(false);
}
@@ -980,6 +986,20 @@ void AppListController::LoadProfileForWarmup() {
weak_factory_.GetWeakPtr()));
}
+void AppListController::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(&AppListController::ShowForProfile,
+ weak_factory_.GetWeakPtr()));
+}
+
} // namespace
namespace chrome {

Powered by Google App Engine
This is Rietveld 408576698