Commit a9570617 authored by Sylvain Defresne's avatar Sylvain Defresne Committed by Commit Bot

Remove obsolete overload of GoogleSignedOut

SigninManager::Observer::GoogleSignedOut 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: I1e65e9d182f7e48e75ed86f43647a57f65bf3d0e
Reviewed-on: https://chromium-review.googlesource.com/c/1344094
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Reviewed-by: default avatarDavid Roger <droger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610384}
parent 45ef66be
...@@ -164,7 +164,7 @@ void FakeSigninManager::OnSignoutDecisionReached( ...@@ -164,7 +164,7 @@ void FakeSigninManager::OnSignoutDecisionReached(
client_->GetPrefs()->ClearPref(prefs::kGoogleServicesUserAccountId); client_->GetPrefs()->ClearPref(prefs::kGoogleServicesUserAccountId);
client_->GetPrefs()->ClearPref(prefs::kSignedInTime); client_->GetPrefs()->ClearPref(prefs::kSignedInTime);
FireGoogleSignedOut(account_id, account_info); FireGoogleSignedOut(account_info);
} }
#endif // !defined (OS_CHROMEOS) #endif // !defined (OS_CHROMEOS)
...@@ -259,7 +259,7 @@ void SigninManager::OnSignoutDecisionReached( ...@@ -259,7 +259,7 @@ void SigninManager::OnSignoutDecisionReached(
break; break;
} }
FireGoogleSignedOut(account_id, account_info); FireGoogleSignedOut(account_info);
} }
void SigninManager::Initialize(PrefService* local_state) { void SigninManager::Initialize(PrefService* local_state) {
...@@ -443,10 +443,8 @@ void SigninManager::FireGoogleSigninSucceeded() { ...@@ -443,10 +443,8 @@ void SigninManager::FireGoogleSigninSucceeded() {
} }
} }
void SigninManager::FireGoogleSignedOut(const std::string& account_id, void SigninManager::FireGoogleSignedOut(const AccountInfo& account_info) {
const AccountInfo& account_info) {
for (auto& observer : observer_list_) { for (auto& observer : observer_list_) {
observer.GoogleSignedOut(account_id, account_info.email);
observer.GoogleSignedOut(account_info); observer.GoogleSignedOut(account_info);
} }
} }
......
...@@ -224,8 +224,7 @@ class SigninManager : public SigninManagerBase, ...@@ -224,8 +224,7 @@ class SigninManager : public SigninManagerBase,
void FireGoogleSigninSucceeded(); void FireGoogleSigninSucceeded();
// Send all observers |GoogleSignedOut| notifications. // Send all observers |GoogleSignedOut| notifications.
void FireGoogleSignedOut(const std::string& account_id, void FireGoogleSignedOut(const AccountInfo& account_info);
const AccountInfo& account_info);
// Waits for the AccountTrackerService, then sends GoogleSigninSucceeded to // Waits for the AccountTrackerService, then sends GoogleSigninSucceeded to
// the client and clears the local password. // the client and clears the local password.
......
...@@ -74,10 +74,6 @@ class SigninManagerBase : public KeyedService { ...@@ -74,10 +74,6 @@ class SigninManagerBase : public KeyedService {
// 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) {}
// DEPRECATED: Use the above method instead.
virtual void GoogleSignedOut(const std::string& account_id,
const std::string& username) {}
protected: protected:
virtual ~Observer() {} virtual ~Observer() {}
......
...@@ -65,8 +65,7 @@ class TestSigninManagerObserver : public SigninManagerBase::Observer { ...@@ -65,8 +65,7 @@ class TestSigninManagerObserver : public SigninManagerBase::Observer {
num_successful_signins_with_password_++; num_successful_signins_with_password_++;
} }
void GoogleSignedOut(const std::string& account_id, void GoogleSignedOut(const AccountInfo& account_info) override {
const std::string& username) override {
num_signouts_++; num_signouts_++;
} }
}; };
......
...@@ -87,8 +87,8 @@ void SigninStatusMetricsProvider::GoogleSigninSucceeded( ...@@ -87,8 +87,8 @@ void SigninStatusMetricsProvider::GoogleSigninSucceeded(
} }
} }
void SigninStatusMetricsProvider::GoogleSignedOut(const std::string& account_id, void SigninStatusMetricsProvider::GoogleSignedOut(
const std::string& username) { const AccountInfo& account_info) {
SigninStatus recorded_signin_status = signin_status(); SigninStatus recorded_signin_status = signin_status();
if (recorded_signin_status == ALL_PROFILES_SIGNED_IN) { if (recorded_signin_status == ALL_PROFILES_SIGNED_IN) {
UpdateSigninStatus(MIXED_SIGNIN_STATUS); UpdateSigninStatus(MIXED_SIGNIN_STATUS);
......
...@@ -70,8 +70,7 @@ class SigninStatusMetricsProvider : public SigninStatusMetricsProviderBase, ...@@ -70,8 +70,7 @@ class SigninStatusMetricsProvider : public SigninStatusMetricsProviderBase,
// SigninManagerBase::Observer: // SigninManagerBase::Observer:
void GoogleSigninSucceeded(const AccountInfo& account_info) override; void GoogleSigninSucceeded(const AccountInfo& account_info) override;
void GoogleSignedOut(const std::string& account_id, void GoogleSignedOut(const AccountInfo& account_info) override;
const std::string& username) override;
// Obtain sign-in status and add observers. // Obtain sign-in status and add observers.
void Initialize(); void Initialize();
......
...@@ -43,13 +43,13 @@ TEST(SigninStatusMetricsProviderTest, GoogleSignedOut) { ...@@ -43,13 +43,13 @@ TEST(SigninStatusMetricsProviderTest, GoogleSignedOut) {
// Initial status is all signed in and then one of the profiles is signed out. // Initial status is all signed in and then one of the profiles is signed out.
metrics_provider.UpdateInitialSigninStatus(2, 2); metrics_provider.UpdateInitialSigninStatus(2, 2);
metrics_provider.GoogleSignedOut(std::string(), std::string()); metrics_provider.GoogleSignedOut(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 out. // Initial status is mixed and then one of the profiles is signed out.
metrics_provider.UpdateInitialSigninStatus(2, 1); metrics_provider.UpdateInitialSigninStatus(2, 1);
metrics_provider.GoogleSignedOut(std::string(), std::string()); metrics_provider.GoogleSignedOut(AccountInfo());
EXPECT_EQ(SigninStatusMetricsProviderBase::MIXED_SIGNIN_STATUS, EXPECT_EQ(SigninStatusMetricsProviderBase::MIXED_SIGNIN_STATUS,
metrics_provider.GetSigninStatusForTesting()); metrics_provider.GetSigninStatusForTesting());
} }
...@@ -157,8 +157,7 @@ class AccountConsistencyService : public KeyedService, ...@@ -157,8 +157,7 @@ class AccountConsistencyService : public KeyedService,
// SigninManagerBase::Observer implementation. // SigninManagerBase::Observer implementation.
void GoogleSigninSucceeded(const AccountInfo& account_info) override; void GoogleSigninSucceeded(const AccountInfo& account_info) override;
void GoogleSignedOut(const std::string& account_id, void GoogleSignedOut(const AccountInfo& account_info) override;
const std::string& username) override;
// ActiveStateManager::Observer implementation. // ActiveStateManager::Observer implementation.
void OnActive() override; void OnActive() override;
......
...@@ -495,8 +495,8 @@ void AccountConsistencyService::GoogleSigninSucceeded( ...@@ -495,8 +495,8 @@ void AccountConsistencyService::GoogleSigninSucceeded(
AddChromeConnectedCookies(); AddChromeConnectedCookies();
} }
void AccountConsistencyService::GoogleSignedOut(const std::string& account_id, void AccountConsistencyService::GoogleSignedOut(
const std::string& username) { const AccountInfo& account_info) {
// There is not need to remove CHROME_CONNECTED cookies on |GoogleSignedOut| // There is not need to remove CHROME_CONNECTED cookies on |GoogleSignedOut|
// events as these cookies will be removed by the GaiaCookieManagerServer // events as these cookies will be removed by the GaiaCookieManagerServer
// right before fetching the Gaia logout request. // right before fetching the Gaia logout request.
......
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