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() { ...@@ -475,7 +475,6 @@ void SigninManager::OnSignedIn() {
void SigninManager::FireGoogleSigninSucceeded() { void SigninManager::FireGoogleSigninSucceeded() {
const AccountInfo account_info = GetAuthenticatedAccountInfo(); const AccountInfo account_info = GetAuthenticatedAccountInfo();
for (auto& observer : observer_list_) { for (auto& observer : observer_list_) {
observer.GoogleSigninSucceeded(account_info.account_id, account_info.email);
observer.GoogleSigninSucceeded(account_info); observer.GoogleSigninSucceeded(account_info);
observer.GoogleSigninSucceededWithPassword(account_info, password_); observer.GoogleSigninSucceededWithPassword(account_info, password_);
} }
......
...@@ -71,10 +71,6 @@ class SigninManagerBase : public KeyedService { ...@@ -71,10 +71,6 @@ class SigninManagerBase : public KeyedService {
const AccountInfo& account_info, const AccountInfo& account_info,
const std::string& password) {} 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. // Called when the currently signed-in user for a user has been signed out.
virtual void GoogleSignedOut(const AccountInfo& account_info) {} virtual void GoogleSignedOut(const AccountInfo& account_info) {}
......
...@@ -56,8 +56,7 @@ class TestSigninManagerObserver : public SigninManagerBase::Observer { ...@@ -56,8 +56,7 @@ class TestSigninManagerObserver : public SigninManagerBase::Observer {
num_failed_signins_++; num_failed_signins_++;
} }
void GoogleSigninSucceeded(const std::string& account_id, void GoogleSigninSucceeded(const AccountInfo& account_info) override {
const std::string& username) override {
num_successful_signins_++; num_successful_signins_++;
} }
......
...@@ -76,8 +76,7 @@ void SigninStatusMetricsProvider::OnSigninManagerShutdown( ...@@ -76,8 +76,7 @@ void SigninStatusMetricsProvider::OnSigninManagerShutdown(
} }
void SigninStatusMetricsProvider::GoogleSigninSucceeded( void SigninStatusMetricsProvider::GoogleSigninSucceeded(
const std::string& account_id, const AccountInfo& account_info) {
const std::string& username) {
SigninStatus recorded_signin_status = signin_status(); SigninStatus recorded_signin_status = signin_status();
if (recorded_signin_status == ALL_PROFILES_NOT_SIGNED_IN) { if (recorded_signin_status == ALL_PROFILES_NOT_SIGNED_IN) {
UpdateSigninStatus(MIXED_SIGNIN_STATUS); UpdateSigninStatus(MIXED_SIGNIN_STATUS);
......
...@@ -69,8 +69,7 @@ class SigninStatusMetricsProvider : public SigninStatusMetricsProviderBase, ...@@ -69,8 +69,7 @@ class SigninStatusMetricsProvider : public SigninStatusMetricsProviderBase,
bool is_test); bool is_test);
// SigninManagerBase::Observer: // SigninManagerBase::Observer:
void GoogleSigninSucceeded(const std::string& account_id, void GoogleSigninSucceeded(const AccountInfo& account_info) override;
const std::string& username) override;
void GoogleSignedOut(const std::string& account_id, void GoogleSignedOut(const std::string& account_id,
const std::string& username) override; const std::string& username) override;
......
...@@ -27,13 +27,13 @@ TEST(SigninStatusMetricsProviderTest, GoogleSigninSucceeded) { ...@@ -27,13 +27,13 @@ TEST(SigninStatusMetricsProviderTest, GoogleSigninSucceeded) {
// Initial status is all signed out and then one of the profiles is signed in. // Initial status is all signed out and then one of the profiles is signed in.
metrics_provider.UpdateInitialSigninStatus(2, 0); metrics_provider.UpdateInitialSigninStatus(2, 0);
metrics_provider.GoogleSigninSucceeded(std::string(), std::string()); metrics_provider.GoogleSigninSucceeded(AccountInfo());
EXPECT_EQ(SigninStatusMetricsProviderBase::MIXED_SIGNIN_STATUS, EXPECT_EQ(SigninStatusMetricsProviderBase::MIXED_SIGNIN_STATUS,
metrics_provider.GetSigninStatusForTesting()); metrics_provider.GetSigninStatusForTesting());
// Initial status is mixed and then one of the profiles is signed in. // Initial status is mixed and then one of the profiles is signed in.
metrics_provider.UpdateInitialSigninStatus(2, 1); metrics_provider.UpdateInitialSigninStatus(2, 1);
metrics_provider.GoogleSigninSucceeded(std::string(), std::string()); metrics_provider.GoogleSigninSucceeded(AccountInfo());
EXPECT_EQ(SigninStatusMetricsProviderBase::MIXED_SIGNIN_STATUS, EXPECT_EQ(SigninStatusMetricsProviderBase::MIXED_SIGNIN_STATUS,
metrics_provider.GetSigninStatusForTesting()); metrics_provider.GetSigninStatusForTesting());
} }
......
...@@ -32,9 +32,8 @@ void SigninTracker::Initialize() { ...@@ -32,9 +32,8 @@ void SigninTracker::Initialize() {
cookie_manager_service_->AddObserver(this); cookie_manager_service_->AddObserver(this);
} }
void SigninTracker::GoogleSigninSucceeded(const std::string& account_id, void SigninTracker::GoogleSigninSucceeded(const AccountInfo& account_info) {
const std::string& username) { if (token_service_->RefreshTokenIsAvailable(account_info.account_id))
if (token_service_->RefreshTokenIsAvailable(account_id))
observer_->SigninSuccess(); observer_->SigninSuccess();
} }
......
...@@ -80,8 +80,7 @@ class SigninTracker : public SigninManagerBase::Observer, ...@@ -80,8 +80,7 @@ class SigninTracker : public SigninManagerBase::Observer,
~SigninTracker() override; ~SigninTracker() override;
// SigninManagerBase::Observer implementation. // SigninManagerBase::Observer implementation.
void GoogleSigninSucceeded(const std::string& account_id, void GoogleSigninSucceeded(const AccountInfo& account_info) override;
const std::string& username) override;
void GoogleSigninFailed(const GoogleServiceAuthError& error) override; void GoogleSigninFailed(const GoogleServiceAuthError& error) override;
// OAuth2TokenService::Observer implementation. // OAuth2TokenService::Observer implementation.
......
...@@ -156,8 +156,7 @@ class AccountConsistencyService : public KeyedService, ...@@ -156,8 +156,7 @@ class AccountConsistencyService : public KeyedService,
const GoogleServiceAuthError& error) override; const GoogleServiceAuthError& error) override;
// SigninManagerBase::Observer implementation. // SigninManagerBase::Observer implementation.
void GoogleSigninSucceeded(const std::string& account_id, void GoogleSigninSucceeded(const AccountInfo& account_info) override;
const std::string& username) override;
void GoogleSignedOut(const std::string& account_id, void GoogleSignedOut(const std::string& account_id,
const std::string& username) override; const std::string& username) override;
......
...@@ -491,8 +491,7 @@ void AccountConsistencyService::OnGaiaAccountsInCookieUpdated( ...@@ -491,8 +491,7 @@ void AccountConsistencyService::OnGaiaAccountsInCookieUpdated(
} }
void AccountConsistencyService::GoogleSigninSucceeded( void AccountConsistencyService::GoogleSigninSucceeded(
const std::string& account_id, const AccountInfo& account_info) {
const std::string& username) {
AddChromeConnectedCookies(); AddChromeConnectedCookies();
} }
......
...@@ -165,9 +165,9 @@ void IdentityManagerImpl::OnRefreshTokenAvailable( ...@@ -165,9 +165,9 @@ void IdentityManagerImpl::OnRefreshTokenAvailable(
OnAccountStateChange(account_id); OnAccountStateChange(account_id);
} }
void IdentityManagerImpl::GoogleSigninSucceeded(const std::string& account_id, void IdentityManagerImpl::GoogleSigninSucceeded(
const std::string& username) { const AccountInfo& account_info) {
OnAccountStateChange(account_id); OnAccountStateChange(account_info.account_id);
} }
void IdentityManagerImpl::OnAccountStateChange(const std::string& account_id) { void IdentityManagerImpl::OnAccountStateChange(const std::string& account_id) {
......
...@@ -85,8 +85,7 @@ class IdentityManagerImpl : public mojom::IdentityManager, ...@@ -85,8 +85,7 @@ class IdentityManagerImpl : public mojom::IdentityManager,
void OnRefreshTokenAvailable(const std::string& account_id) override; void OnRefreshTokenAvailable(const std::string& account_id) override;
// SigninManagerBase::Observer: // SigninManagerBase::Observer:
void GoogleSigninSucceeded(const std::string& account_id, void GoogleSigninSucceeded(const AccountInfo& account_info) override;
const std::string& username) override;
// Notified when there is a change in the state of the account // Notified when there is a change in the state of the account
// corresponding to |account_id|. // 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