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

Unified Diff: chrome/browser/profiles/profile_attributes_entry.cc

Issue 2712883005: Sign out profile when local_state file has been changed. (Closed)
Patch Set: Merge from master Created 3 years, 9 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
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | chrome/browser/profiles/profile_attributes_storage_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_attributes_entry.cc
diff --git a/chrome/browser/profiles/profile_attributes_entry.cc b/chrome/browser/profiles/profile_attributes_entry.cc
index 0d6afba4c8afe8eb32f3b9091eaea9a32a786497..193f85ce44d889eb3d9f151075c2b30a198cf153 100644
--- a/chrome/browser/profiles/profile_attributes_entry.cc
+++ b/chrome/browser/profiles/profile_attributes_entry.cc
@@ -1,19 +1,10 @@
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-//
-#include "chrome/browser/browser_process.h"
+
#include "chrome/browser/profiles/profile_attributes_entry.h"
#include "chrome/browser/profiles/profile_info_cache.h"
-#include "chrome/common/pref_names.h"
-#include "components/prefs/pref_service.h"
-
-namespace {
-bool IsForceSigninEnabled() {
- PrefService* prefs = g_browser_process->local_state();
- return prefs && prefs->GetBoolean(prefs::kForceBrowserSignin);
-}
-} // namespace
+#include "chrome/browser/signin/signin_util.h"
ProfileAttributesEntry::ProfileAttributesEntry()
: profile_info_cache_(nullptr), profile_path_(base::FilePath()) {}
@@ -26,7 +17,7 @@ void ProfileAttributesEntry::Initialize(
DCHECK(profile_path_.empty());
DCHECK(!path.empty());
profile_path_ = path;
- is_force_signin_enabled_ = IsForceSigninEnabled();
+ is_force_signin_enabled_ = signin_util::IsForceSigninEnabled();
if (!IsAuthenticated() && is_force_signin_enabled_)
is_force_signin_profile_locked_ = true;
}
@@ -242,7 +233,10 @@ void ProfileAttributesEntry::SetIsSigninRequired(bool value) {
void ProfileAttributesEntry::LockForceSigninProfile(bool is_lock) {
DCHECK(is_force_signin_enabled_);
+ if (is_force_signin_profile_locked_ == is_lock)
+ return;
is_force_signin_profile_locked_ = is_lock;
+ profile_info_cache_->NotifyIsSigninRequiredChanged(profile_path_);
}
void ProfileAttributesEntry::SetIsEphemeral(bool value) {
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | chrome/browser/profiles/profile_attributes_storage_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698