OLD | NEW |
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 "chrome/browser/chromeos/login/session/user_session_manager.h" | 5 #include "chrome/browser/chromeos/login/session/user_session_manager.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
945 SetFirstLoginPrefs(profile, | 945 SetFirstLoginPrefs(profile, |
946 user_context.GetPublicSessionLocale(), | 946 user_context.GetPublicSessionLocale(), |
947 user_context.GetPublicSessionInputMethod()); | 947 user_context.GetPublicSessionInputMethod()); |
948 } | 948 } |
949 | 949 |
950 if (user_manager::UserManager::Get()->IsLoggedInAsSupervisedUser()) { | 950 if (user_manager::UserManager::Get()->IsLoggedInAsSupervisedUser()) { |
951 user_manager::User* active_user = | 951 user_manager::User* active_user = |
952 user_manager::UserManager::Get()->GetActiveUser(); | 952 user_manager::UserManager::Get()->GetActiveUser(); |
953 std::string supervised_user_sync_id = | 953 std::string supervised_user_sync_id = |
954 ChromeUserManager::Get()->GetSupervisedUserManager()->GetUserSyncId( | 954 ChromeUserManager::Get()->GetSupervisedUserManager()->GetUserSyncId( |
955 active_user->email()); | 955 active_user->GetAccountId().GetUserEmail()); |
956 profile->GetPrefs()->SetString(prefs::kSupervisedUserId, | 956 profile->GetPrefs()->SetString(prefs::kSupervisedUserId, |
957 supervised_user_sync_id); | 957 supervised_user_sync_id); |
958 } else if (user_manager::UserManager::Get()-> | 958 } else if (user_manager::UserManager::Get()-> |
959 IsLoggedInAsUserWithGaiaAccount()) { | 959 IsLoggedInAsUserWithGaiaAccount()) { |
960 // Get the Gaia ID from the user context. If it's not available, this may | 960 // Get the Gaia ID from the user context. If it's not available, this may |
961 // not be available when unlocking a previously opened profile, or when | 961 // not be available when unlocking a previously opened profile, or when |
962 // creating a supervised users. However, in these cases the gaia_id should | 962 // creating a supervised users. However, in these cases the gaia_id should |
963 // be already available in the account tracker. | 963 // be already available in the account tracker. |
964 std::string gaia_id = user_context.GetGaiaID(); | 964 std::string gaia_id = user_context.GetGaiaID(); |
965 if (gaia_id.empty()) { | 965 if (gaia_id.empty()) { |
(...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1761 first_run::GoodiesDisplayer::Delete(); | 1761 first_run::GoodiesDisplayer::Delete(); |
1762 } | 1762 } |
1763 | 1763 |
1764 void UserSessionManager::CreateTokenUtilIfMissing() { | 1764 void UserSessionManager::CreateTokenUtilIfMissing() { |
1765 if (!token_handle_util_.get()) | 1765 if (!token_handle_util_.get()) |
1766 token_handle_util_.reset( | 1766 token_handle_util_.reset( |
1767 new TokenHandleUtil(user_manager::UserManager::Get())); | 1767 new TokenHandleUtil(user_manager::UserManager::Get())); |
1768 } | 1768 } |
1769 | 1769 |
1770 } // namespace chromeos | 1770 } // namespace chromeos |
OLD | NEW |