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

Unified Diff: chrome/browser/chromeos/login/session/user_session_manager.cc

Issue 718673002: New user type introduced. Combines regular and supervised features. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Logical expression fixed. Created 6 years, 1 month 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/chromeos/login/session/user_session_manager.cc
diff --git a/chrome/browser/chromeos/login/session/user_session_manager.cc b/chrome/browser/chromeos/login/session/user_session_manager.cc
index b3a472307735875c70f5c89cb8cf88a207841b58..3c8c0cd3e79a4886685e6150352f56f8a511fcee 100644
--- a/chrome/browser/chromeos/login/session/user_session_manager.cc
+++ b/chrome/browser/chromeos/login/session/user_session_manager.cc
@@ -328,14 +328,14 @@ void UserSessionManager::PerformPostUserLoggedInActions() {
void UserSessionManager::RestoreAuthenticationSession(Profile* user_profile) {
user_manager::UserManager* user_manager = user_manager::UserManager::Get();
- // We need to restore session only for logged in regular (GAIA) users.
+ // We need to restore session only for logged in GAIA (regular) users.
bartfab (slow) 2014/11/27 12:51:50 Nit: As elsewhere, I think we can drop the "regula
// Note: stub user is a special case that is used for tests, running
// linux_chromeos build on dev workstations w/o user_id parameters.
// Stub user is considered to be a regular GAIA user but it has special
// user_id (kStubUser) and certain services like restoring OAuth session are
// explicitly disabled for it.
if (!user_manager->IsUserLoggedIn() ||
- !user_manager->IsLoggedInAsRegularUser() ||
+ !user_manager->IsLoggedInAsUserWithGaiaAccount() ||
user_manager->IsLoggedInAsStub()) {
return;
}
@@ -505,7 +505,7 @@ bool UserSessionManager::RespectLocalePreference(
bool UserSessionManager::NeedsToUpdateEasyUnlockKeys() const {
return EasyUnlockService::IsSignInEnabled() &&
!user_context_.GetUserID().empty() &&
- user_context_.GetUserType() == user_manager::USER_TYPE_REGULAR &&
+ user_manager::User::TypeHasGaiaAccount(user_context_.GetUserType()) &&
user_context_.GetKey() && !user_context_.GetKey()->GetSecret().empty();
}
@@ -599,7 +599,7 @@ void UserSessionManager::OnConnectionTypeChanged(
user_manager::UserManager* user_manager = user_manager::UserManager::Get();
if (type == net::NetworkChangeNotifier::CONNECTION_NONE ||
!user_manager->IsUserLoggedIn() ||
- !user_manager->IsLoggedInAsRegularUser() ||
+ !user_manager->IsLoggedInAsUserWithGaiaAccount() ||
user_manager->IsLoggedInAsStub() || is_running_test) {
return;
}
@@ -744,7 +744,8 @@ void UserSessionManager::InitProfilePreferences(
active_user->email());
profile->GetPrefs()->SetString(prefs::kSupervisedUserId,
supervised_user_sync_id);
- } else if (user_manager::UserManager::Get()->IsLoggedInAsRegularUser()) {
+ } else if (user_manager::UserManager::Get()->
+ IsLoggedInAsUserWithGaiaAccount()) {
// Prime the account tracker with this combination of gaia id/display email.
// Don't do this unless both email and gaia_id are valid. They may not
// be when simply unlocking the profile.
@@ -848,7 +849,7 @@ void UserSessionManager::FinalizePrepareProfile(Profile* profile) {
btl->AddLoginTimeMarker("TPMOwn-End", false);
user_manager::UserManager* user_manager = user_manager::UserManager::Get();
- if (user_manager->IsLoggedInAsRegularUser()) {
+ if (user_manager->IsLoggedInAsUserWithGaiaAccount()) {
SAMLOfflineSigninLimiter* saml_offline_signin_limiter =
SAMLOfflineSigninLimiterFactory::GetForProfile(profile);
if (saml_offline_signin_limiter)
@@ -1205,7 +1206,7 @@ void UserSessionManager::UpdateEasyUnlockKeys(const UserContext& user_context) {
// authenticator.
const user_manager::User* user =
user_manager::UserManager::Get()->FindUser(user_context.GetUserID());
- if (!user || user->GetType() != user_manager::USER_TYPE_REGULAR)
+ if (!user || !user->HasGaiaAccount())
return;
// Bail if |user_context| does not have secret.

Powered by Google App Engine
This is Rietveld 408576698