| 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" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 // returns it. The profile keeps its own copy of a scoped_refptr to the | 125 // 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 | 126 // ExtensionService to make sure that is still alive to be notified when the |
| 127 // profile is destroyed. | 127 // profile is destroyed. |
| 128 ExtensionService* CreateExtensionService(const CommandLine* command_line, | 128 ExtensionService* CreateExtensionService(const CommandLine* command_line, |
| 129 const FilePath& install_directory, | 129 const FilePath& install_directory, |
| 130 bool autoupdate_enabled); | 130 bool autoupdate_enabled); |
| 131 | 131 |
| 132 TestingPrefService* GetTestingPrefService(); | 132 TestingPrefService* GetTestingPrefService(); |
| 133 | 133 |
| 134 virtual TestingProfile* AsTestingProfile(); | 134 virtual TestingProfile* AsTestingProfile(); |
| 135 | |
| 136 virtual std::string GetProfileName(); | 135 virtual std::string GetProfileName(); |
| 137 virtual ProfileId GetRuntimeId(); | |
| 138 | |
| 139 virtual FilePath GetPath(); | 136 virtual FilePath GetPath(); |
| 140 | 137 void set_incognito(bool incognito) { incognito_ = incognito; } |
| 141 // Sets whether we're incognito. Default is false. | |
| 142 void set_incognito(bool incognito) { | |
| 143 incognito_ = incognito; | |
| 144 } | |
| 145 virtual bool IsOffTheRecord(); | 138 virtual bool IsOffTheRecord(); |
| 146 // Assumes ownership. | 139 // Assumes ownership. |
| 147 virtual void SetOffTheRecordProfile(Profile* profile); | 140 virtual void SetOffTheRecordProfile(Profile* profile); |
| 148 virtual Profile* GetOffTheRecordProfile(); | 141 virtual Profile* GetOffTheRecordProfile(); |
| 149 | |
| 150 virtual void DestroyOffTheRecordProfile() {} | 142 virtual void DestroyOffTheRecordProfile() {} |
| 151 | |
| 152 virtual bool HasOffTheRecordProfile(); | 143 virtual bool HasOffTheRecordProfile(); |
| 153 | |
| 154 virtual Profile* GetOriginalProfile(); | 144 virtual Profile* GetOriginalProfile(); |
| 155 virtual ChromeAppCacheService* GetAppCacheService(); | 145 virtual ChromeAppCacheService* GetAppCacheService(); |
| 156 virtual webkit_database::DatabaseTracker* GetDatabaseTracker(); | 146 virtual webkit_database::DatabaseTracker* GetDatabaseTracker(); |
| 157 virtual VisitedLinkMaster* GetVisitedLinkMaster(); | 147 virtual VisitedLinkMaster* GetVisitedLinkMaster(); |
| 158 virtual ExtensionService* GetExtensionService(); | 148 virtual ExtensionService* GetExtensionService(); |
| 159 virtual UserScriptMaster* GetUserScriptMaster(); | 149 virtual UserScriptMaster* GetUserScriptMaster(); |
| 160 virtual ExtensionDevToolsManager* GetExtensionDevToolsManager(); | 150 virtual ExtensionDevToolsManager* GetExtensionDevToolsManager(); |
| 161 virtual ExtensionProcessManager* GetExtensionProcessManager(); | 151 virtual ExtensionProcessManager* GetExtensionProcessManager(); |
| 162 virtual ExtensionMessageService* GetExtensionMessageService(); | 152 virtual ExtensionMessageService* GetExtensionMessageService(); |
| 163 virtual ExtensionEventRouter* GetExtensionEventRouter(); | 153 virtual ExtensionEventRouter* GetExtensionEventRouter(); |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 scoped_ptr<ChromeURLDataManager> chrome_url_data_manager_; | 378 scoped_ptr<ChromeURLDataManager> chrome_url_data_manager_; |
| 389 | 379 |
| 390 scoped_ptr<prerender::PrerenderManager> prerender_manager_; | 380 scoped_ptr<prerender::PrerenderManager> prerender_manager_; |
| 391 | 381 |
| 392 // We keep a weak pointer to the dependency manager we want to notify on our | 382 // 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 | 383 // death. Defaults to the Singleton implementation but overridable for |
| 394 // testing. | 384 // testing. |
| 395 ProfileDependencyManager* profile_dependency_manager_; | 385 ProfileDependencyManager* profile_dependency_manager_; |
| 396 }; | 386 }; |
| 397 | 387 |
| 398 // A profile that derives from another profile. This does not actually | |
| 399 // override anything except the GetRuntimeId() in order to test sharing of | |
| 400 // site information. | |
| 401 class DerivedTestingProfile : public TestingProfile { | |
| 402 public: | |
| 403 explicit DerivedTestingProfile(Profile* profile); | |
| 404 virtual ~DerivedTestingProfile(); | |
| 405 | |
| 406 virtual ProfileId GetRuntimeId(); | |
| 407 | |
| 408 protected: | |
| 409 Profile* original_profile_; | |
| 410 }; | |
| 411 | |
| 412 #endif // CHROME_TEST_TESTING_PROFILE_H_ | 388 #endif // CHROME_TEST_TESTING_PROFILE_H_ |
| OLD | NEW |