Commit 027059d8 authored by Owen Min's avatar Owen Min Committed by Commit Bot

Check if |lastProfile| is a guest profile when execute menu Items.

When user picks a menu item without key window, show UserManager if
the |lastProfile| is a guest profile and guest mode is disabled.

Bug: 820649
Change-Id: I6e20446de0b89a25e37c4d8aaa48a943878fd0c8
Reviewed-on: https://chromium-review.googlesource.com/959627Reviewed-by: default avatarRobert Sesek <rsesek@chromium.org>
Commit-Queue: Owen Min <zmin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#542936}
parent 747a959e
...@@ -1044,10 +1044,14 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; ...@@ -1044,10 +1044,14 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session;
NSInteger tag = [sender tag]; NSInteger tag = [sender tag];
// If there are no browser windows, and we are trying to open a browser // If there are no browser windows, and we are trying to open a browser
// for a locked profile or the system profile, we have to show the User // for a locked profile or the system profile or the guest profile but
// Manager instead as the locked profile needs authentication and the system // guest mode is disabled, we have to show the User Manager instead as the
// profile cannot have a browser. // locked profile needs authentication and the system profile cannot have a
if (IsProfileSignedOut(lastProfile) || lastProfile->IsSystemProfile()) { // browser.
const PrefService* prefService = g_browser_process->local_state();
if (IsProfileSignedOut(lastProfile) || lastProfile->IsSystemProfile() ||
(lastProfile->IsGuestSession() && prefService &&
!prefService->GetBoolean(prefs::kBrowserGuestModeEnabled))) {
UserManager::Show(base::FilePath(), UserManager::Show(base::FilePath(),
profiles::USER_MANAGER_SELECT_PROFILE_NO_ACTION); profiles::USER_MANAGER_SELECT_PROFILE_NO_ACTION);
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment