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_TEST_BASE_TESTING_PROFILE_H_ | 5 #ifndef CHROME_TEST_BASE_TESTING_PROFILE_H_ |
6 #define CHROME_TEST_BASE_TESTING_PROFILE_H_ | 6 #define CHROME_TEST_BASE_TESTING_PROFILE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 } | 236 } |
237 #endif // defined(OS_CHROMEOS) | 237 #endif // defined(OS_CHROMEOS) |
238 | 238 |
239 virtual PrefProxyConfigTracker* GetProxyConfigTracker() OVERRIDE; | 239 virtual PrefProxyConfigTracker* GetProxyConfigTracker() OVERRIDE; |
240 | 240 |
241 // Schedules a task on the history backend and runs a nested loop until the | 241 // Schedules a task on the history backend and runs a nested loop until the |
242 // task is processed. This has the effect of blocking the caller until the | 242 // task is processed. This has the effect of blocking the caller until the |
243 // history service processes all pending requests. | 243 // history service processes all pending requests. |
244 void BlockUntilHistoryProcessesPendingRequests(); | 244 void BlockUntilHistoryProcessesPendingRequests(); |
245 | 245 |
246 virtual ChromeURLDataManager* GetChromeURLDataManager() OVERRIDE; | |
247 virtual chrome_browser_net::Predictor* GetNetworkPredictor() OVERRIDE; | 246 virtual chrome_browser_net::Predictor* GetNetworkPredictor() OVERRIDE; |
248 virtual void ClearNetworkingHistorySince(base::Time time) OVERRIDE; | 247 virtual void ClearNetworkingHistorySince(base::Time time) OVERRIDE; |
249 virtual GURL GetHomePage() OVERRIDE; | 248 virtual GURL GetHomePage() OVERRIDE; |
250 | 249 |
251 virtual PrefService* GetOffTheRecordPrefs() OVERRIDE; | 250 virtual PrefService* GetOffTheRecordPrefs() OVERRIDE; |
252 | 251 |
253 protected: | 252 protected: |
254 base::Time start_time_; | 253 base::Time start_time_; |
255 scoped_ptr<PrefService> prefs_; | 254 scoped_ptr<PrefService> prefs_; |
256 // ref only for right type, lifecycle is managed by prefs_ | 255 // ref only for right type, lifecycle is managed by prefs_ |
257 TestingPrefService* testing_prefs_; | 256 TestingPrefService* testing_prefs_; |
258 | 257 |
259 private: | 258 private: |
260 // Common initialization between the two constructors. | 259 // Common initialization between the two constructors. |
261 void Init(); | 260 void Init(); |
262 | 261 |
263 // Finishes initialization when a profile is created asynchronously. | 262 // Finishes initialization when a profile is created asynchronously. |
264 void FinishInit(); | 263 void FinishInit(); |
265 | 264 |
266 // Destroys favicon service if it has been created. | 265 // Destroys favicon service if it has been created. |
267 void DestroyFaviconService(); | 266 void DestroyFaviconService(); |
268 | 267 |
269 // If the webdata service has been created, it is destroyed. This is invoked | 268 // If the webdata service has been created, it is destroyed. This is invoked |
270 // from the destructor. | 269 // from the destructor. |
271 void DestroyWebDataService(); | 270 void DestroyWebDataService(); |
272 | 271 |
273 // Creates a TestingPrefService and associates it with the TestingProfile. | 272 // Creates a TestingPrefService and associates it with the TestingProfile. |
274 void CreateTestingPrefService(); | 273 void CreateTestingPrefService(); |
275 | 274 |
| 275 virtual base::Callback<ChromeURLDataManagerBackend*(void)> |
| 276 GetChromeURLDataManagerBackendGetter() const OVERRIDE; |
| 277 |
276 // The favicon service. Only created if CreateFaviconService is invoked. | 278 // The favicon service. Only created if CreateFaviconService is invoked. |
277 scoped_ptr<FaviconService> favicon_service_; | 279 scoped_ptr<FaviconService> favicon_service_; |
278 | 280 |
279 // The history service. Only created if CreateHistoryService is invoked. | 281 // The history service. Only created if CreateHistoryService is invoked. |
280 scoped_refptr<HistoryService> history_service_; | 282 scoped_refptr<HistoryService> history_service_; |
281 | 283 |
282 // The BookmarkModel. Only created if CreateBookmarkModel is invoked. | 284 // The BookmarkModel. Only created if CreateBookmarkModel is invoked. |
283 scoped_ptr<BookmarkModel> bookmark_bar_model_; | 285 scoped_ptr<BookmarkModel> bookmark_bar_model_; |
284 | 286 |
285 // The ProtocolHandlerRegistry. Only created if CreateProtocolHandlerRegistry | 287 // The ProtocolHandlerRegistry. Only created if CreateProtocolHandlerRegistry |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 scoped_ptr<PrefProxyConfigTracker> pref_proxy_config_tracker_; | 328 scoped_ptr<PrefProxyConfigTracker> pref_proxy_config_tracker_; |
327 | 329 |
328 // We use a temporary directory to store testing profile data. In a multi- | 330 // We use a temporary directory to store testing profile data. In a multi- |
329 // profile environment, this is invalid and the directory is managed by the | 331 // profile environment, this is invalid and the directory is managed by the |
330 // TestingProfileManager. | 332 // TestingProfileManager. |
331 ScopedTempDir temp_dir_; | 333 ScopedTempDir temp_dir_; |
332 // The path to this profile. This will be valid in either of the two above | 334 // The path to this profile. This will be valid in either of the two above |
333 // cases. | 335 // cases. |
334 FilePath profile_path_; | 336 FilePath profile_path_; |
335 | 337 |
336 scoped_ptr<ChromeURLDataManager> chrome_url_data_manager_; | |
337 | |
338 // We keep a weak pointer to the dependency manager we want to notify on our | 338 // We keep a weak pointer to the dependency manager we want to notify on our |
339 // death. Defaults to the Singleton implementation but overridable for | 339 // death. Defaults to the Singleton implementation but overridable for |
340 // testing. | 340 // testing. |
341 ProfileDependencyManager* profile_dependency_manager_; | 341 ProfileDependencyManager* profile_dependency_manager_; |
342 | 342 |
343 scoped_ptr<content::MockResourceContext> resource_context_; | 343 scoped_ptr<content::MockResourceContext> resource_context_; |
344 | 344 |
345 // Weak pointer to a delegate for indicating that a profile was created. | 345 // Weak pointer to a delegate for indicating that a profile was created. |
346 Delegate* delegate_; | 346 Delegate* delegate_; |
347 }; | 347 }; |
348 | 348 |
349 #endif // CHROME_TEST_BASE_TESTING_PROFILE_H_ | 349 #endif // CHROME_TEST_BASE_TESTING_PROFILE_H_ |
OLD | NEW |