Commit 0e284dfa authored by Colin Blundell's avatar Colin Blundell Committed by Commit Bot

Remove FakeSigninManager's override of OnSignoutDecisionReached()

This CL removes the last functionality that FakeSigninManager adds on
to SigninManager: overriding OnSignoutDecisionReached(). Presumably
at one time this corresponded to some simplification of the production
code. However, at this time the only difference that the override adds
is that it doesn't log metrics. Logging metrics in a test context is
not problematic, as testing will not emit live metrics (confirmed with
rkaplow@ from the metrics team).

Bug: 796544
Change-Id: Ic703c0e01637d6adbc3a495cb58d715ec33d8e4c
Reviewed-on: https://chromium-review.googlesource.com/c/1486532
Commit-Queue: Colin Blundell <blundell@chromium.org>
Reviewed-by: default avatarDavid Roger <droger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#635473}
parent ec3ef8fa
...@@ -39,44 +39,4 @@ FakeSigninManager::FakeSigninManager( ...@@ -39,44 +39,4 @@ FakeSigninManager::FakeSigninManager(
FakeSigninManager::~FakeSigninManager() {} FakeSigninManager::~FakeSigninManager() {}
void FakeSigninManager::OnSignoutDecisionReached(
signin_metrics::ProfileSignout signout_source_metric,
signin_metrics::SignoutDelete signout_delete_metric,
RemoveAccountsOption remove_option,
SigninClient::SignoutDecision signout_decision) {
if (!IsAuthenticated()) {
return;
}
// TODO(crbug.com/887756): Consider moving this higher up, or document why
// the above blocks are exempt from the |signout_decision| early return.
if (signout_decision == SigninClient::SignoutDecision::DISALLOW_SIGNOUT)
return;
AccountInfo account_info = GetAuthenticatedAccountInfo();
const std::string account_id = GetAuthenticatedAccountId();
const std::string username = account_info.email;
authenticated_account_id_.clear();
switch (remove_option) {
case RemoveAccountsOption::kRemoveAllAccounts:
if (token_service())
token_service()->RevokeAllCredentials();
break;
case RemoveAccountsOption::kRemoveAuthenticatedAccountIfInError:
if (token_service() && token_service()->RefreshTokenHasError(account_id))
token_service()->RevokeCredentials(account_id);
break;
case RemoveAccountsOption::kKeepAllAccounts:
// Do nothing.
break;
}
ClearAuthenticatedAccountId();
client_->GetPrefs()->ClearPref(prefs::kGoogleServicesHostedDomain);
client_->GetPrefs()->ClearPref(prefs::kGoogleServicesAccountId);
client_->GetPrefs()->ClearPref(prefs::kGoogleServicesUserAccountId);
client_->GetPrefs()->ClearPref(prefs::kSignedInTime);
FireGoogleSignedOut(account_info);
}
#endif // !defined (OS_CHROMEOS) #endif // !defined (OS_CHROMEOS)
...@@ -33,13 +33,6 @@ class FakeSigninManager : public SigninManager { ...@@ -33,13 +33,6 @@ class FakeSigninManager : public SigninManager {
signin::AccountConsistencyMethod account_consistency); signin::AccountConsistencyMethod account_consistency);
~FakeSigninManager() override; ~FakeSigninManager() override;
protected:
void OnSignoutDecisionReached(
signin_metrics::ProfileSignout signout_source_metric,
signin_metrics::SignoutDelete signout_delete_metric,
RemoveAccountsOption remove_option,
SigninClient::SignoutDecision signout_decision) override;
}; };
#endif // !defined (OS_CHROMEOS) #endif // !defined (OS_CHROMEOS)
......
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