| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/scoped_temp_dir.h" | 11 #include "base/scoped_temp_dir.h" |
| 12 #include "base/timer.h" | 12 #include "base/timer.h" |
| 13 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
| 14 #include "content/browser/appcache/chrome_appcache_service.h" |
| 14 | 15 |
| 15 namespace content { | 16 namespace content { |
| 16 class ResourceContextGetter; | 17 class ResourceContextGetter; |
| 17 } | 18 } |
| 18 | 19 |
| 19 namespace history { | 20 namespace history { |
| 20 class TopSites; | 21 class TopSites; |
| 21 } | 22 } |
| 22 | 23 |
| 23 namespace net { | 24 namespace net { |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 void CreateTemplateURLService(); | 123 void CreateTemplateURLService(); |
| 123 | 124 |
| 124 // Creates an ExtensionService initialized with the testing profile and | 125 // Creates an ExtensionService initialized with the testing profile and |
| 125 // returns it. The profile keeps its own copy of a scoped_refptr to the | 126 // returns it. The profile keeps its own copy of a scoped_refptr to the |
| 126 // ExtensionService to make sure that is still alive to be notified when the | 127 // ExtensionService to make sure that is still alive to be notified when the |
| 127 // profile is destroyed. | 128 // profile is destroyed. |
| 128 ExtensionService* CreateExtensionService(const CommandLine* command_line, | 129 ExtensionService* CreateExtensionService(const CommandLine* command_line, |
| 129 const FilePath& install_directory, | 130 const FilePath& install_directory, |
| 130 bool autoupdate_enabled); | 131 bool autoupdate_enabled); |
| 131 | 132 |
| 133 // Normally a TestingProfile doesn't have a ChromeAppCacheService, but this |
| 134 // function can be used for setting it if needed. |
| 135 void SetAppCacheService(ChromeAppCacheService* appcache_service); |
| 136 |
| 132 TestingPrefService* GetTestingPrefService(); | 137 TestingPrefService* GetTestingPrefService(); |
| 133 | 138 |
| 134 virtual TestingProfile* AsTestingProfile(); | 139 virtual TestingProfile* AsTestingProfile(); |
| 135 | 140 |
| 136 virtual std::string GetProfileName(); | 141 virtual std::string GetProfileName(); |
| 137 virtual ProfileId GetRuntimeId(); | 142 virtual ProfileId GetRuntimeId(); |
| 138 | 143 |
| 139 virtual FilePath GetPath(); | 144 virtual FilePath GetPath(); |
| 140 | 145 |
| 141 // Sets whether we're incognito. Default is false. | 146 // Sets whether we're incognito. Default is false. |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 ScopedTempDir temp_dir_; | 391 ScopedTempDir temp_dir_; |
| 387 | 392 |
| 388 scoped_ptr<ChromeURLDataManager> chrome_url_data_manager_; | 393 scoped_ptr<ChromeURLDataManager> chrome_url_data_manager_; |
| 389 | 394 |
| 390 scoped_ptr<prerender::PrerenderManager> prerender_manager_; | 395 scoped_ptr<prerender::PrerenderManager> prerender_manager_; |
| 391 | 396 |
| 392 // We keep a weak pointer to the dependency manager we want to notify on our | 397 // We keep a weak pointer to the dependency manager we want to notify on our |
| 393 // death. Defaults to the Singleton implementation but overridable for | 398 // death. Defaults to the Singleton implementation but overridable for |
| 394 // testing. | 399 // testing. |
| 395 ProfileDependencyManager* profile_dependency_manager_; | 400 ProfileDependencyManager* profile_dependency_manager_; |
| 401 |
| 402 scoped_refptr<ChromeAppCacheService> appcache_service_; |
| 396 }; | 403 }; |
| 397 | 404 |
| 398 // A profile that derives from another profile. This does not actually | 405 // A profile that derives from another profile. This does not actually |
| 399 // override anything except the GetRuntimeId() in order to test sharing of | 406 // override anything except the GetRuntimeId() in order to test sharing of |
| 400 // site information. | 407 // site information. |
| 401 class DerivedTestingProfile : public TestingProfile { | 408 class DerivedTestingProfile : public TestingProfile { |
| 402 public: | 409 public: |
| 403 explicit DerivedTestingProfile(Profile* profile); | 410 explicit DerivedTestingProfile(Profile* profile); |
| 404 virtual ~DerivedTestingProfile(); | 411 virtual ~DerivedTestingProfile(); |
| 405 | 412 |
| 406 virtual ProfileId GetRuntimeId(); | 413 virtual ProfileId GetRuntimeId(); |
| 407 | 414 |
| 408 protected: | 415 protected: |
| 409 Profile* original_profile_; | 416 Profile* original_profile_; |
| 410 }; | 417 }; |
| 411 | 418 |
| 412 #endif // CHROME_TEST_TESTING_PROFILE_H_ | 419 #endif // CHROME_TEST_TESTING_PROFILE_H_ |
| OLD | NEW |