OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_BROWSER_NET_CHROME_URL_REQUEST_CONTEXT_H_ | 5 #ifndef CHROME_BROWSER_NET_CHROME_URL_REQUEST_CONTEXT_H_ |
6 #define CHROME_BROWSER_NET_CHROME_URL_REQUEST_CONTEXT_H_ | 6 #define CHROME_BROWSER_NET_CHROME_URL_REQUEST_CONTEXT_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/file_path.h" | 12 #include "base/file_path.h" |
13 #include "chrome/browser/appcache/chrome_appcache_service.h" | 13 #include "chrome/browser/appcache/chrome_appcache_service.h" |
14 #include "chrome/browser/chrome_blob_storage_context.h" | 14 #include "chrome/browser/chrome_blob_storage_context.h" |
15 #include "chrome/browser/content_settings/host_content_settings_map.h" | 15 #include "chrome/browser/content_settings/host_content_settings_map.h" |
16 #include "chrome/browser/extensions/extension_info_map.h" | 16 #include "chrome/browser/extensions/extension_info_map.h" |
17 #include "chrome/browser/host_zoom_map.h" | 17 #include "chrome/browser/host_zoom_map.h" |
18 #include "chrome/browser/io_thread.h" | 18 #include "chrome/browser/io_thread.h" |
19 #include "chrome/browser/net/chrome_cookie_policy.h" | 19 #include "chrome/browser/net/chrome_cookie_policy.h" |
20 #include "chrome/browser/prefs/pref_change_registrar.h" | 20 #include "chrome/browser/prefs/pref_change_registrar.h" |
21 #include "chrome/browser/prefs/pref_service.h" | 21 #include "chrome/browser/prefs/pref_service.h" |
| 22 #include "chrome/browser/prerender/prerender_manager.h" |
22 #include "chrome/common/extensions/extension_icon_set.h" | 23 #include "chrome/common/extensions/extension_icon_set.h" |
23 #include "chrome/common/net/url_request_context_getter.h" | 24 #include "chrome/common/net/url_request_context_getter.h" |
24 #include "chrome/common/notification_registrar.h" | 25 #include "chrome/common/notification_registrar.h" |
25 #include "net/base/cookie_monster.h" | 26 #include "net/base/cookie_monster.h" |
26 #include "net/base/cookie_policy.h" | 27 #include "net/base/cookie_policy.h" |
27 #include "net/url_request/url_request_context.h" | 28 #include "net/url_request/url_request_context.h" |
28 #include "webkit/database/database_tracker.h" | 29 #include "webkit/database/database_tracker.h" |
29 #include "webkit/fileapi/sandboxed_file_system_context.h" | 30 #include "webkit/fileapi/sandboxed_file_system_context.h" |
30 | 31 |
31 class CommandLine; | 32 class CommandLine; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 HostContentSettingsMap* host_content_settings_map() { | 88 HostContentSettingsMap* host_content_settings_map() { |
88 return host_content_settings_map_; | 89 return host_content_settings_map_; |
89 } | 90 } |
90 | 91 |
91 const HostZoomMap* host_zoom_map() const { return host_zoom_map_; } | 92 const HostZoomMap* host_zoom_map() const { return host_zoom_map_; } |
92 | 93 |
93 const ExtensionInfoMap* extension_info_map() const { | 94 const ExtensionInfoMap* extension_info_map() const { |
94 return extension_info_map_; | 95 return extension_info_map_; |
95 } | 96 } |
96 | 97 |
| 98 PrerenderManager* prerender_manager() { |
| 99 return prerender_manager_.get(); |
| 100 } |
| 101 |
97 // Returns true if this context is an external request context, like | 102 // Returns true if this context is an external request context, like |
98 // ChromeFrame. | 103 // ChromeFrame. |
99 virtual bool IsExternal() const; | 104 virtual bool IsExternal() const; |
100 | 105 |
101 protected: | 106 protected: |
102 // Copies the dependencies from |other| into |this|. If you use this | 107 // Copies the dependencies from |other| into |this|. If you use this |
103 // constructor, then you should hold a reference to |other|, as we | 108 // constructor, then you should hold a reference to |other|, as we |
104 // depend on |other| being alive. | 109 // depend on |other| being alive. |
105 explicit ChromeURLRequestContext(ChromeURLRequestContext* other); | 110 explicit ChromeURLRequestContext(ChromeURLRequestContext* other); |
106 virtual ~ChromeURLRequestContext(); | 111 virtual ~ChromeURLRequestContext(); |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 void set_extension_info_map(ExtensionInfoMap* map) { | 191 void set_extension_info_map(ExtensionInfoMap* map) { |
187 extension_info_map_ = map; | 192 extension_info_map_ = map; |
188 } | 193 } |
189 void set_net_log(net::NetLog* net_log) { | 194 void set_net_log(net::NetLog* net_log) { |
190 net_log_ = net_log; | 195 net_log_ = net_log; |
191 } | 196 } |
192 void set_network_delegate( | 197 void set_network_delegate( |
193 net::HttpNetworkDelegate* network_delegate) { | 198 net::HttpNetworkDelegate* network_delegate) { |
194 network_delegate_ = network_delegate; | 199 network_delegate_ = network_delegate; |
195 } | 200 } |
| 201 void set_prerender_manager(PrerenderManager* prerender_manager) { |
| 202 prerender_manager_ = prerender_manager; |
| 203 } |
196 | 204 |
197 // Callback for when the accept language changes. | 205 // Callback for when the accept language changes. |
198 void OnAcceptLanguageChange(const std::string& accept_language); | 206 void OnAcceptLanguageChange(const std::string& accept_language); |
199 | 207 |
200 // Callback for when the default charset changes. | 208 // Callback for when the default charset changes. |
201 void OnDefaultCharsetChange(const std::string& default_charset); | 209 void OnDefaultCharsetChange(const std::string& default_charset); |
202 | 210 |
203 protected: | 211 protected: |
204 // Path to the directory user scripts are stored in. | 212 // Path to the directory user scripts are stored in. |
205 FilePath user_script_dir_path_; | 213 FilePath user_script_dir_path_; |
206 | 214 |
207 scoped_refptr<ChromeAppCacheService> appcache_service_; | 215 scoped_refptr<ChromeAppCacheService> appcache_service_; |
208 scoped_refptr<webkit_database::DatabaseTracker> database_tracker_; | 216 scoped_refptr<webkit_database::DatabaseTracker> database_tracker_; |
209 scoped_refptr<ChromeCookiePolicy> chrome_cookie_policy_; | 217 scoped_refptr<ChromeCookiePolicy> chrome_cookie_policy_; |
210 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; | 218 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; |
211 scoped_refptr<HostZoomMap> host_zoom_map_; | 219 scoped_refptr<HostZoomMap> host_zoom_map_; |
212 scoped_refptr<ChromeBlobStorageContext> blob_storage_context_; | 220 scoped_refptr<ChromeBlobStorageContext> blob_storage_context_; |
213 scoped_refptr<fileapi::SandboxedFileSystemContext> file_system_context_; | 221 scoped_refptr<fileapi::SandboxedFileSystemContext> file_system_context_; |
214 scoped_refptr<ExtensionInfoMap> extension_info_map_; | 222 scoped_refptr<ExtensionInfoMap> extension_info_map_; |
| 223 scoped_refptr<PrerenderManager> prerender_manager_; |
215 | 224 |
216 bool is_media_; | 225 bool is_media_; |
217 bool is_off_the_record_; | 226 bool is_off_the_record_; |
218 | 227 |
219 private: | 228 private: |
220 DISALLOW_COPY_AND_ASSIGN(ChromeURLRequestContext); | 229 DISALLOW_COPY_AND_ASSIGN(ChromeURLRequestContext); |
221 }; | 230 }; |
222 | 231 |
223 // A URLRequestContextGetter subclass used by the browser. This returns a | 232 // A URLRequestContextGetter subclass used by the browser. This returns a |
224 // subclass of URLRequestContext which can be used to store extra information | 233 // subclass of URLRequestContext which can be used to store extra information |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; | 383 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; |
375 scoped_refptr<ChromeAppCacheService> appcache_service_; | 384 scoped_refptr<ChromeAppCacheService> appcache_service_; |
376 scoped_refptr<webkit_database::DatabaseTracker> database_tracker_; | 385 scoped_refptr<webkit_database::DatabaseTracker> database_tracker_; |
377 scoped_refptr<HostZoomMap> host_zoom_map_; | 386 scoped_refptr<HostZoomMap> host_zoom_map_; |
378 scoped_refptr<net::TransportSecurityState> transport_security_state_; | 387 scoped_refptr<net::TransportSecurityState> transport_security_state_; |
379 scoped_refptr<net::SSLConfigService> ssl_config_service_; | 388 scoped_refptr<net::SSLConfigService> ssl_config_service_; |
380 scoped_refptr<net::CookieMonster::Delegate> cookie_monster_delegate_; | 389 scoped_refptr<net::CookieMonster::Delegate> cookie_monster_delegate_; |
381 scoped_refptr<ChromeBlobStorageContext> blob_storage_context_; | 390 scoped_refptr<ChromeBlobStorageContext> blob_storage_context_; |
382 scoped_refptr<fileapi::SandboxedFileSystemContext> file_system_context_; | 391 scoped_refptr<fileapi::SandboxedFileSystemContext> file_system_context_; |
383 scoped_refptr<ExtensionInfoMap> extension_info_map_; | 392 scoped_refptr<ExtensionInfoMap> extension_info_map_; |
| 393 scoped_refptr<PrerenderManager> prerender_manager_; |
384 | 394 |
385 FilePath profile_dir_path_; | 395 FilePath profile_dir_path_; |
386 | 396 |
387 private: | 397 private: |
388 IOThread* const io_thread_; | 398 IOThread* const io_thread_; |
389 | 399 |
390 DISALLOW_COPY_AND_ASSIGN(ChromeURLRequestContextFactory); | 400 DISALLOW_COPY_AND_ASSIGN(ChromeURLRequestContextFactory); |
391 }; | 401 }; |
392 | 402 |
393 #endif // CHROME_BROWSER_NET_CHROME_URL_REQUEST_CONTEXT_H_ | 403 #endif // CHROME_BROWSER_NET_CHROME_URL_REQUEST_CONTEXT_H_ |
OLD | NEW |