OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_BROWSER_SYNC_TEST_PROFILE_SYNC_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_SYNC_TEST_PROFILE_SYNC_SERVICE_H_ |
6 #define CHROME_BROWSER_SYNC_TEST_PROFILE_SYNC_SERVICE_H_ | 6 #define CHROME_BROWSER_SYNC_TEST_PROFILE_SYNC_SERVICE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 } // namespace browser_sync | 112 } // namespace browser_sync |
113 | 113 |
114 class TestProfileSyncService : public ProfileSyncService { | 114 class TestProfileSyncService : public ProfileSyncService { |
115 public: | 115 public: |
116 // TODO(tim): Remove |synchronous_backend_initialization|, and add ability to | 116 // TODO(tim): Remove |synchronous_backend_initialization|, and add ability to |
117 // inject TokenService alongside SigninManager. | 117 // inject TokenService alongside SigninManager. |
118 TestProfileSyncService( | 118 TestProfileSyncService( |
119 ProfileSyncComponentsFactory* factory, | 119 ProfileSyncComponentsFactory* factory, |
120 Profile* profile, | 120 Profile* profile, |
121 SigninManagerBase* signin, | 121 SigninManagerBase* signin, |
122 OAuth2TokenService* oauth2_token_service, | 122 ProfileOAuth2TokenService* oauth2_token_service, |
123 ProfileSyncService::StartBehavior behavior, | 123 ProfileSyncService::StartBehavior behavior, |
124 bool synchronous_backend_initialization); | 124 bool synchronous_backend_initialization); |
125 | 125 |
126 virtual ~TestProfileSyncService(); | 126 virtual ~TestProfileSyncService(); |
127 | 127 |
128 virtual void RequestAccessToken() OVERRIDE; | 128 virtual void RequestAccessToken() OVERRIDE; |
129 virtual void OnGetTokenFailure(const OAuth2TokenService::Request* request, | 129 virtual void OnGetTokenFailure(const OAuth2TokenService::Request* request, |
130 const GoogleServiceAuthError& error) OVERRIDE; | 130 const GoogleServiceAuthError& error) OVERRIDE; |
131 | 131 |
132 virtual void OnBackendInitialized( | 132 virtual void OnBackendInitialized( |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 bool set_initial_sync_ended_on_init_; | 192 bool set_initial_sync_ended_on_init_; |
193 | 193 |
194 bool fail_initial_download_; | 194 bool fail_initial_download_; |
195 syncer::StorageOption storage_option_; | 195 syncer::StorageOption storage_option_; |
196 }; | 196 }; |
197 | 197 |
198 | 198 |
199 class FakeOAuth2TokenService : public ProfileOAuth2TokenService { | 199 class FakeOAuth2TokenService : public ProfileOAuth2TokenService { |
200 public: | 200 public: |
201 virtual scoped_ptr<OAuth2TokenService::Request> StartRequest( | 201 virtual scoped_ptr<OAuth2TokenService::Request> StartRequest( |
| 202 const std::string& account_id, |
202 const OAuth2TokenService::ScopeSet& scopes, | 203 const OAuth2TokenService::ScopeSet& scopes, |
203 OAuth2TokenService::Consumer* consumer) OVERRIDE; | 204 OAuth2TokenService::Consumer* consumer) OVERRIDE; |
204 | 205 |
205 static BrowserContextKeyedService* BuildTokenService( | 206 static BrowserContextKeyedService* BuildTokenService( |
206 content::BrowserContext* context); | 207 content::BrowserContext* context); |
| 208 |
| 209 protected: |
| 210 virtual void PersistCredentials(const std::string& account_id, |
| 211 const std::string& refresh_token) OVERRIDE; |
| 212 |
| 213 virtual void ClearPersistedCredentials( |
| 214 const std::string& account_id) OVERRIDE; |
207 }; | 215 }; |
208 | 216 |
209 #endif // CHROME_BROWSER_SYNC_TEST_PROFILE_SYNC_SERVICE_H_ | 217 #endif // CHROME_BROWSER_SYNC_TEST_PROFILE_SYNC_SERVICE_H_ |
OLD | NEW |