| 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 30 matching lines...) Expand all Loading... |
| 41 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 41 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 42 #include "chrome/browser/chromeos/settings/cros_settings.h" | 42 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 43 #include "chrome/browser/first_run/first_run.h" | 43 #include "chrome/browser/first_run/first_run.h" |
| 44 #include "chrome/browser/google/google_brand_chromeos.h" | 44 #include "chrome/browser/google/google_brand_chromeos.h" |
| 45 #include "chrome/browser/lifetime/application_lifetime.h" | 45 #include "chrome/browser/lifetime/application_lifetime.h" |
| 46 #include "chrome/browser/net/crl_set_fetcher.h" | 46 #include "chrome/browser/net/crl_set_fetcher.h" |
| 47 #include "chrome/browser/net/nss_context.h" | 47 #include "chrome/browser/net/nss_context.h" |
| 48 #include "chrome/browser/profiles/profile.h" | 48 #include "chrome/browser/profiles/profile.h" |
| 49 #include "chrome/browser/profiles/profile_manager.h" | 49 #include "chrome/browser/profiles/profile_manager.h" |
| 50 #include "chrome/browser/rlz/rlz.h" | 50 #include "chrome/browser/rlz/rlz.h" |
| 51 #include "chrome/browser/signin/account_tracker_service_factory.h" |
| 51 #include "chrome/browser/signin/easy_unlock_service.h" | 52 #include "chrome/browser/signin/easy_unlock_service.h" |
| 52 #include "chrome/browser/signin/signin_manager_factory.h" | 53 #include "chrome/browser/signin/signin_manager_factory.h" |
| 53 #include "chrome/common/chrome_switches.h" | 54 #include "chrome/common/chrome_switches.h" |
| 54 #include "chrome/common/logging_chrome.h" | 55 #include "chrome/common/logging_chrome.h" |
| 55 #include "chrome/common/pref_names.h" | 56 #include "chrome/common/pref_names.h" |
| 56 #include "chromeos/cert_loader.h" | 57 #include "chromeos/cert_loader.h" |
| 57 #include "chromeos/chromeos_switches.h" | 58 #include "chromeos/chromeos_switches.h" |
| 58 #include "chromeos/cryptohome/cryptohome_util.h" | 59 #include "chromeos/cryptohome/cryptohome_util.h" |
| 59 #include "chromeos/dbus/cryptohome_client.h" | 60 #include "chromeos/dbus/cryptohome_client.h" |
| 60 #include "chromeos/dbus/dbus_thread_manager.h" | 61 #include "chromeos/dbus/dbus_thread_manager.h" |
| 61 #include "chromeos/dbus/session_manager_client.h" | 62 #include "chromeos/dbus/session_manager_client.h" |
| 62 #include "chromeos/ime/input_method_manager.h" | 63 #include "chromeos/ime/input_method_manager.h" |
| 63 #include "chromeos/login/user_names.h" | 64 #include "chromeos/login/user_names.h" |
| 64 #include "chromeos/network/portal_detector/network_portal_detector.h" | 65 #include "chromeos/network/portal_detector/network_portal_detector.h" |
| 65 #include "chromeos/network/portal_detector/network_portal_detector_strategy.h" | 66 #include "chromeos/network/portal_detector/network_portal_detector_strategy.h" |
| 66 #include "chromeos/settings/cros_settings_names.h" | 67 #include "chromeos/settings/cros_settings_names.h" |
| 67 #include "components/component_updater/component_updater_service.h" | 68 #include "components/component_updater/component_updater_service.h" |
| 68 #include "components/policy/core/common/cloud/cloud_policy_constants.h" | 69 #include "components/policy/core/common/cloud/cloud_policy_constants.h" |
| 69 #include "components/session_manager/core/session_manager.h" | 70 #include "components/session_manager/core/session_manager.h" |
| 71 #include "components/signin/core/browser/account_tracker_service.h" |
| 70 #include "components/signin/core/browser/signin_manager_base.h" | 72 #include "components/signin/core/browser/signin_manager_base.h" |
| 71 #include "components/user_manager/user.h" | 73 #include "components/user_manager/user.h" |
| 72 #include "components/user_manager/user_manager.h" | 74 #include "components/user_manager/user_manager.h" |
| 73 #include "components/user_manager/user_type.h" | 75 #include "components/user_manager/user_type.h" |
| 74 #include "content/public/browser/browser_thread.h" | 76 #include "content/public/browser/browser_thread.h" |
| 75 #include "content/public/browser/notification_service.h" | 77 #include "content/public/browser/notification_service.h" |
| 76 #include "url/gurl.h" | 78 #include "url/gurl.h" |
| 77 | 79 |
| 78 namespace chromeos { | 80 namespace chromeos { |
| 79 | 81 |
| (...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 722 | 724 |
| 723 if (user_manager::UserManager::Get()->IsLoggedInAsSupervisedUser()) { | 725 if (user_manager::UserManager::Get()->IsLoggedInAsSupervisedUser()) { |
| 724 user_manager::User* active_user = | 726 user_manager::User* active_user = |
| 725 user_manager::UserManager::Get()->GetActiveUser(); | 727 user_manager::UserManager::Get()->GetActiveUser(); |
| 726 std::string supervised_user_sync_id = | 728 std::string supervised_user_sync_id = |
| 727 ChromeUserManager::Get()->GetSupervisedUserManager()->GetUserSyncId( | 729 ChromeUserManager::Get()->GetSupervisedUserManager()->GetUserSyncId( |
| 728 active_user->email()); | 730 active_user->email()); |
| 729 profile->GetPrefs()->SetString(prefs::kSupervisedUserId, | 731 profile->GetPrefs()->SetString(prefs::kSupervisedUserId, |
| 730 supervised_user_sync_id); | 732 supervised_user_sync_id); |
| 731 } else if (user_manager::UserManager::Get()->IsLoggedInAsRegularUser()) { | 733 } else if (user_manager::UserManager::Get()->IsLoggedInAsRegularUser()) { |
| 734 // Prime the account tracker with this combination of gaia id/display email. |
| 735 AccountTrackerService* account_tracker = |
| 736 AccountTrackerServiceFactory::GetForProfile(profile); |
| 737 account_tracker->SeedAccountInfo(user_context.GetGaiaID(), |
| 738 user_context.GetUserID()); |
| 739 |
| 732 // Make sure that the google service username is properly set (we do this | 740 // Make sure that the google service username is properly set (we do this |
| 733 // on every sign in, not just the first login, to deal with existing | 741 // on every sign in, not just the first login, to deal with existing |
| 734 // profiles that might not have it set yet). | 742 // profiles that might not have it set yet). |
| 735 SigninManagerBase* signin_manager = | 743 SigninManagerBase* signin_manager = |
| 736 SigninManagerFactory::GetForProfile(profile); | 744 SigninManagerFactory::GetForProfile(profile); |
| 737 signin_manager->SetAuthenticatedUsername(user_context.GetUserID()); | 745 signin_manager->SetAuthenticatedUsername(user_context.GetUserID()); |
| 738 } | 746 } |
| 739 } | 747 } |
| 740 | 748 |
| 741 void UserSessionManager::UserProfileInitialized(Profile* profile, | 749 void UserSessionManager::UserProfileInitialized(Profile* profile, |
| (...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1146 } | 1154 } |
| 1147 | 1155 |
| 1148 EasyUnlockKeyManager* UserSessionManager::GetEasyUnlockKeyManager() { | 1156 EasyUnlockKeyManager* UserSessionManager::GetEasyUnlockKeyManager() { |
| 1149 if (!easy_unlock_key_manager_) | 1157 if (!easy_unlock_key_manager_) |
| 1150 easy_unlock_key_manager_.reset(new EasyUnlockKeyManager); | 1158 easy_unlock_key_manager_.reset(new EasyUnlockKeyManager); |
| 1151 | 1159 |
| 1152 return easy_unlock_key_manager_.get(); | 1160 return easy_unlock_key_manager_.get(); |
| 1153 } | 1161 } |
| 1154 | 1162 |
| 1155 } // namespace chromeos | 1163 } // namespace chromeos |
| OLD | NEW |