| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 | 7 |
| 8 #include "base/base_paths.h" | 8 #include "base/base_paths.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| 11 #include "chrome/browser/bookmarks/bookmark_model.h" | 11 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 12 #include "chrome/browser/browser_prefs.h" | 12 #include "chrome/browser/browser_prefs.h" |
| 13 #include "chrome/browser/browser_theme_provider.h" | 13 #include "chrome/browser/browser_theme_provider.h" |
| 14 #include "chrome/browser/favicon_service.h" | 14 #include "chrome/browser/favicon_service.h" |
| 15 #include "chrome/browser/history/history.h" | 15 #include "chrome/browser/history/history.h" |
| 16 #include "chrome/browser/profile.h" | 16 #include "chrome/browser/profile.h" |
| 17 #include "chrome/browser/search_engines/template_url_model.h" | 17 #include "chrome/browser/search_engines/template_url_model.h" |
| 18 #include "chrome/browser/sessions/session_service.h" | 18 #include "chrome/browser/sessions/session_service.h" |
| 19 #include "chrome/common/pref_service.h" | 19 #include "chrome/common/pref_service.h" |
| 20 | 20 |
| 21 | |
| 22 class TestingProfile : public Profile { | 21 class TestingProfile : public Profile { |
| 23 public: | 22 public: |
| 24 TestingProfile(); | 23 TestingProfile(); |
| 25 | 24 |
| 26 // Creates a new profile by adding |count| to the end of the path. Use this | 25 // Creates a new profile by adding |count| to the end of the path. Use this |
| 27 // when you need to have more than one TestingProfile running at the same | 26 // when you need to have more than one TestingProfile running at the same |
| 28 // time. | 27 // time. |
| 29 explicit TestingProfile(int count); | 28 explicit TestingProfile(int count); |
| 30 | 29 |
| 31 virtual ~TestingProfile(); | 30 virtual ~TestingProfile(); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 // Sets whether we're off the record. Default is false. | 68 // Sets whether we're off the record. Default is false. |
| 70 void set_off_the_record(bool off_the_record) { | 69 void set_off_the_record(bool off_the_record) { |
| 71 off_the_record_ = off_the_record; | 70 off_the_record_ = off_the_record; |
| 72 } | 71 } |
| 73 virtual bool IsOffTheRecord() { return off_the_record_; } | 72 virtual bool IsOffTheRecord() { return off_the_record_; } |
| 74 virtual Profile* GetOffTheRecordProfile() { return NULL; } | 73 virtual Profile* GetOffTheRecordProfile() { return NULL; } |
| 75 | 74 |
| 76 virtual void DestroyOffTheRecordProfile() {} | 75 virtual void DestroyOffTheRecordProfile() {} |
| 77 | 76 |
| 78 virtual Profile* GetOriginalProfile() { return this; } | 77 virtual Profile* GetOriginalProfile() { return this; } |
| 78 virtual webkit_database::DatabaseTracker* GetDatabaseTracker(); |
| 79 virtual VisitedLinkMaster* GetVisitedLinkMaster() { return NULL; } | 79 virtual VisitedLinkMaster* GetVisitedLinkMaster() { return NULL; } |
| 80 virtual ExtensionsService* GetExtensionsService() { return NULL; } | 80 virtual ExtensionsService* GetExtensionsService() { return NULL; } |
| 81 virtual UserScriptMaster* GetUserScriptMaster() { return NULL; } | 81 virtual UserScriptMaster* GetUserScriptMaster() { return NULL; } |
| 82 virtual ExtensionDevToolsManager* GetExtensionDevToolsManager() { | 82 virtual ExtensionDevToolsManager* GetExtensionDevToolsManager() { |
| 83 return NULL; | 83 return NULL; |
| 84 } | 84 } |
| 85 virtual ExtensionProcessManager* GetExtensionProcessManager() { return NULL; } | 85 virtual ExtensionProcessManager* GetExtensionProcessManager() { return NULL; } |
| 86 virtual ExtensionMessageService* GetExtensionMessageService() { return NULL; } | 86 virtual ExtensionMessageService* GetExtensionMessageService() { return NULL; } |
| 87 virtual SSLHostState* GetSSLHostState() { return NULL; } | 87 virtual SSLHostState* GetSSLHostState() { return NULL; } |
| 88 virtual net::StrictTransportSecurityState* GetStrictTransportSecurityState() { | 88 virtual net::StrictTransportSecurityState* GetStrictTransportSecurityState() { |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 // Do we have a history service? This defaults to the value of | 234 // Do we have a history service? This defaults to the value of |
| 235 // history_service, but can be explicitly set. | 235 // history_service, but can be explicitly set. |
| 236 bool has_history_service_; | 236 bool has_history_service_; |
| 237 | 237 |
| 238 std::wstring id_; | 238 std::wstring id_; |
| 239 | 239 |
| 240 bool off_the_record_; | 240 bool off_the_record_; |
| 241 | 241 |
| 242 // Did the last session exit cleanly? Default is true. | 242 // Did the last session exit cleanly? Default is true. |
| 243 bool last_session_exited_cleanly_; | 243 bool last_session_exited_cleanly_; |
| 244 |
| 245 // The main database tracker for this profile. |
| 246 // Should be used only on the file thread. |
| 247 scoped_refptr<webkit_database::DatabaseTracker> db_tracker_; |
| 244 }; | 248 }; |
| 245 | 249 |
| 246 // A profile that derives from another profile. This does not actually | 250 // A profile that derives from another profile. This does not actually |
| 247 // override anything except the GetRuntimeId() in order to test sharing of | 251 // override anything except the GetRuntimeId() in order to test sharing of |
| 248 // site information. | 252 // site information. |
| 249 class DerivedTestingProfile : public TestingProfile { | 253 class DerivedTestingProfile : public TestingProfile { |
| 250 public: | 254 public: |
| 251 DerivedTestingProfile(Profile* profile) : original_profile_(profile) { | 255 explicit DerivedTestingProfile(Profile* profile) |
| 252 } | 256 : original_profile_(profile) {} |
| 253 | 257 |
| 254 virtual ProfileId GetRuntimeId() { | 258 virtual ProfileId GetRuntimeId() { |
| 255 return original_profile_->GetRuntimeId(); | 259 return original_profile_->GetRuntimeId(); |
| 256 } | 260 } |
| 257 | 261 |
| 258 protected: | 262 protected: |
| 259 Profile* original_profile_; | 263 Profile* original_profile_; |
| 260 }; | 264 }; |
| 261 | 265 |
| 262 #endif // CHROME_TEST_TESTING_PROFILE_H_ | 266 #endif // CHROME_TEST_TESTING_PROFILE_H_ |
| OLD | NEW |