Index: chrome/browser/chromeos/login/fake_login_utils.cc |
diff --git a/chrome/browser/chromeos/login/fake_login_utils.cc b/chrome/browser/chromeos/login/fake_login_utils.cc |
index 55f5114bee36d07d823494d617ec643fc543a010..e25740ce2cb6c4d9910b612501942dc3c65afe15 100644 |
--- a/chrome/browser/chromeos/login/fake_login_utils.cc |
+++ b/chrome/browser/chromeos/login/fake_login_utils.cc |
@@ -16,11 +16,13 @@ |
#include "chrome/browser/chromeos/profiles/profile_helper.h" |
#include "chrome/browser/first_run/first_run.h" |
#include "chrome/browser/profiles/profile.h" |
+#include "chrome/browser/signin/signin_manager_factory.h" |
#include "chrome/browser/ui/startup/startup_browser_creator.h" |
#include "chrome/common/pref_names.h" |
#include "chrome/test/base/testing_profile.h" |
#include "chromeos/login/auth/mock_authenticator.h" |
#include "chromeos/login/auth/user_context.h" |
+#include "components/signin/core/browser/signin_manager.h" |
#include "components/user_manager/user.h" |
#include "components/user_manager/user_manager.h" |
#include "content/public/browser/notification_service.h" |
@@ -71,8 +73,8 @@ void FakeLoginUtils::PrepareProfile(const UserContext& user_context, |
// Make sure that we get the real Profile instead of the login Profile. |
user->set_profile_is_created(); |
Profile* profile = ProfileHelper::Get()->GetProfileByUserUnsafe(user); |
- profile->GetPrefs()->SetString(prefs::kGoogleServicesUsername, |
- user_context.GetUserID()); |
+ SigninManagerFactory::GetForProfile(profile)->SetAuthenticatedUsername( |
+ user_context.GetUserID()); |
if (user_manager->IsLoggedInAsSupervisedUser()) { |
user_manager::User* active_user = user_manager->GetActiveUser(); |