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

Side by Side Diff: chromeos/tpm_token_loader.cc

Issue 450363002: Simplify LoginState methods. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Check that retail mode is not used. Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chromeos/login/login_state.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chromeos/tpm_token_loader.h" 5 #include "chromeos/tpm_token_loader.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 bool start_initialization = LoginState::Get()->IsUserLoggedIn(); 133 bool start_initialization = LoginState::Get()->IsUserLoggedIn();
134 134
135 VLOG(1) << "StartTokenInitialization: " << start_initialization; 135 VLOG(1) << "StartTokenInitialization: " << start_initialization;
136 if (!start_initialization) 136 if (!start_initialization)
137 return; 137 return;
138 138
139 if (!base::SysInfo::IsRunningOnChromeOS()) 139 if (!base::SysInfo::IsRunningOnChromeOS())
140 tpm_token_state_ = TPM_DISABLED; 140 tpm_token_state_ = TPM_DISABLED;
141 141
142 // Treat TPM as disabled for guest users since they do not store certs. 142 // Treat TPM as disabled for guest users since they do not store certs.
143 if (LoginState::Get()->IsGuestUser()) 143 if (LoginState::Get()->IsGuestSessionUser() ||
144 LoginState::Get()->IsPublicSessionUser()) {
144 tpm_token_state_ = TPM_DISABLED; 145 tpm_token_state_ = TPM_DISABLED;
146 }
145 147
146 ContinueTokenInitialization(); 148 ContinueTokenInitialization();
147 149
148 DCHECK_NE(tpm_token_state_, TPM_STATE_UNKNOWN); 150 DCHECK_NE(tpm_token_state_, TPM_STATE_UNKNOWN);
149 } 151 }
150 152
151 void TPMTokenLoader::ContinueTokenInitialization() { 153 void TPMTokenLoader::ContinueTokenInitialization() {
152 CHECK(thread_checker_.CalledOnValidThread()); 154 CHECK(thread_checker_.CalledOnValidThread());
153 VLOG(1) << "ContinueTokenInitialization: " << tpm_token_state_; 155 VLOG(1) << "ContinueTokenInitialization: " << tpm_token_state_;
154 156
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 void TPMTokenLoader::NotifyTPMTokenReady() { 285 void TPMTokenLoader::NotifyTPMTokenReady() {
284 FOR_EACH_OBSERVER(Observer, observers_, OnTPMTokenReady()); 286 FOR_EACH_OBSERVER(Observer, observers_, OnTPMTokenReady());
285 } 287 }
286 288
287 void TPMTokenLoader::LoggedInStateChanged() { 289 void TPMTokenLoader::LoggedInStateChanged() {
288 VLOG(1) << "LoggedInStateChanged"; 290 VLOG(1) << "LoggedInStateChanged";
289 MaybeStartTokenInitialization(); 291 MaybeStartTokenInitialization();
290 } 292 }
291 293
292 } // namespace chromeos 294 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/login/login_state.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698