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

Unified Diff: chrome/browser/chromeos/login/fake_login_utils.cc

Issue 763673002: Replace direct access to kGoogleServicesUsername with calls to SigninManager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nullptr Created 6 years 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 side-by-side diff with in-line comments
Download patch
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();
« no previous file with comments | « chrome/browser/chromeos/file_manager/file_manager_browsertest.cc ('k') | chrome/browser/chromeos/login/kiosk_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698