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

Unified Diff: chrome/browser/ui/app_list/app_list_service_mac.mm

Issue 856733004: Loading the Launcher with a Locked Profile launched UserManager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: UserManager goes to AppLauncher after startup if flag present Created 5 years, 11 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_service_mac.mm
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 bb486127f1c829477a5f64beaceed8af02a97c3f..1d2782d1825cf3a07982d69705d97490692a9460 100644
--- a/chrome/browser/ui/app_list/app_list_service_mac.mm
+++ b/chrome/browser/ui/app_list/app_list_service_mac.mm
@@ -17,6 +17,7 @@
#import "chrome/browser/app_controller_mac.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/extensions/extension_service.h"
+#include "chrome/browser/profiles/profile_info_cache.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/app_list/app_list_controller_delegate_impl.h"
#include "chrome/browser/ui/app_list/app_list_positioner.h"
@@ -337,6 +338,12 @@ void AppListServiceMac::FindAnchorPoint(const gfx::Size& window_size,
}
void AppListServiceMac::Init(Profile* initial_profile) {
+ InitWithProfilePath(initial_profile, initial_profile->GetPath());
+}
+
+void AppListServiceMac::InitWithProfilePath(
+ Profile* initial_profile,
+ const base::FilePath& profile_path) {
// On Mac, Init() is called multiple times for a process: any time there is no
// browser window open and a new window is opened, and during process startup
// to handle the silent launch case (e.g. for app shims). In the startup case,
@@ -371,8 +378,16 @@ void AppListServiceMac::Init(Profile* initial_profile) {
// OnShimLaunch(). Note that if --silent-launch is not also passed, the window
// will instead populate via StartupBrowserCreator::Launch(). Shim-initiated
// launches will always have --silent-launch.
- if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kShowAppList))
- ShowWindowNearDock();
+ if (base::CommandLine::ForCurrentProcess()->
+ HasSwitch(switches::kShowAppList)) {
+ // Do not show the launcher window when the profile is locked.
+ const ProfileInfoCache& profile_info_cache =
+ g_browser_process->profile_manager()->GetProfileInfoCache();
+ int profile_index = profile_info_cache.
+ GetIndexOfProfileWithPath(profile_path);
+ if (!profile_info_cache.ProfileIsSigninRequiredAtIndex(profile_index))
xiyuan 2015/01/16 20:31:52 Can we use IsProfileLocked() here?
Mike Lerman 2015/01/19 21:08:56 I could I suppose, if I had a ProfileStore. I don'
+ ShowWindowNearDock();
+ }
}
Profile* AppListServiceMac::GetCurrentAppListProfile() {
@@ -530,8 +545,10 @@ AppListService* AppListService::Get(chrome::HostDesktopType desktop_type) {
}
// static
-void AppListService::InitAll(Profile* initial_profile) {
- AppListServiceMac::GetInstance()->Init(initial_profile);
+void AppListService::InitAll(Profile* initial_profile,
+ const base::FilePath& profile_path) {
+ AppListServiceMac::GetInstance()->InitWithProfilePath(initial_profile,
+ profile_path);
}
@implementation AppListAnimationController

Powered by Google App Engine
This is Rietveld 408576698