| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_TEST_TESTING_PROFILE_H_ | 5 #ifndef CHROME_TEST_TESTING_PROFILE_H_ |
| 6 #define CHROME_TEST_TESTING_PROFILE_H_ | 6 #define CHROME_TEST_TESTING_PROFILE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/ref_counted.h" | 9 #include "base/ref_counted.h" |
| 10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 } | 173 } |
| 174 virtual WebDataService* GetWebDataService(ServiceAccessType access) { | 174 virtual WebDataService* GetWebDataService(ServiceAccessType access) { |
| 175 return web_data_service_.get(); | 175 return web_data_service_.get(); |
| 176 } | 176 } |
| 177 virtual WebDataService* GetWebDataServiceWithoutCreating() { | 177 virtual WebDataService* GetWebDataServiceWithoutCreating() { |
| 178 return web_data_service_.get(); | 178 return web_data_service_.get(); |
| 179 } | 179 } |
| 180 virtual PasswordStore* GetPasswordStore(ServiceAccessType access) { | 180 virtual PasswordStore* GetPasswordStore(ServiceAccessType access) { |
| 181 return NULL; | 181 return NULL; |
| 182 } | 182 } |
| 183 // Initialized the profile's PrefService with an explicity specified | 183 // Sets the profile's PrefService. If a pref service hasn't been explicitly |
| 184 // PrefService. Must be called before the TestingProfile. | 184 // set GetPrefs creates one, so normally you need not invoke this. If you need |
| 185 // The profile takes ownership of |pref|. | 185 // to set a pref service you must invoke this before GetPrefs. |
| 186 // TestingPrefService takes ownership of |prefs|. |
| 186 void SetPrefService(PrefService* prefs); | 187 void SetPrefService(PrefService* prefs); |
| 187 virtual PrefService* GetPrefs(); | 188 virtual PrefService* GetPrefs(); |
| 188 virtual TemplateURLModel* GetTemplateURLModel() { | 189 virtual TemplateURLModel* GetTemplateURLModel() { |
| 189 return template_url_model_.get(); | 190 return template_url_model_.get(); |
| 190 } | 191 } |
| 191 virtual TemplateURLFetcher* GetTemplateURLFetcher() { | 192 virtual TemplateURLFetcher* GetTemplateURLFetcher() { |
| 192 return template_url_fetcher_.get(); | 193 return template_url_fetcher_.get(); |
| 193 } | 194 } |
| 194 virtual history::TopSites* GetTopSites(); | 195 virtual history::TopSites* GetTopSites(); |
| 195 virtual history::TopSites* GetTopSitesWithoutCreating() { | 196 virtual history::TopSites* GetTopSitesWithoutCreating() { |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 void BlockUntilHistoryProcessesPendingRequests(); | 300 void BlockUntilHistoryProcessesPendingRequests(); |
| 300 | 301 |
| 301 // Creates and initializes a profile sync service if the tests require one. | 302 // Creates and initializes a profile sync service if the tests require one. |
| 302 virtual TokenService* GetTokenService(); | 303 virtual TokenService* GetTokenService(); |
| 303 virtual ProfileSyncService* GetProfileSyncService(); | 304 virtual ProfileSyncService* GetProfileSyncService(); |
| 304 virtual ProfileSyncService* GetProfileSyncService( | 305 virtual ProfileSyncService* GetProfileSyncService( |
| 305 const std::string& cros_notes); | 306 const std::string& cros_notes); |
| 306 virtual CloudPrintProxyService* GetCloudPrintProxyService() { return NULL; } | 307 virtual CloudPrintProxyService* GetCloudPrintProxyService() { return NULL; } |
| 307 virtual ChromeBlobStorageContext* GetBlobStorageContext() { return NULL; } | 308 virtual ChromeBlobStorageContext* GetBlobStorageContext() { return NULL; } |
| 308 virtual ExtensionInfoMap* GetExtensionInfoMap() { return NULL; } | 309 virtual ExtensionInfoMap* GetExtensionInfoMap() { return NULL; } |
| 310 virtual PromoCounter* GetInstantPromoCounter() { return NULL; } |
| 309 | 311 |
| 310 protected: | 312 protected: |
| 311 base::Time start_time_; | 313 base::Time start_time_; |
| 312 scoped_ptr<PrefService> prefs_; | 314 scoped_ptr<PrefService> prefs_; |
| 313 // ref only for right type, lifecycle is managed by prefs_ | 315 // ref only for right type, lifecycle is managed by prefs_ |
| 314 TestingPrefService* testing_prefs_; | 316 TestingPrefService* testing_prefs_; |
| 315 | 317 |
| 316 private: | 318 private: |
| 317 // Destroys favicon service if it has been created. | 319 // Destroys favicon service if it has been created. |
| 318 void DestroyFaviconService(); | 320 void DestroyFaviconService(); |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 | 417 |
| 416 virtual ProfileId GetRuntimeId() { | 418 virtual ProfileId GetRuntimeId() { |
| 417 return original_profile_->GetRuntimeId(); | 419 return original_profile_->GetRuntimeId(); |
| 418 } | 420 } |
| 419 | 421 |
| 420 protected: | 422 protected: |
| 421 Profile* original_profile_; | 423 Profile* original_profile_; |
| 422 }; | 424 }; |
| 423 | 425 |
| 424 #endif // CHROME_TEST_TESTING_PROFILE_H_ | 426 #endif // CHROME_TEST_TESTING_PROFILE_H_ |
| OLD | NEW |