| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_SIGNIN_CORE_BROWSER_TEST_SIGNIN_CLIENT_H_ | 5 #ifndef COMPONENTS_SIGNIN_CORE_BROWSER_TEST_SIGNIN_CLIENT_H_ |
| 6 #define COMPONENTS_SIGNIN_CORE_BROWSER_TEST_SIGNIN_CLIENT_H_ | 6 #define COMPONENTS_SIGNIN_CORE_BROWSER_TEST_SIGNIN_CLIENT_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 // Returns empty string. | 44 // Returns empty string. |
| 45 virtual std::string GetSigninScopedDeviceId() OVERRIDE; | 45 virtual std::string GetSigninScopedDeviceId() OVERRIDE; |
| 46 | 46 |
| 47 // Does nothing. | 47 // Does nothing. |
| 48 virtual void ClearSigninScopedDeviceId() OVERRIDE; | 48 virtual void ClearSigninScopedDeviceId() OVERRIDE; |
| 49 | 49 |
| 50 // Returns the empty string. | 50 // Returns the empty string. |
| 51 virtual std::string GetProductVersion() OVERRIDE; | 51 virtual std::string GetProductVersion() OVERRIDE; |
| 52 | 52 |
| 53 // Returns a TestURLRequestContextGetter. | 53 // Returns a TestURLRequestContextGetter or an manually provided |
| 54 // URLRequestContextGetter. |
| 54 virtual net::URLRequestContextGetter* GetURLRequestContext() OVERRIDE; | 55 virtual net::URLRequestContextGetter* GetURLRequestContext() OVERRIDE; |
| 55 | 56 |
| 57 // For testing purposes, can override the TestURLRequestContextGetter created |
| 58 // in the default constructor. |
| 59 void SetURLRequestContext(net::URLRequestContextGetter* request_context); |
| 60 |
| 56 #if defined(OS_IOS) | 61 #if defined(OS_IOS) |
| 57 virtual ios::ProfileOAuth2TokenServiceIOSProvider* GetIOSProvider() OVERRIDE; | 62 virtual ios::ProfileOAuth2TokenServiceIOSProvider* GetIOSProvider() OVERRIDE; |
| 58 #endif | 63 #endif |
| 59 | 64 |
| 60 // Returns true. | 65 // Returns true. |
| 61 virtual bool ShouldMergeSigninCredentialsIntoCookieJar() OVERRIDE; | 66 virtual bool ShouldMergeSigninCredentialsIntoCookieJar() OVERRIDE; |
| 62 | 67 |
| 63 // Does nothing. | 68 // Does nothing. |
| 64 virtual scoped_ptr<CookieChangedCallbackList::Subscription> | 69 virtual scoped_ptr<CookieChangedCallbackList::Subscription> |
| 65 AddCookieChangedCallback(const CookieChangedCallback& callback) OVERRIDE; | 70 AddCookieChangedCallback(const CookieChangedCallback& callback) OVERRIDE; |
| 66 | 71 |
| 67 #if defined(OS_IOS) | 72 #if defined(OS_IOS) |
| 68 ios::FakeProfileOAuth2TokenServiceIOSProvider* GetIOSProviderAsFake(); | 73 ios::FakeProfileOAuth2TokenServiceIOSProvider* GetIOSProviderAsFake(); |
| 69 #endif | 74 #endif |
| 70 | 75 |
| 71 // SigninClient overrides: | 76 // SigninClient overrides: |
| 72 virtual void SetSigninProcess(int host_id) OVERRIDE; | 77 virtual void SetSigninProcess(int host_id) OVERRIDE; |
| 73 virtual void ClearSigninProcess() OVERRIDE; | 78 virtual void ClearSigninProcess() OVERRIDE; |
| 74 virtual bool IsSigninProcess(int host_id) const OVERRIDE; | 79 virtual bool IsSigninProcess(int host_id) const OVERRIDE; |
| 75 virtual bool HasSigninProcess() const OVERRIDE; | 80 virtual bool HasSigninProcess() const OVERRIDE; |
| 81 virtual bool IsFirstRun() const OVERRIDE; |
| 82 virtual base::Time GetInstallDate() OVERRIDE; |
| 76 | 83 |
| 77 private: | 84 private: |
| 78 // Loads the token database. | 85 // Loads the token database. |
| 79 void LoadDatabase(); | 86 void LoadDatabase(); |
| 80 | 87 |
| 81 base::ScopedTempDir temp_dir_; | 88 base::ScopedTempDir temp_dir_; |
| 82 scoped_refptr<net::TestURLRequestContextGetter> request_context_; | 89 scoped_refptr<net::URLRequestContextGetter> request_context_; |
| 83 scoped_refptr<TokenWebData> database_; | 90 scoped_refptr<TokenWebData> database_; |
| 84 int signin_host_id_; | 91 int signin_host_id_; |
| 85 CookieChangedCallbackList cookie_callbacks_; | 92 CookieChangedCallbackList cookie_callbacks_; |
| 86 | 93 |
| 87 PrefService* pref_service_; | 94 PrefService* pref_service_; |
| 88 | 95 |
| 89 #if defined(OS_IOS) | 96 #if defined(OS_IOS) |
| 90 scoped_ptr<ios::FakeProfileOAuth2TokenServiceIOSProvider> iosProvider_; | 97 scoped_ptr<ios::FakeProfileOAuth2TokenServiceIOSProvider> iosProvider_; |
| 91 #endif | 98 #endif |
| 92 | 99 |
| 93 DISALLOW_COPY_AND_ASSIGN(TestSigninClient); | 100 DISALLOW_COPY_AND_ASSIGN(TestSigninClient); |
| 94 }; | 101 }; |
| 95 | 102 |
| 96 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_TEST_SIGNIN_CLIENT_H_ | 103 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_TEST_SIGNIN_CLIENT_H_ |
| OLD | NEW |