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

Unified Diff: chrome/browser/ui/webui/signin/user_manager_screen_handler.cc

Issue 694593002: Profile unlock should always use session restore, regardless of system preference. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make startup code more flexible for tests (and cold starts?) Created 6 years, 2 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/webui/signin/user_manager_screen_handler.cc
diff --git a/chrome/browser/ui/webui/signin/user_manager_screen_handler.cc b/chrome/browser/ui/webui/signin/user_manager_screen_handler.cc
index d6096417a17eabab48a673c1dd0f49da81dcff3d..d1bd8047696b952002f69bb36535abbc3030230d 100644
--- a/chrome/browser/ui/webui/signin/user_manager_screen_handler.cc
+++ b/chrome/browser/ui/webui/signin/user_manager_screen_handler.cc
@@ -696,8 +696,6 @@ void UserManagerScreenHandler::ReportAuthenticationResult(
if (success) {
ProfileInfoCache& info_cache =
g_browser_process->profile_manager()->GetProfileInfoCache();
- info_cache.SetProfileSigninRequiredAtIndex(
- authenticating_profile_index_, false);
base::FilePath path = info_cache.GetPathOfProfileAtIndex(
authenticating_profile_index_);
profiles::SwitchToProfile(
@@ -723,6 +721,15 @@ void UserManagerScreenHandler::ReportAuthenticationResult(
void UserManagerScreenHandler::OnBrowserWindowReady(Browser* browser) {
DCHECK(browser);
DCHECK(browser->window());
+
+ // Unlock the profile after browser opens so startup can read the lock bit.
+ // Any necessary authentication must have been successful to reach this point.
+ ProfileInfoCache& info_cache =
+ g_browser_process->profile_manager()->GetProfileInfoCache();
+ size_t index = info_cache.GetIndexOfProfileWithPath(
+ browser->profile()->GetPath());
+ info_cache.SetProfileSigninRequiredAtIndex(index, false);
+
if (url_hash_ == profiles::kUserManagerSelectProfileTaskManager) {
base::MessageLoop::current()->PostTask(
FROM_HERE, base::Bind(&chrome::ShowTaskManager, browser));

Powered by Google App Engine
This is Rietveld 408576698