summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortapted@chromium.org <tapted@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-15 09:42:46 +0000
committertapted@chromium.org <tapted@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-15 09:42:46 +0000
commit4b94d2faa7c5a1d7902f7fa977cf4479a39a9047 (patch)
tree3bbcd701bf8ac1c9a8a2be0640ef26f9c80ff459
parentdb815f390d6eadd5e404b20d28e545923aead2a1 (diff)
downloadchromium_src-4b94d2faa7c5a1d7902f7fa977cf4479a39a9047.zip
chromium_src-4b94d2faa7c5a1d7902f7fa977cf4479a39a9047.tar.gz
chromium_src-4b94d2faa7c5a1d7902f7fa977cf4479a39a9047.tar.bz2
[win] Set the profile path when enabling the app launcher.
On windows, when enabling the app launcher for the first time via the webstore the app launcher is not shown, and if you switch to a different profile and exit the browser before activiating the app launcher for the first time, it can show a different profile. This passes the profile responsible for enabling the app launcher through to platform-specific enabling code, which then ensures the profile path is saved to the local prefs. BUG=259654 TEST=On windows, in a fresh user-data-dir, make two users and leave browser windows open. Install an app from the webstore using the second user after signing in. Close that browser. Close the first browser. Launch the app launcher. Launcher should show the second user, with apps, and not a sign in page for the first user. TBR=xiyuan@chromium.org Review URL: https://chromiumcodereview.appspot.com/18421007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@211624 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/extensions/api/webstore_private/webstore_private_api.cc4
-rw-r--r--chrome/browser/ui/app_list/app_list_service.h2
-rw-r--r--chrome/browser/ui/app_list/app_list_service_disabled.cc2
-rw-r--r--chrome/browser/ui/app_list/app_list_service_mac.mm4
-rw-r--r--chrome/browser/ui/ash/app_list/app_list_service_ash.cc4
-rw-r--r--chrome/browser/ui/views/app_list/app_list_controller_win.cc9
6 files changed, 13 insertions, 12 deletions
diff --git a/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc b/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc
index bb71acf..f64add1 100644
--- a/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc
+++ b/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc
@@ -560,7 +560,7 @@ bool CompleteInstallFunction::RunImpl() {
AddRef();
if (approval_->enable_launcher)
- AppListService::Get()->EnableAppList();
+ AppListService::Get()->EnableAppList(profile());
if (apps::IsAppLauncherEnabled()) {
// Show the app list to show download is progressing. Don't show the app
@@ -616,7 +616,7 @@ EnableAppLauncherFunction::EnableAppLauncherFunction() {}
EnableAppLauncherFunction::~EnableAppLauncherFunction() {}
bool EnableAppLauncherFunction::RunImpl() {
- AppListService::Get()->EnableAppList();
+ AppListService::Get()->EnableAppList(profile());
SendResponse(true);
return true;
}
diff --git a/chrome/browser/ui/app_list/app_list_service.h b/chrome/browser/ui/app_list/app_list_service.h
index 97b8ef6..ebb8f68 100644
--- a/chrome/browser/ui/app_list/app_list_service.h
+++ b/chrome/browser/ui/app_list/app_list_service.h
@@ -60,7 +60,7 @@ class AppListService {
// Enable the app list. What this does specifically will depend on the host
// operating system and shell.
- virtual void EnableAppList() = 0;
+ virtual void EnableAppList(Profile* initial_profile) = 0;
// Get the window the app list is in, or NULL if the app list isn't visible.
virtual gfx::NativeWindow GetAppListWindow() = 0;
diff --git a/chrome/browser/ui/app_list/app_list_service_disabled.cc b/chrome/browser/ui/app_list/app_list_service_disabled.cc
index 8122e97..5b46a16 100644
--- a/chrome/browser/ui/app_list/app_list_service_disabled.cc
+++ b/chrome/browser/ui/app_list/app_list_service_disabled.cc
@@ -37,7 +37,7 @@ class AppListServiceDisabled : public AppListService {
virtual Profile* GetCurrentAppListProfile() OVERRIDE { return NULL; }
virtual bool IsAppListVisible() const OVERRIDE { return false; }
- virtual void EnableAppList() OVERRIDE {}
+ virtual void EnableAppList(Profile* initial_profile) OVERRIDE {}
virtual AppListControllerDelegate* CreateControllerDelegate() OVERRIDE {
return NULL;
diff --git a/chrome/browser/ui/app_list/app_list_service_mac.mm b/chrome/browser/ui/app_list/app_list_service_mac.mm
index d46f663..7ca84f4 100644
--- a/chrome/browser/ui/app_list/app_list_service_mac.mm
+++ b/chrome/browser/ui/app_list/app_list_service_mac.mm
@@ -63,7 +63,7 @@ class AppListServiceMac : public AppListServiceImpl,
virtual void ShowAppList(Profile* requested_profile) OVERRIDE;
virtual void DismissAppList() OVERRIDE;
virtual bool IsAppListVisible() const OVERRIDE;
- virtual void EnableAppList() OVERRIDE;
+ virtual void EnableAppList(Profile* initial_profile) OVERRIDE;
virtual gfx::NativeWindow GetAppListWindow() OVERRIDE;
// AppListServiceImpl override:
@@ -320,7 +320,7 @@ bool AppListServiceMac::IsAppListVisible() const {
return [[window_controller_ window] isVisible];
}
-void AppListServiceMac::EnableAppList() {
+void AppListServiceMac::EnableAppList(Profile* initial_profile) {
// TODO(tapted): Implement enable logic here for OSX.
}
diff --git a/chrome/browser/ui/ash/app_list/app_list_service_ash.cc b/chrome/browser/ui/ash/app_list/app_list_service_ash.cc
index 64ad3fe..4303770 100644
--- a/chrome/browser/ui/ash/app_list/app_list_service_ash.cc
+++ b/chrome/browser/ui/ash/app_list/app_list_service_ash.cc
@@ -31,7 +31,7 @@ class AppListServiceAsh : public AppListServiceImpl {
virtual void ShowAppList(Profile* default_profile) OVERRIDE;
virtual bool IsAppListVisible() const OVERRIDE;
virtual void DismissAppList() OVERRIDE;
- virtual void EnableAppList() OVERRIDE;
+ virtual void EnableAppList(Profile* initial_profile) OVERRIDE;
virtual gfx::NativeWindow GetAppListWindow() OVERRIDE;
DISALLOW_COPY_AND_ASSIGN(AppListServiceAsh);
@@ -59,7 +59,7 @@ void AppListServiceAsh::DismissAppList() {
ash::Shell::GetInstance()->ToggleAppList(NULL);
}
-void AppListServiceAsh::EnableAppList() {}
+void AppListServiceAsh::EnableAppList(Profile* initial_profile) {}
gfx::NativeWindow AppListServiceAsh::GetAppListWindow() {
if (ash::Shell::HasInstance())
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 37568a6..20cc64f 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
@@ -310,7 +310,7 @@ class AppListController : public AppListServiceImpl {
virtual void ShowAppList(Profile* requested_profile) OVERRIDE;
virtual void DismissAppList() OVERRIDE;
virtual bool IsAppListVisible() const OVERRIDE;
- virtual void EnableAppList() OVERRIDE;
+ virtual void EnableAppList(Profile* initial_profile) OVERRIDE;
virtual gfx::NativeWindow GetAppListWindow() OVERRIDE;
virtual AppListControllerDelegate* CreateControllerDelegate() OVERRIDE;
@@ -883,7 +883,7 @@ void AppListController::Init(Profile* initial_profile) {
chrome_launcher_support::UninstallLegacyAppLauncher(
chrome_launcher_support::USER_LEVEL_INSTALLATION);
}
- EnableAppList();
+ EnableAppList(initial_profile);
}
#endif
@@ -895,7 +895,7 @@ void AppListController::Init(Profile* initial_profile) {
MigrateAppLauncherEnabledPref();
if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableAppList))
- EnableAppList();
+ EnableAppList(initial_profile);
if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableAppList))
DisableAppList();
@@ -905,7 +905,8 @@ bool AppListController::IsAppListVisible() const {
return current_view_ && current_view_->GetWidget()->IsVisible();
}
-void AppListController::EnableAppList() {
+void AppListController::EnableAppList(Profile* initial_profile) {
+ SaveProfilePathToLocalState(initial_profile->GetPath());
// Check if the app launcher shortcuts have ever been created before.
// Shortcuts should only be created once. If the user unpins the taskbar
// shortcut, they can restore it by pinning the start menu or desktop