| 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 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/files/scoped_temp_dir.h" | 13 #include "base/files/scoped_temp_dir.h" |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 16 #include "build/build_config.h" | 16 #include "build/build_config.h" |
| 17 #include "chrome/browser/profiles/profile.h" | 17 #include "chrome/browser/profiles/profile.h" |
| 18 #include "components/domain_reliability/clear_mode.h" | 18 #include "components/domain_reliability/clear_mode.h" |
| 19 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" | 19 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" |
| 20 #include "extensions/features/features.h" | 20 #include "extensions/features/features.h" |
| 21 | 21 |
| 22 class BrowserContextDependencyManager; | 22 class BrowserContextDependencyManager; |
| 23 class ExtensionSpecialStoragePolicy; | 23 class ExtensionSpecialStoragePolicy; |
| 24 class HostContentSettingsMap; | 24 class HostContentSettingsMap; |
| 25 | 25 |
| 26 namespace content { | 26 namespace content { |
| 27 class MockResourceContext; | 27 class MockResourceContext; |
| 28 class SSLHostStateDelegate; | 28 class SSLHostStateDelegate; |
| 29 #if !defined(OS_ANDROID) |
| 29 class ZoomLevelDelegate; | 30 class ZoomLevelDelegate; |
| 31 #endif // !defined(OS_ANDROID) |
| 30 } | 32 } |
| 31 | 33 |
| 32 namespace net { | 34 namespace net { |
| 33 class CookieStore; | 35 class CookieStore; |
| 34 class URLRequestContextGetter; | 36 class URLRequestContextGetter; |
| 35 } | 37 } |
| 36 | 38 |
| 37 namespace policy { | 39 namespace policy { |
| 38 class PolicyService; | 40 class PolicyService; |
| 39 class ProfilePolicyConnector; | 41 class ProfilePolicyConnector; |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 | 228 |
| 227 // Called on the parent of an incognito |profile|. Usually called from the | 229 // Called on the parent of an incognito |profile|. Usually called from the |
| 228 // constructor of an incognito TestingProfile, but can also be used by tests | 230 // constructor of an incognito TestingProfile, but can also be used by tests |
| 229 // to provide an OffTheRecordProfileImpl instance. | 231 // to provide an OffTheRecordProfileImpl instance. |
| 230 void SetOffTheRecordProfile(std::unique_ptr<Profile> profile); | 232 void SetOffTheRecordProfile(std::unique_ptr<Profile> profile); |
| 231 | 233 |
| 232 void SetSupervisedUserId(const std::string& id); | 234 void SetSupervisedUserId(const std::string& id); |
| 233 | 235 |
| 234 // content::BrowserContext | 236 // content::BrowserContext |
| 235 base::FilePath GetPath() const override; | 237 base::FilePath GetPath() const override; |
| 238 #if !defined(OS_ANDROID) |
| 236 std::unique_ptr<content::ZoomLevelDelegate> CreateZoomLevelDelegate( | 239 std::unique_ptr<content::ZoomLevelDelegate> CreateZoomLevelDelegate( |
| 237 const base::FilePath& partition_path) override; | 240 const base::FilePath& partition_path) override; |
| 241 #endif // !defined(OS_ANDROID) |
| 238 scoped_refptr<base::SequencedTaskRunner> GetIOTaskRunner() override; | 242 scoped_refptr<base::SequencedTaskRunner> GetIOTaskRunner() override; |
| 239 bool IsOffTheRecord() const override; | 243 bool IsOffTheRecord() const override; |
| 240 content::DownloadManagerDelegate* GetDownloadManagerDelegate() override; | 244 content::DownloadManagerDelegate* GetDownloadManagerDelegate() override; |
| 241 content::ResourceContext* GetResourceContext() override; | 245 content::ResourceContext* GetResourceContext() override; |
| 242 content::BrowserPluginGuestManager* GetGuestManager() override; | 246 content::BrowserPluginGuestManager* GetGuestManager() override; |
| 243 storage::SpecialStoragePolicy* GetSpecialStoragePolicy() override; | 247 storage::SpecialStoragePolicy* GetSpecialStoragePolicy() override; |
| 244 content::PushMessagingService* GetPushMessagingService() override; | 248 content::PushMessagingService* GetPushMessagingService() override; |
| 245 content::SSLHostStateDelegate* GetSSLHostStateDelegate() override; | 249 content::SSLHostStateDelegate* GetSSLHostStateDelegate() override; |
| 246 content::PermissionManager* GetPermissionManager() override; | 250 content::PermissionManager* GetPermissionManager() override; |
| 247 content::BackgroundSyncController* GetBackgroundSyncController() override; | 251 content::BackgroundSyncController* GetBackgroundSyncController() override; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 ExtensionSpecialStoragePolicy* extension_special_storage_policy); | 297 ExtensionSpecialStoragePolicy* extension_special_storage_policy); |
| 294 #endif | 298 #endif |
| 295 ExtensionSpecialStoragePolicy* GetExtensionSpecialStoragePolicy() override; | 299 ExtensionSpecialStoragePolicy* GetExtensionSpecialStoragePolicy() override; |
| 296 // TODO(ajwong): Remove this API in favor of directly retrieving the | 300 // TODO(ajwong): Remove this API in favor of directly retrieving the |
| 297 // CookieStore from the StoragePartition after ExtensionURLRequestContext | 301 // CookieStore from the StoragePartition after ExtensionURLRequestContext |
| 298 // has been removed. | 302 // has been removed. |
| 299 net::CookieStore* GetCookieStore(); | 303 net::CookieStore* GetCookieStore(); |
| 300 | 304 |
| 301 PrefService* GetPrefs() override; | 305 PrefService* GetPrefs() override; |
| 302 const PrefService* GetPrefs() const override; | 306 const PrefService* GetPrefs() const override; |
| 307 #if !defined(OS_ANDROID) |
| 303 ChromeZoomLevelPrefs* GetZoomLevelPrefs() override; | 308 ChromeZoomLevelPrefs* GetZoomLevelPrefs() override; |
| 309 #endif // !defined(OS_ANDROID) |
| 304 net::URLRequestContextGetter* GetRequestContext() override; | 310 net::URLRequestContextGetter* GetRequestContext() override; |
| 305 net::URLRequestContextGetter* GetRequestContextForExtensions() override; | 311 net::URLRequestContextGetter* GetRequestContextForExtensions() override; |
| 306 net::SSLConfigService* GetSSLConfigService() override; | 312 net::SSLConfigService* GetSSLConfigService() override; |
| 307 void set_last_session_exited_cleanly(bool value) { | 313 void set_last_session_exited_cleanly(bool value) { |
| 308 last_session_exited_cleanly_ = value; | 314 last_session_exited_cleanly_ = value; |
| 309 } | 315 } |
| 310 bool IsSameProfile(Profile* profile) override; | 316 bool IsSameProfile(Profile* profile) override; |
| 311 base::Time GetStartTime() const override; | 317 base::Time GetStartTime() const override; |
| 312 base::FilePath last_selected_directory() override; | 318 base::FilePath last_selected_directory() override; |
| 313 void set_last_selected_directory(const base::FilePath& path) override; | 319 void set_last_selected_directory(const base::FilePath& path) override; |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 | 433 |
| 428 // Weak pointer to a delegate for indicating that a profile was created. | 434 // Weak pointer to a delegate for indicating that a profile was created. |
| 429 Delegate* delegate_; | 435 Delegate* delegate_; |
| 430 | 436 |
| 431 std::string profile_name_; | 437 std::string profile_name_; |
| 432 | 438 |
| 433 std::unique_ptr<policy::PolicyService> policy_service_; | 439 std::unique_ptr<policy::PolicyService> policy_service_; |
| 434 }; | 440 }; |
| 435 | 441 |
| 436 #endif // CHROME_TEST_BASE_TESTING_PROFILE_H_ | 442 #endif // CHROME_TEST_BASE_TESTING_PROFILE_H_ |
| OLD | NEW |