Commit 5614e4f1 authored by Sylvain Defresne's avatar Sylvain Defresne Committed by Commit Bot

Remove obsolete overload of GoogleSigninSucceeded

SigninManager::Observer::GoogleSigninSucceeded had two overload
one taking a AccountInfo, and one taking two std::string. The
latter is deprecated in favor of the former.

As all overrides of the latter version are in components/signin
or services/identity, convert them in one CL and remove the old
method (that is now unused).

Bug: none
Change-Id: I5e2d56187b60e0a84dc6c3b6fae100f7b1d0467f
Reviewed-on: https://chromium-review.googlesource.com/c/1344052
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Reviewed-by: default avatarDavid Roger <droger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610040}
parent b0a866f1
......@@ -475,7 +475,6 @@ void SigninManager::OnSignedIn() {
void SigninManager::FireGoogleSigninSucceeded() {
const AccountInfo account_info = GetAuthenticatedAccountInfo();
for (auto& observer : observer_list_) {
observer.GoogleSigninSucceeded(account_info.account_id, account_info.email);
observer.GoogleSigninSucceeded(account_info);
observer.GoogleSigninSucceededWithPassword(account_info, password_);
}
......
......@@ -71,10 +71,6 @@ class SigninManagerBase : public KeyedService {
const AccountInfo& account_info,
const std::string& password) {}
// DEPRECATED: Use the above method instead.
virtual void GoogleSigninSucceeded(const std::string& account_id,
const std::string& username) {}
// Called when the currently signed-in user for a user has been signed out.
virtual void GoogleSignedOut(const AccountInfo& account_info) {}
......
......@@ -56,8 +56,7 @@ class TestSigninManagerObserver : public SigninManagerBase::Observer {
num_failed_signins_++;
}
void GoogleSigninSucceeded(const std::string& account_id,
const std::string& username) override {
void GoogleSigninSucceeded(const AccountInfo& account_info) override {
num_successful_signins_++;
}
......
......@@ -76,8 +76,7 @@ void SigninStatusMetricsProvider::OnSigninManagerShutdown(
}
void SigninStatusMetricsProvider::GoogleSigninSucceeded(
const std::string& account_id,
const std::string& username) {
const AccountInfo& account_info) {
SigninStatus recorded_signin_status = signin_status();
if (recorded_signin_status == ALL_PROFILES_NOT_SIGNED_IN) {
UpdateSigninStatus(MIXED_SIGNIN_STATUS);
......
......@@ -69,8 +69,7 @@ class SigninStatusMetricsProvider : public SigninStatusMetricsProviderBase,
bool is_test);
// SigninManagerBase::Observer:
void GoogleSigninSucceeded(const std::string& account_id,
const std::string& username) override;
void GoogleSigninSucceeded(const AccountInfo& account_info) override;
void GoogleSignedOut(const std::string& account_id,
const std::string& username) override;
......
......@@ -27,13 +27,13 @@ TEST(SigninStatusMetricsProviderTest, GoogleSigninSucceeded) {
// Initial status is all signed out and then one of the profiles is signed in.
metrics_provider.UpdateInitialSigninStatus(2, 0);
metrics_provider.GoogleSigninSucceeded(std::string(), std::string());
metrics_provider.GoogleSigninSucceeded(AccountInfo());
EXPECT_EQ(SigninStatusMetricsProviderBase::MIXED_SIGNIN_STATUS,
metrics_provider.GetSigninStatusForTesting());
// Initial status is mixed and then one of the profiles is signed in.
metrics_provider.UpdateInitialSigninStatus(2, 1);
metrics_provider.GoogleSigninSucceeded(std::string(), std::string());
metrics_provider.GoogleSigninSucceeded(AccountInfo());
EXPECT_EQ(SigninStatusMetricsProviderBase::MIXED_SIGNIN_STATUS,
metrics_provider.GetSigninStatusForTesting());
}
......
......@@ -32,9 +32,8 @@ void SigninTracker::Initialize() {
cookie_manager_service_->AddObserver(this);
}
void SigninTracker::GoogleSigninSucceeded(const std::string& account_id,
const std::string& username) {
if (token_service_->RefreshTokenIsAvailable(account_id))
void SigninTracker::GoogleSigninSucceeded(const AccountInfo& account_info) {
if (token_service_->RefreshTokenIsAvailable(account_info.account_id))
observer_->SigninSuccess();
}
......
......@@ -80,8 +80,7 @@ class SigninTracker : public SigninManagerBase::Observer,
~SigninTracker() override;
// SigninManagerBase::Observer implementation.
void GoogleSigninSucceeded(const std::string& account_id,
const std::string& username) override;
void GoogleSigninSucceeded(const AccountInfo& account_info) override;
void GoogleSigninFailed(const GoogleServiceAuthError& error) override;
// OAuth2TokenService::Observer implementation.
......
......@@ -156,8 +156,7 @@ class AccountConsistencyService : public KeyedService,
const GoogleServiceAuthError& error) override;
// SigninManagerBase::Observer implementation.
void GoogleSigninSucceeded(const std::string& account_id,
const std::string& username) override;
void GoogleSigninSucceeded(const AccountInfo& account_info) override;
void GoogleSignedOut(const std::string& account_id,
const std::string& username) override;
......
......@@ -491,8 +491,7 @@ void AccountConsistencyService::OnGaiaAccountsInCookieUpdated(
}
void AccountConsistencyService::GoogleSigninSucceeded(
const std::string& account_id,
const std::string& username) {
const AccountInfo& account_info) {
AddChromeConnectedCookies();
}
......
......@@ -165,9 +165,9 @@ void IdentityManagerImpl::OnRefreshTokenAvailable(
OnAccountStateChange(account_id);
}
void IdentityManagerImpl::GoogleSigninSucceeded(const std::string& account_id,
const std::string& username) {
OnAccountStateChange(account_id);
void IdentityManagerImpl::GoogleSigninSucceeded(
const AccountInfo& account_info) {
OnAccountStateChange(account_info.account_id);
}
void IdentityManagerImpl::OnAccountStateChange(const std::string& account_id) {
......
......@@ -85,8 +85,7 @@ class IdentityManagerImpl : public mojom::IdentityManager,
void OnRefreshTokenAvailable(const std::string& account_id) override;
// SigninManagerBase::Observer:
void GoogleSigninSucceeded(const std::string& account_id,
const std::string& username) override;
void GoogleSigninSucceeded(const AccountInfo& account_info) override;
// Notified when there is a change in the state of the account
// corresponding to |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