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 CONTENT_PUBLIC_TEST_TEST_BROWSER_CONTEXT_H_ | 5 #ifndef CONTENT_PUBLIC_TEST_TEST_BROWSER_CONTEXT_H_ |
6 #define CONTENT_PUBLIC_TEST_TEST_BROWSER_CONTEXT_H_ | 6 #define CONTENT_PUBLIC_TEST_TEST_BROWSER_CONTEXT_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 | 28 |
29 // Takes ownership of the temporary directory so that it's not deleted when | 29 // Takes ownership of the temporary directory so that it's not deleted when |
30 // this object is destructed. | 30 // this object is destructed. |
31 base::FilePath TakePath(); | 31 base::FilePath TakePath(); |
32 | 32 |
33 void SetSpecialStoragePolicy(storage::SpecialStoragePolicy* policy); | 33 void SetSpecialStoragePolicy(storage::SpecialStoragePolicy* policy); |
34 void SetPermissionManager( | 34 void SetPermissionManager( |
35 std::unique_ptr<PermissionManager> permission_manager); | 35 std::unique_ptr<PermissionManager> permission_manager); |
36 net::URLRequestContextGetter* GetRequestContext(); | 36 net::URLRequestContextGetter* GetRequestContext(); |
37 | 37 |
| 38 // Allow clients to make this an incognito context. |
| 39 void set_is_off_the_record(bool is_off_the_record) { |
| 40 is_off_the_record_ = is_off_the_record; |
| 41 } |
| 42 |
| 43 // BrowserContext implementation. |
38 base::FilePath GetPath() const override; | 44 base::FilePath GetPath() const override; |
39 std::unique_ptr<ZoomLevelDelegate> CreateZoomLevelDelegate( | 45 std::unique_ptr<ZoomLevelDelegate> CreateZoomLevelDelegate( |
40 const base::FilePath& partition_path) override; | 46 const base::FilePath& partition_path) override; |
41 bool IsOffTheRecord() const override; | 47 bool IsOffTheRecord() const override; |
42 DownloadManagerDelegate* GetDownloadManagerDelegate() override; | 48 DownloadManagerDelegate* GetDownloadManagerDelegate() override; |
43 ResourceContext* GetResourceContext() override; | 49 ResourceContext* GetResourceContext() override; |
44 BrowserPluginGuestManager* GetGuestManager() override; | 50 BrowserPluginGuestManager* GetGuestManager() override; |
45 storage::SpecialStoragePolicy* GetSpecialStoragePolicy() override; | 51 storage::SpecialStoragePolicy* GetSpecialStoragePolicy() override; |
46 PushMessagingService* GetPushMessagingService() override; | 52 PushMessagingService* GetPushMessagingService() override; |
47 SSLHostStateDelegate* GetSSLHostStateDelegate() override; | 53 SSLHostStateDelegate* GetSSLHostStateDelegate() override; |
(...skipping 13 matching lines...) Expand all Loading... |
61 bool in_memory) override; | 67 bool in_memory) override; |
62 | 68 |
63 private: | 69 private: |
64 base::ScopedTempDir browser_context_dir_; | 70 base::ScopedTempDir browser_context_dir_; |
65 scoped_refptr<net::URLRequestContextGetter> request_context_; | 71 scoped_refptr<net::URLRequestContextGetter> request_context_; |
66 std::unique_ptr<MockResourceContext> resource_context_; | 72 std::unique_ptr<MockResourceContext> resource_context_; |
67 scoped_refptr<storage::SpecialStoragePolicy> special_storage_policy_; | 73 scoped_refptr<storage::SpecialStoragePolicy> special_storage_policy_; |
68 std::unique_ptr<MockSSLHostStateDelegate> ssl_host_state_delegate_; | 74 std::unique_ptr<MockSSLHostStateDelegate> ssl_host_state_delegate_; |
69 std::unique_ptr<PermissionManager> permission_manager_; | 75 std::unique_ptr<PermissionManager> permission_manager_; |
70 std::unique_ptr<MockBackgroundSyncController> background_sync_controller_; | 76 std::unique_ptr<MockBackgroundSyncController> background_sync_controller_; |
| 77 bool is_off_the_record_ = false; |
71 | 78 |
72 DISALLOW_COPY_AND_ASSIGN(TestBrowserContext); | 79 DISALLOW_COPY_AND_ASSIGN(TestBrowserContext); |
73 }; | 80 }; |
74 | 81 |
75 } // namespace content | 82 } // namespace content |
76 | 83 |
77 #endif // CONTENT_PUBLIC_TEST_TEST_BROWSER_CONTEXT_H_ | 84 #endif // CONTENT_PUBLIC_TEST_TEST_BROWSER_CONTEXT_H_ |
OLD | NEW |