Commit d42dfa92 authored by Sergio Villar Senin's avatar Sergio Villar Senin Committed by Commit Bot

Convert OAuth2LoginManager away from SigninManager

Replace the usage of SigninManager API by IdentityManager's.

Bug: 905281
Change-Id: I64453935c4312eeaf1f42c770aa01d16b6238730
Reviewed-on: https://chromium-review.googlesource.com/c/1337615
Commit-Queue: Sergio Villar <svillar@igalia.com>
Reviewed-by: default avatarSylvain Defresne <sdefresne@chromium.org>
Reviewed-by: default avatarAchuith Bhandarkar <achuith@chromium.org>
Cr-Commit-Position: refs/heads/master@{#608724}
parent 90db8cbd
...@@ -12,16 +12,15 @@ ...@@ -12,16 +12,15 @@
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/browser/signin/chrome_device_id_helper.h" #include "chrome/browser/signin/chrome_device_id_helper.h"
#include "chrome/browser/signin/gaia_cookie_manager_service_factory.h" #include "chrome/browser/signin/gaia_cookie_manager_service_factory.h"
#include "chrome/browser/signin/identity_manager_factory.h"
#include "chrome/browser/signin/profile_oauth2_token_service_factory.h" #include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
#include "chrome/browser/signin/signin_manager_factory.h"
#include "chromeos/chromeos_switches.h" #include "chromeos/chromeos_switches.h"
#include "components/account_id/account_id.h" #include "components/account_id/account_id.h"
#include "components/signin/core/browser/profile_oauth2_token_service.h" #include "components/signin/core/browser/profile_oauth2_token_service.h"
#include "components/signin/core/browser/signin_client.h"
#include "components/signin/core/browser/signin_manager.h"
#include "components/user_manager/user_manager.h" #include "components/user_manager/user_manager.h"
#include "google_apis/gaia/gaia_auth_util.h" #include "google_apis/gaia/gaia_auth_util.h"
#include "google_apis/gaia/gaia_urls.h" #include "google_apis/gaia/gaia_urls.h"
#include "services/identity/public/cpp/identity_manager.h"
#include "services/network/public/cpp/shared_url_loader_factory.h" #include "services/network/public/cpp/shared_url_loader_factory.h"
namespace chromeos { namespace chromeos {
...@@ -163,10 +162,9 @@ ProfileOAuth2TokenService* OAuth2LoginManager::GetTokenService() { ...@@ -163,10 +162,9 @@ ProfileOAuth2TokenService* OAuth2LoginManager::GetTokenService() {
} }
std::string OAuth2LoginManager::GetPrimaryAccountId() { std::string OAuth2LoginManager::GetPrimaryAccountId() {
SigninManagerBase* signin_manager =
SigninManagerFactory::GetForProfile(user_profile_);
const std::string primary_account_id = const std::string primary_account_id =
signin_manager->GetAuthenticatedAccountId(); IdentityManagerFactory::GetForProfile(user_profile_)
->GetPrimaryAccountId();
LOG_IF(ERROR, primary_account_id.empty()) << "Primary account id is empty."; LOG_IF(ERROR, primary_account_id.empty()) << "Primary account id is empty.";
return primary_account_id; return primary_account_id;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment