| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_SHELL_BROWSER_SHELL_BROWSER_CONTEXT_H_ | 5 #ifndef CONTENT_SHELL_BROWSER_SHELL_BROWSER_CONTEXT_H_ |
| 6 #define CONTENT_SHELL_BROWSER_SHELL_BROWSER_CONTEXT_H_ | 6 #define CONTENT_SHELL_BROWSER_SHELL_BROWSER_CONTEXT_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 9 |
| 8 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 9 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
| 10 #include "base/macros.h" | 12 #include "base/macros.h" |
| 11 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/scoped_ptr.h" | |
| 13 #include "content/public/browser/browser_context.h" | 14 #include "content/public/browser/browser_context.h" |
| 14 #include "content/public/browser/content_browser_client.h" | 15 #include "content/public/browser/content_browser_client.h" |
| 15 #include "content/public/browser/resource_context.h" | 16 #include "content/public/browser/resource_context.h" |
| 16 #include "content/shell/browser/shell_url_request_context_getter.h" | 17 #include "content/shell/browser/shell_url_request_context_getter.h" |
| 17 #include "net/url_request/url_request_job_factory.h" | 18 #include "net/url_request/url_request_job_factory.h" |
| 18 | 19 |
| 19 namespace net { | 20 namespace net { |
| 20 class NetLog; | 21 class NetLog; |
| 21 } | 22 } |
| 22 | 23 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 33 ShellBrowserContext(bool off_the_record, net::NetLog* net_log); | 34 ShellBrowserContext(bool off_the_record, net::NetLog* net_log); |
| 34 ~ShellBrowserContext() override; | 35 ~ShellBrowserContext() override; |
| 35 | 36 |
| 36 void set_guest_manager_for_testing( | 37 void set_guest_manager_for_testing( |
| 37 BrowserPluginGuestManager* guest_manager) { | 38 BrowserPluginGuestManager* guest_manager) { |
| 38 guest_manager_ = guest_manager; | 39 guest_manager_ = guest_manager; |
| 39 } | 40 } |
| 40 | 41 |
| 41 // BrowserContext implementation. | 42 // BrowserContext implementation. |
| 42 base::FilePath GetPath() const override; | 43 base::FilePath GetPath() const override; |
| 43 scoped_ptr<ZoomLevelDelegate> CreateZoomLevelDelegate( | 44 std::unique_ptr<ZoomLevelDelegate> CreateZoomLevelDelegate( |
| 44 const base::FilePath& partition_path) override; | 45 const base::FilePath& partition_path) override; |
| 45 bool IsOffTheRecord() const override; | 46 bool IsOffTheRecord() const override; |
| 46 DownloadManagerDelegate* GetDownloadManagerDelegate() override; | 47 DownloadManagerDelegate* GetDownloadManagerDelegate() override; |
| 47 net::URLRequestContextGetter* GetRequestContext() override; | 48 net::URLRequestContextGetter* GetRequestContext() override; |
| 48 net::URLRequestContextGetter* GetMediaRequestContext() override; | 49 net::URLRequestContextGetter* GetMediaRequestContext() override; |
| 49 net::URLRequestContextGetter* GetMediaRequestContextForRenderProcess( | 50 net::URLRequestContextGetter* GetMediaRequestContextForRenderProcess( |
| 50 int renderer_child_id) override; | 51 int renderer_child_id) override; |
| 51 net::URLRequestContextGetter* GetMediaRequestContextForStoragePartition( | 52 net::URLRequestContextGetter* GetMediaRequestContextForStoragePartition( |
| 52 const base::FilePath& partition_path, | 53 const base::FilePath& partition_path, |
| 53 bool in_memory) override; | 54 bool in_memory) override; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 virtual ShellURLRequestContextGetter* CreateURLRequestContextGetter( | 98 virtual ShellURLRequestContextGetter* CreateURLRequestContextGetter( |
| 98 ProtocolHandlerMap* protocol_handlers, | 99 ProtocolHandlerMap* protocol_handlers, |
| 99 URLRequestInterceptorScopedVector request_interceptors); | 100 URLRequestInterceptorScopedVector request_interceptors); |
| 100 void set_url_request_context_getter(ShellURLRequestContextGetter* getter) { | 101 void set_url_request_context_getter(ShellURLRequestContextGetter* getter) { |
| 101 url_request_getter_ = getter; | 102 url_request_getter_ = getter; |
| 102 } | 103 } |
| 103 | 104 |
| 104 bool ignore_certificate_errors() const { return ignore_certificate_errors_; } | 105 bool ignore_certificate_errors() const { return ignore_certificate_errors_; } |
| 105 net::NetLog* net_log() const { return net_log_; } | 106 net::NetLog* net_log() const { return net_log_; } |
| 106 | 107 |
| 107 scoped_ptr<ShellResourceContext> resource_context_; | 108 std::unique_ptr<ShellResourceContext> resource_context_; |
| 108 bool ignore_certificate_errors_; | 109 bool ignore_certificate_errors_; |
| 109 scoped_ptr<ShellDownloadManagerDelegate> download_manager_delegate_; | 110 std::unique_ptr<ShellDownloadManagerDelegate> download_manager_delegate_; |
| 110 scoped_ptr<PermissionManager> permission_manager_; | 111 std::unique_ptr<PermissionManager> permission_manager_; |
| 111 scoped_ptr<BackgroundSyncController> background_sync_controller_; | 112 std::unique_ptr<BackgroundSyncController> background_sync_controller_; |
| 112 | 113 |
| 113 private: | 114 private: |
| 114 // Performs initialization of the ShellBrowserContext while IO is still | 115 // Performs initialization of the ShellBrowserContext while IO is still |
| 115 // allowed on the current thread. | 116 // allowed on the current thread. |
| 116 void InitWhileIOAllowed(); | 117 void InitWhileIOAllowed(); |
| 117 | 118 |
| 118 bool off_the_record_; | 119 bool off_the_record_; |
| 119 net::NetLog* net_log_; | 120 net::NetLog* net_log_; |
| 120 base::FilePath path_; | 121 base::FilePath path_; |
| 121 BrowserPluginGuestManager* guest_manager_; | 122 BrowserPluginGuestManager* guest_manager_; |
| 122 scoped_refptr<ShellURLRequestContextGetter> url_request_getter_; | 123 scoped_refptr<ShellURLRequestContextGetter> url_request_getter_; |
| 123 | 124 |
| 124 DISALLOW_COPY_AND_ASSIGN(ShellBrowserContext); | 125 DISALLOW_COPY_AND_ASSIGN(ShellBrowserContext); |
| 125 }; | 126 }; |
| 126 | 127 |
| 127 } // namespace content | 128 } // namespace content |
| 128 | 129 |
| 129 #endif // CONTENT_SHELL_BROWSER_SHELL_BROWSER_CONTEXT_H_ | 130 #endif // CONTENT_SHELL_BROWSER_SHELL_BROWSER_CONTEXT_H_ |
| OLD | NEW |