| 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 3eda1fd935944b3bcde79644575b06dfb3538368..c0cd6d2a83aa6e26ef17392949cd82bc87b6bbfc 100644
|
| --- a/chrome/browser/chromeos/login/session/user_session_manager.cc
|
| +++ b/chrome/browser/chromeos/login/session/user_session_manager.cc
|
| @@ -86,6 +86,7 @@
|
| #include "chromeos/dbus/dbus_thread_manager.h"
|
| #include "chromeos/dbus/session_manager_client.h"
|
| #include "chromeos/login/auth/stub_authenticator.h"
|
| +#include "chromeos/login/auth/utils.h"
|
| #include "chromeos/login/user_names.h"
|
| #include "chromeos/network/portal_detector/network_portal_detector.h"
|
| #include "chromeos/network/portal_detector/network_portal_detector_strategy.h"
|
| @@ -894,7 +895,7 @@ void UserSessionManager::StartCrosSession() {
|
| BootTimesRecorder* btl = BootTimesRecorder::Get();
|
| btl->AddLoginTimeMarker("StartSession-Start", false);
|
| DBusThreadManager::Get()->GetSessionManagerClient()->StartSession(
|
| - user_context_.GetAccountId().GetUserEmail());
|
| + cryptohome::Identification(user_context_.GetAccountId()).id());
|
| btl->AddLoginTimeMarker("StartSession-End", false);
|
| }
|
|
|
| @@ -1426,13 +1427,16 @@ void UserSessionManager::OnRestoreActiveSessions(
|
| user_manager::UserManager* user_manager = user_manager::UserManager::Get();
|
| DCHECK_EQ(1u, user_manager->GetLoggedInUsers().size());
|
| DCHECK(user_manager->GetActiveUser());
|
| - std::string active_user_id = user_manager->GetActiveUser()->email();
|
| + const std::string active_cryptohome_id =
|
| + cryptohome::Identification(user_manager->GetActiveUser()->GetAccountId())
|
| + .id();
|
|
|
| SessionManagerClient::ActiveSessionsMap::const_iterator it;
|
| for (it = sessions.begin(); it != sessions.end(); ++it) {
|
| - if (active_user_id == it->first)
|
| + if (active_cryptohome_id == it->first)
|
| continue;
|
| - pending_user_sessions_[it->first] = it->second;
|
| + pending_user_sessions_[cryptohome::GetAccountId(
|
| + cryptohome::Identification::FromString(it->first))] = it->second;
|
| }
|
| RestorePendingUserSessions();
|
| }
|
| @@ -1445,13 +1449,12 @@ void UserSessionManager::RestorePendingUserSessions() {
|
| }
|
|
|
| // Get next user to restore sessions and delete it from list.
|
| - SessionManagerClient::ActiveSessionsMap::const_iterator it =
|
| - pending_user_sessions_.begin();
|
| - std::string user_id = it->first;
|
| + PendingUserSessions::const_iterator it = pending_user_sessions_.begin();
|
| + const AccountId account_id = it->first;
|
| std::string user_id_hash = it->second;
|
| - DCHECK(!user_id.empty());
|
| + DCHECK(account_id.is_valid());
|
| DCHECK(!user_id_hash.empty());
|
| - pending_user_sessions_.erase(user_id);
|
| + pending_user_sessions_.erase(account_id);
|
|
|
| // Check that this user is not logged in yet.
|
| user_manager::UserList logged_in_users =
|
| @@ -1461,7 +1464,7 @@ void UserSessionManager::RestorePendingUserSessions() {
|
| it != logged_in_users.end();
|
| ++it) {
|
| const user_manager::User* user = (*it);
|
| - if (user->email() == user_id) {
|
| + if (user->GetAccountId() == account_id) {
|
| user_already_logged_in = true;
|
| break;
|
| }
|
| @@ -1469,7 +1472,7 @@ void UserSessionManager::RestorePendingUserSessions() {
|
| DCHECK(!user_already_logged_in);
|
|
|
| if (!user_already_logged_in) {
|
| - UserContext user_context(AccountId::FromUserEmail(user_id));
|
| + UserContext user_context(account_id);
|
| user_context.SetUserIDHash(user_id_hash);
|
| user_context.SetIsUsingOAuth(false);
|
|
|
|
|