1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_SIGNIN_CHROME_SIGNIN_CLIENT_H_
6 #define CHROME_BROWSER_SIGNIN_CHROME_SIGNIN_CLIENT_H_
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "components/signin/core/browser/signin_client.h"
11 #include "components/signin/core/browser/signin_error_controller.h"
16 class ChromeSigninClient
: public SigninClient
,
17 public SigninErrorController::Observer
{
19 explicit ChromeSigninClient(
20 Profile
* profile
, SigninErrorController
* signin_error_controller
);
21 ~ChromeSigninClient() override
;
24 static bool ProfileAllowsSigninCookies(Profile
* profile
);
25 static bool SettingsAllowSigninCookies(CookieSettings
* cookie_settings
);
27 // SigninClient implementation.
28 PrefService
* GetPrefs() override
;
29 scoped_refptr
<TokenWebData
> GetDatabase() override
;
30 bool CanRevokeCredentials() override
;
31 std::string
GetSigninScopedDeviceId() override
;
32 void OnSignedOut() override
;
33 net::URLRequestContextGetter
* GetURLRequestContext() override
;
34 bool ShouldMergeSigninCredentialsIntoCookieJar() override
;
35 bool IsFirstRun() const override
;
36 base::Time
GetInstallDate() override
;
37 bool AreSigninCookiesAllowed() override
;
38 void AddContentSettingsObserver(
39 content_settings::Observer
* observer
) override
;
40 void RemoveContentSettingsObserver(
41 content_settings::Observer
* observer
) override
;
43 // Returns a string describing the chrome version environment. Version format:
44 // <Build Info> <OS> <Version number> (<Last change>)<channel or "-devel">
45 // If version information is unavailable, returns "invalid."
46 std::string
GetProductVersion() override
;
47 scoped_ptr
<CookieChangedSubscription
> AddCookieChangedCallback(
49 const std::string
& name
,
50 const net::CookieStore::CookieChangedCallback
& callback
) override
;
51 void OnSignedIn(const std::string
& account_id
,
52 const std::string
& username
,
53 const std::string
& password
) override
;
54 void PostSignedIn(const std::string
& account_id
,
55 const std::string
& username
,
56 const std::string
& password
) override
;
58 // SigninErrorController::Observer implementation.
59 void OnErrorChanged() override
;
64 SigninErrorController
* signin_error_controller_
;
66 DISALLOW_COPY_AND_ASSIGN(ChromeSigninClient
);
69 #endif // CHROME_BROWSER_SIGNIN_CHROME_SIGNIN_CLIENT_H_