Commit 12b411d2 authored by Colin Blundell's avatar Colin Blundell Committed by Commit Bot

google_apis: Remove RequestLogin() from IdentityProvider

This method is not used, and removing it is a nice clarification of
the use case of this interface.

TBR=jochen@chromium.org

Bug: 809927
Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: I2ff8915f93612f029172f4b6478b7ea9eb04b9e6
Reviewed-on: https://chromium-review.googlesource.com/1046847
Commit-Queue: Colin Blundell <blundell@chromium.org>
Reviewed-by: default avatarColin Blundell <blundell@chromium.org>
Reviewed-by: default avatarJochen Eisinger <jochen@chromium.org>
Reviewed-by: default avatarRoger Tawa <rogerta@chromium.org>
Cr-Commit-Position: refs/heads/master@{#561016}
parent cada5cf3
......@@ -26,8 +26,4 @@ OAuth2TokenService* DeviceIdentityProvider::GetTokenService() {
return token_service_;
}
bool DeviceIdentityProvider::RequestLogin() {
return false;
}
} // namespace chromeos
......@@ -23,7 +23,6 @@ class DeviceIdentityProvider : public IdentityProvider {
std::string GetActiveUsername() override;
std::string GetActiveAccountId() override;
OAuth2TokenService* GetTokenService() override;
bool RequestLogin() override;
private:
chromeos::DeviceOAuth2TokenService* token_service_;
......
......@@ -13,7 +13,6 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
#include "chrome/browser/signin/signin_manager_factory.h"
#include "chrome/browser/ui/webui/signin/login_ui_service_factory.h"
#include "components/signin/core/browser/profile_identity_provider.h"
#include "components/signin/core/browser/signin_manager.h"
#include "components/update_client/update_query_params.h"
......@@ -57,8 +56,7 @@ ChromeExtensionDownloaderFactory::CreateForProfile(
std::unique_ptr<IdentityProvider> identity_provider(
new ProfileIdentityProvider(
SigninManagerFactory::GetForProfile(profile),
ProfileOAuth2TokenServiceFactory::GetForProfile(profile),
LoginUIServiceFactory::GetShowLoginPopupCallbackForProfile(profile)));
ProfileOAuth2TokenServiceFactory::GetForProfile(profile)));
service_manager::Connector* connector =
content::ServiceManagerConnection::GetForProcess()->GetConnector();
std::unique_ptr<ExtensionDownloader> downloader =
......
......@@ -13,7 +13,6 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
#include "chrome/browser/signin/signin_manager_factory.h"
#include "chrome/browser/ui/webui/signin/login_ui_service_factory.h"
#include "chrome/common/chrome_content_client.h"
#include "components/gcm_driver/gcm_profile_service.h"
#include "components/invalidation/impl/invalidation_prefs.h"
......@@ -82,7 +81,6 @@ ProfileInvalidationProviderFactory::ProfileInvalidationProviderFactory()
DependsOn(SigninManagerFactory::GetInstance());
DependsOn(ProfileOAuth2TokenServiceFactory::GetInstance());
DependsOn(gcm::GCMProfileServiceFactory::GetInstance());
DependsOn(LoginUIServiceFactory::GetInstance());
#endif
}
......@@ -121,8 +119,7 @@ KeyedService* ProfileInvalidationProviderFactory::BuildServiceInstanceFor(
if (!identity_provider) {
identity_provider.reset(new ProfileIdentityProvider(
SigninManagerFactory::GetForProfile(profile),
ProfileOAuth2TokenServiceFactory::GetForProfile(profile),
LoginUIServiceFactory::GetShowLoginPopupCallbackForProfile(profile)));
ProfileOAuth2TokenServiceFactory::GetForProfile(profile)));
}
std::unique_ptr<TiclInvalidationService> service(new TiclInvalidationService(
......
......@@ -4,16 +4,12 @@
#include "components/signin/core/browser/profile_identity_provider.h"
#include "base/callback.h"
#include "components/signin/core/browser/profile_oauth2_token_service.h"
ProfileIdentityProvider::ProfileIdentityProvider(
SigninManagerBase* signin_manager,
ProfileOAuth2TokenService* token_service,
const base::Closure& request_login_callback)
: signin_manager_(signin_manager),
token_service_(token_service),
request_login_callback_(request_login_callback) {
ProfileOAuth2TokenService* token_service)
: signin_manager_(signin_manager), token_service_(token_service) {
signin_manager_->AddObserver(this);
}
......@@ -33,13 +29,6 @@ OAuth2TokenService* ProfileIdentityProvider::GetTokenService() {
return token_service_;
}
bool ProfileIdentityProvider::RequestLogin() {
if (request_login_callback_.is_null())
return false;
request_login_callback_.Run();
return true;
}
void ProfileIdentityProvider::GoogleSigninSucceeded(
const std::string& account_id,
const std::string& username) {
......
......@@ -5,7 +5,6 @@
#ifndef COMPONENTS_SIGNIN_CORE_BROWSER_PROFILE_IDENTITY_PROVIDER_H_
#define COMPONENTS_SIGNIN_CORE_BROWSER_PROFILE_IDENTITY_PROVIDER_H_
#include "base/callback_forward.h"
#include "base/macros.h"
#include "components/signin/core/browser/signin_manager_base.h"
#include "google_apis/gaia/identity_provider.h"
......@@ -17,18 +16,14 @@ class ProfileOAuth2TokenService;
class ProfileIdentityProvider : public IdentityProvider,
public SigninManagerBase::Observer {
public:
// |request_login_callback| may be null, in which case login attempts are
// ignored.
ProfileIdentityProvider(SigninManagerBase* signin_manager,
ProfileOAuth2TokenService* token_service,
const base::Closure& request_login_callback);
ProfileOAuth2TokenService* token_service);
~ProfileIdentityProvider() override;
// IdentityProvider:
std::string GetActiveUsername() override;
std::string GetActiveAccountId() override;
OAuth2TokenService* GetTokenService() override;
bool RequestLogin() override;
// SigninManagerBase::Observer:
void GoogleSigninSucceeded(const std::string& account_id,
......@@ -39,7 +34,6 @@ class ProfileIdentityProvider : public IdentityProvider,
private:
SigninManagerBase* const signin_manager_;
ProfileOAuth2TokenService* const token_service_;
base::Closure request_login_callback_;
DISALLOW_COPY_AND_ASSIGN(ProfileIdentityProvider);
};
......
......@@ -38,7 +38,3 @@ std::string FakeIdentityProvider::GetActiveAccountId() {
OAuth2TokenService* FakeIdentityProvider::GetTokenService() {
return token_service_;
}
bool FakeIdentityProvider::RequestLogin() {
return false;
}
......@@ -32,7 +32,6 @@ class FakeIdentityProvider : public IdentityProvider {
std::string GetActiveUsername() override;
std::string GetActiveAccountId() override;
OAuth2TokenService* GetTokenService() override;
bool RequestLogin() override;
private:
std::string account_id_;
......
......@@ -59,12 +59,6 @@ class IdentityProvider : public OAuth2TokenService::Observer {
// Gets the token service vending OAuth tokens for all logged-in accounts.
virtual OAuth2TokenService* GetTokenService() = 0;
// Requests login to a GAIA account. Implementations can show a login UI, log
// in automatically if sufficient credentials are available or may ignore the
// request. Returns true if the login request was processed and false if it
// was ignored.
virtual bool RequestLogin() = 0;
void AddObserver(Observer* observer);
void RemoveObserver(Observer* observer);
......
......@@ -70,9 +70,7 @@ IOSChromeProfileInvalidationProviderFactory::BuildServiceInstanceFor(
std::unique_ptr<IdentityProvider> identity_provider(
new ProfileIdentityProvider(
ios::SigninManagerFactory::GetForBrowserState(browser_state),
OAuth2TokenServiceFactory::GetForBrowserState(browser_state),
// LoginUIServiceFactory is not built on iOS.
base::Closure()));
OAuth2TokenServiceFactory::GetForBrowserState(browser_state)));
std::unique_ptr<TiclInvalidationService> service(new TiclInvalidationService(
web::GetWebClient()->GetUserAgent(web::UserAgentType::MOBILE),
......
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