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

Unified Diff: components/signin/core/browser/signin_client.h

Issue 695553002: Account reconcilor: Use cookie store cookie changed subscription. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Upstream the entire change Created 6 years, 2 months 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/signin_client.h
diff --git a/components/signin/core/browser/signin_client.h b/components/signin/core/browser/signin_client.h
index 7a48a0b284839e77f68f3234c2b57d272acaf5fa..e1e9766521da823576bd0e5c52ce897d2d95826b 100644
--- a/components/signin/core/browser/signin_client.h
+++ b/components/signin/core/browser/signin_client.h
@@ -10,13 +10,14 @@
#include "base/time/time.h"
#include "components/keyed_service/core/keyed_service.h"
#include "components/signin/core/browser/webdata/token_web_data.h"
+#include "net/cookies/cookie_store.h"
+#include "url/gurl.h"
class PrefService;
class SigninManagerBase;
class TokenWebData;
namespace net {
-class CanonicalCookie;
class URLRequestContextGetter;
}
@@ -32,11 +33,11 @@ class ProfileOAuth2TokenServiceIOSProvider;
// embedder.
class SigninClient : public KeyedService {
public:
- typedef base::Callback<void(const net::CanonicalCookie* cookie)>
- CookieChangedCallback;
-
- typedef base::CallbackList<void(const net::CanonicalCookie* cookie)>
- CookieChangedCallbackList;
+// The subcription for cookie changed notifications.
droger 2014/10/31 12:42:01 Indent.
msarda 2014/10/31 13:18:40 Done.
+ class CookieChangedSubscription {
droger 2014/10/31 12:42:01 Do we need this class? An alternative to this wou
msarda 2014/10/31 13:18:40 This interface lives in //components. The implemen
droger 2014/10/31 13:56:09 The implementation could be in components too (I k
+ public:
+ virtual ~CookieChangedSubscription() {};
droger 2014/10/31 12:42:01 Should this be pure virtual?
msarda 2014/10/31 13:18:40 I tried this yesterday and it did not build. What
droger 2014/10/31 13:56:09 I thought it would be nice to prevent people to in
+ };
~SigninClient() override {}
@@ -70,12 +71,14 @@ class SigninClient : public KeyedService {
// Signin component is being used.
virtual std::string GetProductVersion() = 0;
- // Adds or removes a callback that should be called when a cookie changes.
- // TODO(blundell): Eliminate this interface in favor of having core signin
- // code observe cookie changes once //chrome/browser/net has been
- // componentized.
- virtual scoped_ptr<CookieChangedCallbackList::Subscription>
- AddCookieChangedCallback(const CookieChangedCallback& callback) = 0;
+ // Adds a callback to be called each time a cookie for |url| with name |name|
+ // changes.
+ // Note that |callback| will always be called on the thread that
+ // |AddCookieChangedCallback| was called on.
+ virtual scoped_ptr<CookieChangedSubscription> AddCookieChangedCallback(
+ const GURL& url,
+ const std::string& name,
+ const net::CookieStore::CookieChangedCallback& callback) = 0;
// Called when Google signin has succeeded.
virtual void GoogleSigninSucceeded(const std::string& account_id,

Powered by Google App Engine
This is Rietveld 408576698