Commit 2b8d7478 authored by Colin Blundell's avatar Colin Blundell Committed by Commit Bot

[GCM] Port AccountTracker to use IdentityManager

This CL completes the conversion of GCM's production code to talk
to IdentityManager rather than legacy signin classes by converting
AccountTracker. The GCMAccountTracker unittest remains to be fully
converted away from the legacy signin classes; this will be done in a
followup CL.

TBR=rohitrao@chromium.org, rockot@chromium.org

Bug: 809923
Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: I1513b33850f52b532d83ac389a78464b68ed1a45
Reviewed-on: https://chromium-review.googlesource.com/1148200Reviewed-by: default avatarKen Rockot <rockot@chromium.org>
Reviewed-by: default avatarPeter Beverloo <peter@chromium.org>
Commit-Queue: Colin Blundell <blundell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#580101}
parent 71ccff62
......@@ -34,8 +34,6 @@
#include "chrome/browser/gcm/gcm_profile_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/signin/identity_manager_factory.h"
#include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
#include "chrome/browser/signin/signin_manager_factory.h"
#include "chrome/common/channel_info.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/test/base/testing_profile.h"
......@@ -46,7 +44,6 @@
#include "components/gcm_driver/gcm_driver.h"
#include "components/gcm_driver/gcm_profile_service.h"
#include "components/keyed_service/core/keyed_service.h"
#include "components/signin/core/browser/signin_manager.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/storage_partition.h"
......@@ -216,8 +213,6 @@ class ExtensionGCMAppHandlerTest : public testing::Test {
chrome::GetChannel(),
gcm::GetProductCategoryForSubtypes(profile->GetPrefs()),
IdentityManagerFactory::GetForProfile(profile),
SigninManagerFactory::GetForProfile(profile),
ProfileOAuth2TokenServiceFactory::GetForProfile(profile),
base::WrapUnique(new gcm::FakeGCMClientFactory(ui_thread, io_thread)),
ui_thread, io_thread, blocking_task_runner);
}
......
......@@ -11,12 +11,9 @@
#include "chrome/browser/profiles/incognito_helpers.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/signin/identity_manager_factory.h"
#include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
#include "chrome/browser/signin/signin_manager_factory.h"
#include "components/gcm_driver/gcm_profile_service.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
#include "components/offline_pages/buildflags/buildflags.h"
#include "components/signin/core/browser/signin_manager.h"
#include "content/public/browser/browser_thread.h"
#if !defined(OS_ANDROID)
......@@ -59,8 +56,6 @@ GCMProfileServiceFactory::GCMProfileServiceFactory()
"GCMProfileService",
BrowserContextDependencyManager::GetInstance()) {
DependsOn(IdentityManagerFactory::GetInstance());
DependsOn(SigninManagerFactory::GetInstance());
DependsOn(ProfileOAuth2TokenServiceFactory::GetInstance());
#if BUILDFLAG(ENABLE_OFFLINE_PAGES)
DependsOn(offline_pages::PrefetchServiceFactory::GetInstance());
#endif // BUILDFLAG(ENABLE_OFFLINE_PAGES)
......@@ -90,8 +85,6 @@ KeyedService* GCMProfileServiceFactory::BuildServiceInstanceFor(
chrome::GetChannel(),
gcm::GetProductCategoryForSubtypes(profile->GetPrefs()),
IdentityManagerFactory::GetForProfile(profile),
SigninManagerFactory::GetForProfile(profile),
ProfileOAuth2TokenServiceFactory::GetForProfile(profile),
std::unique_ptr<GCMClientFactory>(new GCMClientFactory),
content::BrowserThread::GetTaskRunnerForThread(
content::BrowserThread::UI),
......
......@@ -16,8 +16,6 @@
#include "chrome/browser/gcm/gcm_product_util.h"
#include "chrome/browser/gcm/gcm_profile_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/signin_manager_factory.h"
#include "chrome/common/channel_info.h"
#include "chrome/test/base/testing_profile.h"
#include "components/gcm_driver/gcm_profile_service.h"
......@@ -31,7 +29,6 @@
#include "components/gcm_driver/gcm_client_factory.h"
#include "components/gcm_driver/gcm_driver.h"
#include "components/pref_registry/pref_registry_syncable.h"
#include "components/signin/core/browser/signin_manager.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/storage_partition.h"
......@@ -59,8 +56,6 @@ std::unique_ptr<KeyedService> BuildGCMProfileService(
chrome::GetChannel(),
gcm::GetProductCategoryForSubtypes(profile->GetPrefs()),
IdentityManagerFactory::GetForProfile(profile),
SigninManagerFactory::GetForProfile(profile),
ProfileOAuth2TokenServiceFactory::GetForProfile(profile),
std::unique_ptr<gcm::GCMClientFactory>(new gcm::FakeGCMClientFactory(
content::BrowserThread::GetTaskRunnerForThread(
content::BrowserThread::UI),
......
......@@ -57,7 +57,6 @@ static_library("gcm_driver") {
"//components/os_crypt",
"//components/pref_registry",
"//components/prefs",
"//components/signin/core/browser",
"//components/sync",
"//components/version_info",
"//google_apis",
......
......@@ -8,21 +8,17 @@
#include "base/memory/ptr_util.h"
#include "base/stl_util.h"
#include "base/trace_event/trace_event.h"
#include "components/signin/core/browser/profile_oauth2_token_service.h"
#include "net/url_request/url_request_context_getter.h"
namespace gcm {
AccountTracker::AccountTracker(
SigninManagerBase* signin_manager,
ProfileOAuth2TokenService* token_service,
identity::IdentityManager* identity_manager,
net::URLRequestContextGetter* request_context_getter)
: signin_manager_(signin_manager),
token_service_(token_service),
: identity_manager_(identity_manager),
request_context_getter_(request_context_getter),
shutdown_called_(false) {
signin_manager_->AddObserver(this);
token_service_->AddObserver(this);
identity_manager_->AddObserver(this);
}
AccountTracker::~AccountTracker() {
......@@ -32,8 +28,7 @@ AccountTracker::~AccountTracker() {
void AccountTracker::Shutdown() {
shutdown_called_ = true;
user_info_requests_.clear();
token_service_->RemoveObserver(this);
signin_manager_->RemoveObserver(this);
identity_manager_->RemoveObserver(this);
}
bool AccountTracker::IsAllUserInfoFetched() const {
......@@ -50,7 +45,7 @@ void AccountTracker::RemoveObserver(Observer* observer) {
std::vector<AccountIds> AccountTracker::GetAccounts() const {
const std::string active_account_id =
signin_manager_->GetAuthenticatedAccountId();
identity_manager_->GetPrimaryAccountInfo().account_id;
std::vector<AccountIds> accounts;
for (std::map<std::string, AccountState>::const_iterator it =
......@@ -72,43 +67,46 @@ std::vector<AccountIds> AccountTracker::GetAccounts() const {
return accounts;
}
void AccountTracker::OnRefreshTokenAvailable(const std::string& account_id) {
TRACE_EVENT1("identity", "AccountTracker::OnRefreshTokenAvailable",
"account_key", account_id);
void AccountTracker::OnRefreshTokenUpdatedForAccount(
const AccountInfo& account_info,
bool is_valid) {
TRACE_EVENT1("identity", "AccountTracker::OnRefreshTokenUpdatedForAccount",
"account_id", account_info.account_id);
// Ignore refresh tokens if there is no active account ID at all.
if (signin_manager_->GetAuthenticatedAccountId().empty())
if (!identity_manager_->HasPrimaryAccount())
return;
DVLOG(1) << "AVAILABLE " << account_id;
UpdateSignInState(account_id, /*is_signed_in=*/true);
DVLOG(1) << "AVAILABLE " << account_info.account_id;
UpdateSignInState(account_info.account_id, /*is_signed_in=*/true);
}
void AccountTracker::OnRefreshTokenRevoked(const std::string& account_id) {
TRACE_EVENT1("identity", "AccountTracker::OnRefreshTokenRevoked",
"account_key", account_id);
void AccountTracker::OnRefreshTokenRemovedForAccount(
const AccountInfo& account_info) {
TRACE_EVENT1("identity", "AccountTracker::OnRefreshTokenRemovedForAccount",
"account_id", account_info.account_id);
DVLOG(1) << "REVOKED " << account_id;
UpdateSignInState(account_id, /*is_signed_in=*/false);
DVLOG(1) << "REVOKED " << account_info.account_id;
UpdateSignInState(account_info.account_id, /*is_signed_in=*/false);
}
void AccountTracker::GoogleSigninSucceeded(const std::string& account_id,
const std::string& username) {
TRACE_EVENT0("identity", "AccountTracker::GoogleSigninSucceeded");
void AccountTracker::OnPrimaryAccountSet(
const AccountInfo& primary_account_info) {
TRACE_EVENT0("identity", "AccountTracker::OnPrimaryAccountSet");
std::vector<std::string> accounts = token_service_->GetAccounts();
std::vector<AccountInfo> accounts =
identity_manager_->GetAccountsWithRefreshTokens();
DVLOG(1) << "LOGIN " << accounts.size() << " accounts available.";
for (std::vector<std::string>::const_iterator it = accounts.begin();
it != accounts.end(); ++it) {
UpdateSignInState(*it, /*is_signed_in=*/true);
for (const AccountInfo& account_info : accounts) {
UpdateSignInState(account_info.account_id, /*is_signed_in=*/true);
}
}
void AccountTracker::GoogleSignedOut(const std::string& account_id,
const std::string& username) {
TRACE_EVENT0("identity", "AccountTracker::GoogleSignedOut");
void AccountTracker::OnPrimaryAccountCleared(
const AccountInfo& previous_primary_account_info) {
TRACE_EVENT0("identity", "AccountTracker::OnPrimaryAccountCleared");
DVLOG(1) << "LOGOUT";
StopTrackingAllAccounts();
}
......@@ -171,7 +169,7 @@ void AccountTracker::StartFetchingUserInfo(const std::string& account_key) {
DVLOG(1) << "StartFetching " << account_key;
AccountIdFetcher* fetcher = new AccountIdFetcher(
token_service_, request_context_getter_.get(), this, account_key);
identity_manager_, request_context_getter_.get(), this, account_key);
user_info_requests_[account_key] = base::WrapUnique(fetcher);
fetcher->Start();
}
......@@ -206,12 +204,11 @@ void AccountTracker::DeleteFetcher(AccountIdFetcher* fetcher) {
}
AccountIdFetcher::AccountIdFetcher(
OAuth2TokenService* token_service,
identity::IdentityManager* identity_manager,
net::URLRequestContextGetter* request_context_getter,
AccountTracker* tracker,
const std::string& account_key)
: OAuth2TokenService::Consumer("gaia_account_tracker"),
token_service_(token_service),
: identity_manager_(identity_manager),
request_context_getter_(request_context_getter),
tracker_(tracker),
account_key_(account_key) {
......@@ -226,33 +223,34 @@ AccountIdFetcher::~AccountIdFetcher() {
void AccountIdFetcher::Start() {
OAuth2TokenService::ScopeSet scopes;
scopes.insert("https://www.googleapis.com/auth/userinfo.profile");
login_token_request_ =
token_service_->StartRequest(account_key_, scopes, this);
access_token_fetcher_ = identity_manager_->CreateAccessTokenFetcherForAccount(
account_key_, "gaia_account_tracker", scopes,
base::BindOnce(&AccountIdFetcher::AccessTokenFetched,
base::Unretained(this)));
}
void AccountIdFetcher::OnGetTokenSuccess(
const OAuth2TokenService::Request* request,
const std::string& access_token,
const base::Time& expiration_time) {
void AccountIdFetcher::AccessTokenFetched(
GoogleServiceAuthError error,
identity::AccessTokenInfo access_token_info) {
access_token_fetcher_.reset();
if (error != GoogleServiceAuthError::AuthErrorNone()) {
TRACE_EVENT_ASYNC_STEP_PAST1("identity", "AccountIdFetcher", this,
"AccessTokenFetched",
"google_service_auth_error", error.ToString());
LOG(ERROR) << "AccessTokenFetched error: " << error.ToString();
tracker_->OnUserInfoFetchFailure(this);
return;
}
TRACE_EVENT_ASYNC_STEP_PAST0("identity", "AccountIdFetcher", this,
"OnGetTokenSuccess");
DCHECK_EQ(request, login_token_request_.get());
"AccessTokenFetched");
gaia_oauth_client_.reset(new gaia::GaiaOAuthClient(request_context_getter_));
const int kMaxGetUserIdRetries = 3;
gaia_oauth_client_->GetUserId(access_token, kMaxGetUserIdRetries, this);
}
void AccountIdFetcher::OnGetTokenFailure(
const OAuth2TokenService::Request* request,
const GoogleServiceAuthError& error) {
TRACE_EVENT_ASYNC_STEP_PAST1("identity", "AccountIdFetcher", this,
"OnGetTokenFailure", "google_service_auth_error",
error.ToString());
LOG(ERROR) << "OnGetTokenFailure: " << error.ToString();
DCHECK_EQ(request, login_token_request_.get());
tracker_->OnUserInfoFetchFailure(this);
gaia_oauth_client_->GetUserId(access_token_info.token, kMaxGetUserIdRetries,
this);
}
void AccountIdFetcher::OnGetUserIdResponse(const std::string& gaia_id) {
......
......@@ -11,12 +11,11 @@
#include <vector>
#include "base/observer_list.h"
#include "components/signin/core/browser/signin_manager.h"
#include "google_apis/gaia/gaia_oauth_client.h"
#include "google_apis/gaia/oauth2_token_service.h"
#include "services/identity/public/cpp/access_token_fetcher.h"
#include "services/identity/public/cpp/identity_manager.h"
class GoogleServiceAuthError;
class ProfileOAuth2TokenService;
namespace net {
class URLRequestContextGetter;
......@@ -41,11 +40,9 @@ class AccountIdFetcher;
// 2. Add/Remove and SignIn/SignOut pairs are always generated in order.
// 3. SignIn follows Add, and there will be a SignOut between SignIn & Remove.
// 4. If there is no primary account, there are no other accounts.
class AccountTracker : public OAuth2TokenService::Observer,
public SigninManagerBase::Observer {
class AccountTracker : public identity::IdentityManager::Observer {
public:
AccountTracker(SigninManagerBase* signin_manager,
ProfileOAuth2TokenService* token_service,
AccountTracker(identity::IdentityManager* identity_manager,
net::URLRequestContextGetter* request_context_getter);
~AccountTracker() override;
......@@ -77,20 +74,19 @@ class AccountTracker : public OAuth2TokenService::Observer,
bool is_signed_in;
};
// OAuth2TokenService::Observer implementation.
void OnRefreshTokenAvailable(const std::string& account_key) override;
void OnRefreshTokenRevoked(const std::string& account_key) override;
// identity::IdentityManager::Observer implementation.
void OnPrimaryAccountSet(const AccountInfo& primary_account_info) override;
void OnPrimaryAccountCleared(
const AccountInfo& previous_primary_account_info) override;
void OnRefreshTokenUpdatedForAccount(const AccountInfo& account_info,
bool is_valid) override;
void OnRefreshTokenRemovedForAccount(
const AccountInfo& account_info) override;
void OnUserInfoFetchSuccess(AccountIdFetcher* fetcher,
const std::string& gaia_id);
void OnUserInfoFetchFailure(AccountIdFetcher* fetcher);
// SigninManagerBase::Observer implementation.
void GoogleSigninSucceeded(const std::string& account_id,
const std::string& username) override;
void GoogleSignedOut(const std::string& account_id,
const std::string& username) override;
void NotifySignInChanged(const AccountState& account);
void UpdateSignInState(const std::string& account_key, bool is_signed_in);
......@@ -106,8 +102,7 @@ class AccountTracker : public OAuth2TokenService::Observer,
void StartFetchingUserInfo(const std::string& account_key);
void DeleteFetcher(AccountIdFetcher* fetcher);
SigninManagerBase* signin_manager_;
ProfileOAuth2TokenService* token_service_;
identity::IdentityManager* identity_manager_;
scoped_refptr<net::URLRequestContextGetter> request_context_getter_;
std::map<std::string, std::unique_ptr<AccountIdFetcher>> user_info_requests_;
std::map<std::string, AccountState> accounts_;
......@@ -115,10 +110,9 @@ class AccountTracker : public OAuth2TokenService::Observer,
bool shutdown_called_;
};
class AccountIdFetcher : public OAuth2TokenService::Consumer,
public gaia::GaiaOAuthClient::Delegate {
class AccountIdFetcher : public gaia::GaiaOAuthClient::Delegate {
public:
AccountIdFetcher(OAuth2TokenService* token_service,
AccountIdFetcher(identity::IdentityManager* identity_manager,
net::URLRequestContextGetter* request_context_getter,
AccountTracker* tracker,
const std::string& account_key);
......@@ -128,12 +122,8 @@ class AccountIdFetcher : public OAuth2TokenService::Consumer,
void Start();
// OAuth2TokenService::Consumer implementation.
void OnGetTokenSuccess(const OAuth2TokenService::Request* request,
const std::string& access_token,
const base::Time& expiration_time) override;
void OnGetTokenFailure(const OAuth2TokenService::Request* request,
const GoogleServiceAuthError& error) override;
void AccessTokenFetched(GoogleServiceAuthError error,
identity::AccessTokenInfo access_token_info);
// gaia::GaiaOAuthClient::Delegate implementation.
void OnGetUserIdResponse(const std::string& gaia_id) override;
......@@ -141,12 +131,12 @@ class AccountIdFetcher : public OAuth2TokenService::Consumer,
void OnNetworkError(int response_code) override;
private:
OAuth2TokenService* token_service_;
identity::IdentityManager* identity_manager_;
net::URLRequestContextGetter* request_context_getter_;
AccountTracker* tracker_;
const std::string account_key_;
std::unique_ptr<OAuth2TokenService::Request> login_token_request_;
std::unique_ptr<identity::AccessTokenFetcher> access_token_fetcher_;
std::unique_ptr<gaia::GaiaOAuthClient> gaia_oauth_client_;
};
......
......@@ -250,7 +250,7 @@ GCMAccountTrackerTest::GCMAccountTrackerTest() {
&account_tracker_service_, fake_gaia_cookie_manager_service_.get());
std::unique_ptr<AccountTracker> gaia_account_tracker(new AccountTracker(
fake_signin_manager_.get(), fake_token_service_.get(),
identity_manager_.get(),
new net::TestURLRequestContextGetter(message_loop_.task_runner())));
tracker_.reset(new GCMAccountTracker(std::move(gaia_account_tracker),
......
......@@ -42,8 +42,6 @@ class GCMProfileService::IdentityObserver
: public identity::IdentityManager::Observer {
public:
IdentityObserver(identity::IdentityManager* identity_manager,
SigninManagerBase* signin_manager,
ProfileOAuth2TokenService* token_service,
net::URLRequestContextGetter* request_context,
GCMDriver* driver);
~IdentityObserver() override;
......@@ -58,8 +56,6 @@ class GCMProfileService::IdentityObserver
GCMDriver* driver_;
identity::IdentityManager* identity_manager_;
SigninManagerBase* signin_manager_;
ProfileOAuth2TokenService* token_service_;
std::unique_ptr<GCMAccountTracker> gcm_account_tracker_;
// The account ID that this service is responsible for. Empty when the service
......@@ -73,14 +69,10 @@ class GCMProfileService::IdentityObserver
GCMProfileService::IdentityObserver::IdentityObserver(
identity::IdentityManager* identity_manager,
SigninManagerBase* signin_manager,
ProfileOAuth2TokenService* token_service,
net::URLRequestContextGetter* request_context,
GCMDriver* driver)
: driver_(driver),
identity_manager_(identity_manager),
signin_manager_(signin_manager),
token_service_(token_service),
weak_ptr_factory_(this) {
identity_manager_->AddObserver(this);
......@@ -119,7 +111,7 @@ void GCMProfileService::IdentityObserver::StartAccountTracker(
return;
std::unique_ptr<AccountTracker> gaia_account_tracker(
new AccountTracker(signin_manager_, token_service_, request_context));
new AccountTracker(identity_manager_, request_context));
gcm_account_tracker_.reset(new GCMAccountTracker(
std::move(gaia_account_tracker), identity_manager_, driver_));
......@@ -154,15 +146,11 @@ GCMProfileService::GCMProfileService(
version_info::Channel channel,
const std::string& product_category_for_subtypes,
identity::IdentityManager* identity_manager,
SigninManagerBase* signin_manager,
ProfileOAuth2TokenService* token_service,
std::unique_ptr<GCMClientFactory> gcm_client_factory,
const scoped_refptr<base::SequencedTaskRunner>& ui_task_runner,
const scoped_refptr<base::SequencedTaskRunner>& io_task_runner,
scoped_refptr<base::SequencedTaskRunner>& blocking_task_runner)
: identity_manager_(identity_manager),
signin_manager_(signin_manager),
token_service_(token_service),
request_context_(request_context) {
driver_ = CreateGCMDriverDesktop(
std::move(gcm_client_factory), prefs,
......@@ -171,8 +159,7 @@ GCMProfileService::GCMProfileService(
ui_task_runner, io_task_runner, blocking_task_runner);
identity_observer_.reset(
new IdentityObserver(identity_manager_, signin_manager_, token_service_,
request_context_, driver_.get()));
new IdentityObserver(identity_manager_, request_context_, driver_.get()));
}
#endif // BUILDFLAG(USE_GCM_FROM_PLATFORM)
......@@ -196,8 +183,7 @@ void GCMProfileService::SetDriverForTesting(std::unique_ptr<GCMDriver> driver) {
#if !BUILDFLAG(USE_GCM_FROM_PLATFORM)
if (identity_observer_) {
identity_observer_ = std::make_unique<IdentityObserver>(
identity_manager_, signin_manager_, token_service_, request_context_,
driver.get());
identity_manager_, request_context_, driver.get());
}
#endif // !BUILDFLAG(USE_GCM_FROM_PLATFORM)
}
......
......@@ -16,8 +16,6 @@
#include "build/build_config.h"
#include "components/gcm_driver/gcm_buildflags.h"
#include "components/keyed_service/core/keyed_service.h"
#include "components/signin/core/browser/profile_oauth2_token_service.h"
#include "components/signin/core/browser/signin_manager.h"
#include "components/version_info/version_info.h"
class PrefService;
......@@ -59,8 +57,6 @@ class GCMProfileService : public KeyedService {
version_info::Channel channel,
const std::string& product_category_for_subtypes,
identity::IdentityManager* identity_manager,
SigninManagerBase* signin_manager,
ProfileOAuth2TokenService* token_service,
std::unique_ptr<GCMClientFactory> gcm_client_factory,
const scoped_refptr<base::SequencedTaskRunner>& ui_task_runner,
const scoped_refptr<base::SequencedTaskRunner>& io_task_runner,
......@@ -88,8 +84,6 @@ class GCMProfileService : public KeyedService {
#if !BUILDFLAG(USE_GCM_FROM_PLATFORM)
identity::IdentityManager* identity_manager_;
SigninManagerBase* signin_manager_;
ProfileOAuth2TokenService* token_service_;
net::URLRequestContextGetter* request_context_ = nullptr;
......
......@@ -15,8 +15,6 @@
#include "components/signin/core/browser/signin_manager.h"
#include "ios/chrome/browser/browser_state/chrome_browser_state.h"
#include "ios/chrome/browser/signin/identity_manager_factory.h"
#include "ios/chrome/browser/signin/profile_oauth2_token_service_factory.h"
#include "ios/chrome/browser/signin/signin_manager_factory.h"
#include "ios/chrome/common/channel_info.h"
#include "ios/web/public/web_thread.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
......@@ -48,8 +46,6 @@ IOSChromeGCMProfileServiceFactory::IOSChromeGCMProfileServiceFactory()
"GCMProfileService",
BrowserStateDependencyManager::GetInstance()) {
DependsOn(IdentityManagerFactory::GetInstance());
DependsOn(ios::SigninManagerFactory::GetInstance());
DependsOn(ProfileOAuth2TokenServiceFactory::GetInstance());
}
IOSChromeGCMProfileServiceFactory::~IOSChromeGCMProfileServiceFactory() {}
......@@ -71,8 +67,6 @@ IOSChromeGCMProfileServiceFactory::BuildServiceInstanceFor(
browser_state->GetSharedURLLoaderFactory(), ::GetChannel(),
GetProductCategoryForSubtypes(),
IdentityManagerFactory::GetForBrowserState(browser_state),
ios::SigninManagerFactory::GetForBrowserState(browser_state),
ProfileOAuth2TokenServiceFactory::GetForBrowserState(browser_state),
base::WrapUnique(new gcm::GCMClientFactory),
web::WebThread::GetTaskRunnerForThread(web::WebThread::UI),
web::WebThread::GetTaskRunnerForThread(web::WebThread::IO),
......
......@@ -12,11 +12,8 @@
#include "components/gcm_driver/gcm_client_factory.h"
#include "components/gcm_driver/gcm_profile_service.h"
#include "components/keyed_service/ios/browser_state_dependency_manager.h"
#include "components/signin/core/browser/signin_manager.h"
#include "ios/web/public/web_thread.h"
#include "ios/web_view/internal/signin/web_view_identity_manager_factory.h"
#include "ios/web_view/internal/signin/web_view_oauth2_token_service_factory.h"
#include "ios/web_view/internal/signin/web_view_signin_manager_factory.h"
#include "ios/web_view/internal/web_view_browser_state.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
......@@ -48,8 +45,6 @@ WebViewGCMProfileServiceFactory::WebViewGCMProfileServiceFactory()
: BrowserStateKeyedServiceFactory(
"GCMProfileService",
BrowserStateDependencyManager::GetInstance()) {
DependsOn(WebViewSigninManagerFactory::GetInstance());
DependsOn(WebViewOAuth2TokenServiceFactory::GetInstance());
DependsOn(WebViewIdentityManagerFactory::GetInstance());
}
......@@ -72,8 +67,6 @@ WebViewGCMProfileServiceFactory::BuildServiceInstanceFor(
browser_state->GetSharedURLLoaderFactory(),
version_info::Channel::UNKNOWN, GetProductCategoryForSubtypes(),
WebViewIdentityManagerFactory::GetForBrowserState(browser_state),
WebViewSigninManagerFactory::GetForBrowserState(browser_state),
WebViewOAuth2TokenServiceFactory::GetForBrowserState(browser_state),
base::WrapUnique(new gcm::GCMClientFactory),
web::WebThread::GetTaskRunnerForThread(web::WebThread::UI),
web::WebThread::GetTaskRunnerForThread(web::WebThread::IO),
......
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