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

Side by Side Diff: chrome/browser/chromeos/login/session/user_session_manager.cc

Issue 473153002: Inline sign in extracts gaia id from HTTP header and seeds account tracker (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix one unit test, progress on second Created 6 years, 2 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
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 "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
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
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 // Don't do this unless both email and gaia_id are valid. They may not
736 // be when simply unlocking the profile.
737 if (!user_context.GetGaiaID().empty() &&
738 !user_context.GetUserID().empty()) {
739 AccountTrackerService* account_tracker =
740 AccountTrackerServiceFactory::GetForProfile(profile);
741 account_tracker->SeedAccountInfo(user_context.GetGaiaID(),
742 user_context.GetUserID());
743 }
744
732 // Make sure that the google service username is properly set (we do this 745 // 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 746 // on every sign in, not just the first login, to deal with existing
734 // profiles that might not have it set yet). 747 // profiles that might not have it set yet).
735 SigninManagerBase* signin_manager = 748 SigninManagerBase* signin_manager =
736 SigninManagerFactory::GetForProfile(profile); 749 SigninManagerFactory::GetForProfile(profile);
737 signin_manager->SetAuthenticatedUsername(user_context.GetUserID()); 750 signin_manager->SetAuthenticatedUsername(user_context.GetUserID());
738 } 751 }
739 } 752 }
740 753
741 void UserSessionManager::UserProfileInitialized(Profile* profile, 754 void UserSessionManager::UserProfileInitialized(Profile* profile,
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
1146 } 1159 }
1147 1160
1148 EasyUnlockKeyManager* UserSessionManager::GetEasyUnlockKeyManager() { 1161 EasyUnlockKeyManager* UserSessionManager::GetEasyUnlockKeyManager() {
1149 if (!easy_unlock_key_manager_) 1162 if (!easy_unlock_key_manager_)
1150 easy_unlock_key_manager_.reset(new EasyUnlockKeyManager); 1163 easy_unlock_key_manager_.reset(new EasyUnlockKeyManager);
1151 1164
1152 return easy_unlock_key_manager_.get(); 1165 return easy_unlock_key_manager_.get();
1153 } 1166 }
1154 1167
1155 } // namespace chromeos 1168 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698