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

Unified Diff: chrome/browser/signin/chrome_signin_client.cc

Issue 1534173003: ChromeOS user_manager: move all KnownUser code to separate file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: s/FindUsingSAML/IsUsingSAML/ Created 5 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/signin/chrome_signin_client.cc
diff --git a/chrome/browser/signin/chrome_signin_client.cc b/chrome/browser/signin/chrome_signin_client.cc
index ba280aa1d911d69baab3f5f0094864b39173467f..69959906c20968022e4bcb1ac7d4a047e1829391 100644
--- a/chrome/browser/signin/chrome_signin_client.cc
+++ b/chrome/browser/signin/chrome_signin_client.cc
@@ -39,6 +39,7 @@
#if defined(OS_CHROMEOS)
#include "chrome/browser/chromeos/net/delay_network_call.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h"
+#include "components/user_manager/known_user.h"
#include "components/user_manager/user_manager.h"
#endif
@@ -63,20 +64,19 @@ ChromeSigninClient::ChromeSigninClient(
chromeos::ProfileHelper::Get()->GetUserByProfile(profile_);
if (!user)
return;
- auto* user_manager = user_manager::UserManager::Get();
const AccountId account_id = user->GetAccountId();
- if (user_manager->GetKnownUserDeviceId(account_id).empty()) {
+ if (user_manager::known_user::GetDeviceId(account_id).empty()) {
const std::string legacy_device_id =
GetPrefs()->GetString(prefs::kGoogleServicesSigninScopedDeviceId);
if (!legacy_device_id.empty()) {
// Need to move device ID from the old location to the new one, if it has
// not been done yet.
- user_manager->SetKnownUserDeviceId(account_id, legacy_device_id);
+ user_manager::known_user::SetDeviceId(account_id, legacy_device_id);
} else {
- user_manager->SetKnownUserDeviceId(
- account_id,
- GenerateSigninScopedDeviceID(
- user_manager->IsUserNonCryptohomeDataEphemeral(account_id)));
+ user_manager::known_user::SetDeviceId(
+ account_id, GenerateSigninScopedDeviceID(
+ user_manager::UserManager::Get()
+ ->IsUserNonCryptohomeDataEphemeral(account_id)));
}
}
GetPrefs()->SetString(prefs::kGoogleServicesSigninScopedDeviceId,
@@ -154,8 +154,7 @@ std::string ChromeSigninClient::GetSigninScopedDeviceId() {
return std::string();
const std::string signin_scoped_device_id =
- user_manager::UserManager::Get()->GetKnownUserDeviceId(
- user->GetAccountId());
+ user_manager::known_user::GetDeviceId(user->GetAccountId());
LOG_IF(ERROR, signin_scoped_device_id.empty())
<< "Device ID is not set for user.";
return signin_scoped_device_id;
« no previous file with comments | « chrome/browser/chromeos/preferences.cc ('k') | chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698