X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fcomponents%2Fsignin%2Fcore%2Fbrowser%2Fsignin_client.h;h=fafcada2b6eff07bb01c1b1f6b7463f8bebaa317;hb=4a1a0bdd01eef90b0826a0e761d3379d3715c10f;hp=ebee1a67dd5d21f884c2489a74f1d59ff1ad7729;hpb=b1be5ca53587d23e7aeb77b26861fdc0a181ffd8;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/components/signin/core/browser/signin_client.h b/src/components/signin/core/browser/signin_client.h index ebee1a6..fafcada 100644 --- a/src/components/signin/core/browser/signin_client.h +++ b/src/components/signin/core/browser/signin_client.h @@ -6,6 +6,8 @@ #define COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_CLIENT_H_ #include "base/callback.h" +#include "base/callback_list.h" +#include "base/time/time.h" #include "components/keyed_service/core/keyed_service.h" #include "components/signin/core/browser/webdata/token_web_data.h" @@ -33,6 +35,9 @@ class SigninClient : public KeyedService { typedef base::Callback CookieChangedCallback; + typedef base::CallbackList + CookieChangedCallbackList; + virtual ~SigninClient() {} // Gets the preferences associated with the client. @@ -44,6 +49,16 @@ class SigninClient : public KeyedService { // Returns whether it is possible to revoke credentials. virtual bool CanRevokeCredentials() = 0; + // Returns device id that is scoped to single signin. This device id will be + // regenerated if user signs out and signs back in. + // When refresh token is requested for this user it will be annotated with + // this device id. + virtual std::string GetSigninScopedDeviceId() = 0; + + // Clears signin scoped device id. This happens when user signs out or about + // to sign in. + virtual void ClearSigninScopedDeviceId() = 0; + // Returns the URL request context information associated with the client. virtual net::URLRequestContextGetter* GetURLRequestContext() = 0; @@ -55,13 +70,12 @@ class SigninClient : public KeyedService { // Signin component is being used. virtual std::string GetProductVersion() = 0; - // Sets the callback that should be called when a cookie changes. The - // callback will be called only if it is not empty. + // 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 void SetCookieChangedCallback( - const CookieChangedCallback& callback) = 0; + virtual scoped_ptr + AddCookieChangedCallback(const CookieChangedCallback& callback) = 0; // Called when Google signin has succeeded. virtual void GoogleSigninSucceeded(const std::string& username, @@ -72,6 +86,8 @@ class SigninClient : public KeyedService { virtual bool IsSigninProcess(int host_id) const = 0; virtual bool HasSigninProcess() const = 0; + virtual bool IsFirstRun() const = 0; + virtual base::Time GetInstallDate() = 0; #if defined(OS_IOS) // TODO(msarda): http://crbug.com/358544 Remove this iOS specific code from