Commit 5742a1c6 authored by John Z Wu's avatar John Z Wu Committed by Commit Bot

Remove IOSSigninClient OAuth2 code.

This code has been moved to AccountFetcherService and AccountInfoFetcher.

Bug: 
Change-Id: I5c0cbf8863e4d7726ad1799551208a4e54f4dfd6
Reviewed-on: https://chromium-review.googlesource.com/801662Reviewed-by: default avatarMihai Sardarescu <msarda@chromium.org>
Commit-Queue: John Wu <jzw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521393}
parent acc25ce9
......@@ -14,8 +14,7 @@ IOSSigninClient::IOSSigninClient(
scoped_refptr<content_settings::CookieSettings> cookie_settings,
scoped_refptr<HostContentSettingsMap> host_content_settings_map,
scoped_refptr<TokenWebData> token_web_data)
: OAuth2TokenService::Consumer("ios_signin_client"),
pref_service_(pref_service),
: pref_service_(pref_service),
url_request_context_(url_request_context),
signin_error_controller_(signin_error_controller),
cookie_settings_(cookie_settings),
......@@ -90,41 +89,6 @@ IOSSigninClient::AddCookieChangedCallback(
return subscription;
}
void IOSSigninClient::OnGetTokenInfoResponse(
std::unique_ptr<base::DictionaryValue> token_info) {
oauth_request_.reset();
}
void IOSSigninClient::OnOAuthError() {
// Ignore the failure. It's not essential and we'll try again next time.
oauth_request_.reset();
}
void IOSSigninClient::OnNetworkError(int response_code) {
// Ignore the failure. It's not essential and we'll try again next time.
oauth_request_.reset();
}
void IOSSigninClient::OnGetTokenSuccess(
const OAuth2TokenService::Request* request,
const std::string& access_token,
const base::Time& expiration_time) {
// Exchange the access token for a handle that can be used for later
// verification that the token is still valid (i.e. the password has not
// been changed).
if (!oauth_client_) {
oauth_client_.reset(new gaia::GaiaOAuthClient(GetURLRequestContext()));
}
oauth_client_->GetTokenInfo(access_token, 3 /* retries */, this);
}
void IOSSigninClient::OnGetTokenFailure(
const OAuth2TokenService::Request* request,
const GoogleServiceAuthError& error) {
// Ignore the failure. It's not essential and we'll try again next time.
oauth_request_.reset();
}
void IOSSigninClient::OnNetworkChanged(
net::NetworkChangeNotifier::ConnectionType type) {
if (type >= net::NetworkChangeNotifier::ConnectionType::CONNECTION_NONE)
......
......@@ -12,8 +12,6 @@
#include "components/content_settings/core/browser/host_content_settings_map.h"
#include "components/signin/core/browser/signin_client.h"
#include "components/signin/core/browser/signin_error_controller.h"
#include "google_apis/gaia/gaia_oauth_client.h"
#include "google_apis/gaia/oauth2_token_service.h"
#include "net/base/network_change_notifier.h"
#include "net/url_request/url_request_context_getter.h"
......@@ -21,9 +19,7 @@
class IOSSigninClient
: public SigninClient,
public net::NetworkChangeNotifier::NetworkChangeObserver,
public SigninErrorController::Observer,
public gaia::GaiaOAuthClient::Delegate,
public OAuth2TokenService::Consumer {
public SigninErrorController::Observer {
public:
IOSSigninClient(
PrefService* pref_service,
......@@ -61,19 +57,6 @@ class IOSSigninClient
// KeyedService implementation.
void Shutdown() override;
// gaia::GaiaOAuthClient::Delegate implementation.
void OnGetTokenInfoResponse(
std::unique_ptr<base::DictionaryValue> token_info) override;
void OnOAuthError() override;
void OnNetworkError(int response_code) override;
// 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;
// net::NetworkChangeController::NetworkChangeObserver implementation.
void OnNetworkChanged(
net::NetworkChangeNotifier::ConnectionType type) override;
......@@ -87,9 +70,6 @@ class IOSSigninClient
scoped_refptr<TokenWebData> token_web_data_;
std::list<base::Closure> delayed_callbacks_;
std::unique_ptr<gaia::GaiaOAuthClient> oauth_client_;
std::unique_ptr<OAuth2TokenService::Request> oauth_request_;
DISALLOW_COPY_AND_ASSIGN(IOSSigninClient);
};
......
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