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

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

Issue 2712883005: Sign out profile when local_state file has been changed. (Closed)
Patch Set: fixup Created 3 years, 10 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 cf503a720bc64ec92aed3ba411c417271cfe034f..5415df2a90d4d2fb8034c5da738490f65721ea45 100644
--- a/chrome/browser/ui/webui/signin/user_manager_screen_handler.cc
+++ b/chrome/browser/ui/webui/signin/user_manager_screen_handler.cc
@@ -33,6 +33,7 @@
#include "chrome/browser/profiles/profile_window.h"
#include "chrome/browser/profiles/profiles_state.h"
#include "chrome/browser/signin/local_auth.h"
+#include "chrome/browser/signin/signin_util.h"
#include "chrome/browser/ui/app_list/app_list_service.h"
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/browser_dialogs.h"
@@ -1014,12 +1015,16 @@ void UserManagerScreenHandler::OnBrowserWindowReady(Browser* browser) {
// Unlock the profile after browser opens so startup can read the lock bit.
// Any necessary authentication must have been successful to reach this point.
+ ProfileAttributesEntry* entry = nullptr;
if (!browser->profile()->IsGuestSession()) {
- ProfileAttributesEntry* entry = nullptr;
bool has_entry = g_browser_process->profile_manager()->
GetProfileAttributesStorage().
GetProfileAttributesWithPath(browser->profile()->GetPath(), &entry);
DCHECK(has_entry);
+ // If force sign in is enabled and profile is not signed in, do not close
+ // UserManager and unlock profile.
+ if (signin_util::IsForceSigninEnabled() && !entry->IsAuthenticated())
+ return;
entry->SetIsSigninRequired(false);
}

Powered by Google App Engine
This is Rietveld 408576698