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

Unified Diff: chromeos/cert_loader.cc

Issue 23684033: Fix device policy recovery on CrOS login (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 3 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 | « chromeos/cert_loader.h ('k') | chromeos/login/login_state.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/cert_loader.cc
diff --git a/chromeos/cert_loader.cc b/chromeos/cert_loader.cc
index 060d4641129dede3f433eeaef353a20beb0e9944..62a4f120429163f863ea89818c087acb374df2e0 100644
--- a/chromeos/cert_loader.cc
+++ b/chromeos/cert_loader.cc
@@ -145,10 +145,14 @@ void CertLoader::MaybeRequestCertificates() {
if (certificates_requested_ || !crypto_task_runner_.get())
return;
- const bool logged_in = LoginState::IsInitialized() ?
- LoginState::Get()->IsUserLoggedIn() : false;
- VLOG(1) << "RequestCertificates: " << logged_in;
- if (!logged_in)
+ if (!LoginState::IsInitialized())
+ return;
+
+ bool request_certificates = LoginState::Get()->IsUserLoggedIn() ||
+ LoginState::Get()->IsInSafeMode();
+
+ VLOG(1) << "RequestCertificates: " << request_certificates;
+ if (!request_certificates)
return;
certificates_requested_ = true;
@@ -159,7 +163,7 @@ void CertLoader::MaybeRequestCertificates() {
tpm_token_state_ = TPM_DISABLED;
// Treat TPM as disabled for guest users since they do not store certs.
- if (LoginState::IsInitialized() && LoginState::Get()->IsGuestUser())
+ if (LoginState::Get()->IsGuestUser())
tpm_token_state_ = TPM_DISABLED;
InitializeTokenAndLoadCertificates();
@@ -387,8 +391,8 @@ void CertLoader::OnCertRemoved(const net::X509Certificate* cert) {
LoadCertificates();
}
-void CertLoader::LoggedInStateChanged(LoginState::LoggedInState state) {
- VLOG(1) << "LoggedInStateChanged: " << state;
+void CertLoader::LoggedInStateChanged() {
+ VLOG(1) << "LoggedInStateChanged";
MaybeRequestCertificates();
}
« no previous file with comments | « chromeos/cert_loader.h ('k') | chromeos/login/login_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698