Commit eb45c138 authored by bzanotti's avatar bzanotti Committed by Commit bot

Add LogOut method to GaiaCookieManagerService::Observer.

This allows GMCS observers to be notified whenever a logout operation
finished.

BUG=

Review-Url: https://codereview.chromium.org/2397263002
Cr-Commit-Position: refs/heads/master@{#423845}
parent 1925b478
...@@ -666,8 +666,10 @@ void GaiaCookieManagerService::OnLogOutSuccess() { ...@@ -666,8 +666,10 @@ void GaiaCookieManagerService::OnLogOutSuccess() {
VLOG(1) << "GaiaCookieManagerService::OnLogOutSuccess"; VLOG(1) << "GaiaCookieManagerService::OnLogOutSuccess";
list_accounts_stale_ = true; list_accounts_stale_ = true;
fetcher_backoff_.InformOfRequest(true); fetcher_backoff_.InformOfRequest(true);
FOR_EACH_OBSERVER(Observer, observer_list_,
OnLogOutAccountsFromCookieCompleted(
GoogleServiceAuthError(GoogleServiceAuthError::NONE)));
HandleNextRequest(); HandleNextRequest();
} }
...@@ -687,6 +689,8 @@ void GaiaCookieManagerService::OnLogOutFailure( ...@@ -687,6 +689,8 @@ void GaiaCookieManagerService::OnLogOutFailure(
return; return;
} }
FOR_EACH_OBSERVER(Observer, observer_list_,
OnLogOutAccountsFromCookieCompleted(error));
HandleNextRequest(); HandleNextRequest();
} }
......
...@@ -80,11 +80,16 @@ class GaiaCookieManagerService : public KeyedService, ...@@ -80,11 +80,16 @@ class GaiaCookieManagerService : public KeyedService,
public: public:
// Called whenever a merge session is completed. The account that was // Called whenever a merge session is completed. The account that was
// merged is given by |account_id|. If |error| is equal to // merged is given by |account_id|. If |error| is equal to
// GoogleServiceAuthError::AuthErrorNone() then the merge succeeeded. // GoogleServiceAuthError::AuthErrorNone() then the merge succeeded.
virtual void OnAddAccountToCookieCompleted( virtual void OnAddAccountToCookieCompleted(
const std::string& account_id, const std::string& account_id,
const GoogleServiceAuthError& error) {} const GoogleServiceAuthError& error) {}
// Called whenever a logout is completed. If |error| is equal to
// GoogleServiceAuthError::AuthErrorNone() then the logout succeeded.
virtual void OnLogOutAccountsFromCookieCompleted(
const GoogleServiceAuthError& error) {}
// Called whenever the GaiaCookieManagerService's list of GAIA accounts is // Called whenever the GaiaCookieManagerService's list of GAIA accounts is
// updated. The GCMS monitors the APISID cookie and triggers a /ListAccounts // updated. The GCMS monitors the APISID cookie and triggers a /ListAccounts
// call on change. The GCMS will also call ListAccounts upon the first call // call on change. The GCMS will also call ListAccounts upon the first call
......
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