Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(185)

Unified Diff: components/signin/core/browser/about_signin_internals.cc

Issue 695553002: Account reconcilor: Use cookie store cookie changed subscription. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/signin/core/browser/about_signin_internals.cc
diff --git a/components/signin/core/browser/about_signin_internals.cc b/components/signin/core/browser/about_signin_internals.cc
index 982e0e23dc683d09181e724dc213ddf6b2a47713..ca959386527cae7c502194b06c9b6805800c964c 100644
--- a/components/signin/core/browser/about_signin_internals.cc
+++ b/components/signin/core/browser/about_signin_internals.cc
@@ -209,8 +209,10 @@ void AboutSigninInternals::Initialize(SigninClient* client) {
signin_manager_->AddSigninDiagnosticsObserver(this);
token_service_->AddDiagnosticsObserver(this);
cookie_changed_subscription_ = client_->AddCookieChangedCallback(
- base::Bind(&AboutSigninInternals::OnCookieChanged,
- base::Unretained(this)));
+ GaiaUrls::GetInstance()->gaia_url(),
+ "LSID",
+ base::Bind(&AboutSigninInternals::OnCookieChanged,
+ base::Unretained(this)));
}
void AboutSigninInternals::Shutdown() {
@@ -285,12 +287,11 @@ void AboutSigninInternals::OnAuthenticationResultReceived(std::string status) {
NotifySigninValueChanged(AUTHENTICATION_RESULT_RECEIVED, status);
}
-void AboutSigninInternals::OnCookieChanged(
- const net::CanonicalCookie* cookie) {
- if (cookie->Name() == "LSID" &&
- cookie->Domain() == GaiaUrls::GetInstance()->gaia_url().host() &&
- cookie->IsSecure() &&
- cookie->IsHttpOnly()) {
+void AboutSigninInternals::OnCookieChanged(const net::CanonicalCookie& cookie,
+ bool removed) {
+ DCHECK_EQ("LSID", cookie.Name());
+ DCHECK_EQ(GaiaUrls::GetInstance()->gaia_url().host(), cookie.Domain());
+ if (cookie.IsSecure() && cookie.IsHttpOnly()) {
GetCookieAccountsAsync();
}
}
« no previous file with comments | « components/signin/core/browser/about_signin_internals.h ('k') | components/signin/core/browser/account_reconcilor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698