| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 virtual ~ChromeURLRequestContext(); | 107 virtual ~ChromeURLRequestContext(); |
| 103 | 108 |
| 104 public: | 109 public: |
| 105 // Setters to simplify initializing from factory objects. | 110 // Setters to simplify initializing from factory objects. |
| 106 | 111 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 void set_file_system_context(fileapi::SandboxedFileSystemContext* context) { | 163 void set_file_system_context(fileapi::SandboxedFileSystemContext* context) { |
| 159 file_system_context_ = context; | 164 file_system_context_ = context; |
| 160 } | 165 } |
| 161 void set_extension_info_map(ExtensionInfoMap* map) { | 166 void set_extension_info_map(ExtensionInfoMap* map) { |
| 162 extension_info_map_ = map; | 167 extension_info_map_ = map; |
| 163 } | 168 } |
| 164 void set_network_delegate( | 169 void set_network_delegate( |
| 165 net::HttpNetworkDelegate* network_delegate) { | 170 net::HttpNetworkDelegate* network_delegate) { |
| 166 network_delegate_ = network_delegate; | 171 network_delegate_ = network_delegate; |
| 167 } | 172 } |
| 173 void set_prerender_manager(PrerenderManager* prerender_manager) { |
| 174 prerender_manager_ = prerender_manager; |
| 175 } |
| 168 | 176 |
| 169 // Callback for when the accept language changes. | 177 // Callback for when the accept language changes. |
| 170 void OnAcceptLanguageChange(const std::string& accept_language); | 178 void OnAcceptLanguageChange(const std::string& accept_language); |
| 171 | 179 |
| 172 // Callback for when the default charset changes. | 180 // Callback for when the default charset changes. |
| 173 void OnDefaultCharsetChange(const std::string& default_charset); | 181 void OnDefaultCharsetChange(const std::string& default_charset); |
| 174 | 182 |
| 175 protected: | 183 protected: |
| 176 // Path to the directory user scripts are stored in. | 184 // Path to the directory user scripts are stored in. |
| 177 FilePath user_script_dir_path_; | 185 FilePath user_script_dir_path_; |
| 178 | 186 |
| 187 // TODO(willchan): Make these non-refcounted. |
| 179 scoped_refptr<ChromeAppCacheService> appcache_service_; | 188 scoped_refptr<ChromeAppCacheService> appcache_service_; |
| 180 scoped_refptr<webkit_database::DatabaseTracker> database_tracker_; | 189 scoped_refptr<webkit_database::DatabaseTracker> database_tracker_; |
| 181 scoped_refptr<ChromeCookiePolicy> chrome_cookie_policy_; | 190 scoped_refptr<ChromeCookiePolicy> chrome_cookie_policy_; |
| 182 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; | 191 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; |
| 183 scoped_refptr<HostZoomMap> host_zoom_map_; | 192 scoped_refptr<HostZoomMap> host_zoom_map_; |
| 184 scoped_refptr<ChromeBlobStorageContext> blob_storage_context_; | 193 scoped_refptr<ChromeBlobStorageContext> blob_storage_context_; |
| 185 scoped_refptr<fileapi::SandboxedFileSystemContext> file_system_context_; | 194 scoped_refptr<fileapi::SandboxedFileSystemContext> file_system_context_; |
| 186 scoped_refptr<ExtensionInfoMap> extension_info_map_; | 195 scoped_refptr<ExtensionInfoMap> extension_info_map_; |
| 196 scoped_refptr<PrerenderManager> prerender_manager_; |
| 187 | 197 |
| 188 bool is_media_; | 198 bool is_media_; |
| 189 bool is_off_the_record_; | 199 bool is_off_the_record_; |
| 190 | 200 |
| 191 private: | 201 private: |
| 192 DISALLOW_COPY_AND_ASSIGN(ChromeURLRequestContext); | 202 DISALLOW_COPY_AND_ASSIGN(ChromeURLRequestContext); |
| 193 }; | 203 }; |
| 194 | 204 |
| 195 // A URLRequestContextGetter subclass used by the browser. This returns a | 205 // A URLRequestContextGetter subclass used by the browser. This returns a |
| 196 // subclass of URLRequestContext which can be used to store extra information | 206 // subclass of URLRequestContext which can be used to store extra information |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 // ApplyProfileParametersToContext(). | 345 // ApplyProfileParametersToContext(). |
| 336 bool is_media_; | 346 bool is_media_; |
| 337 bool is_off_the_record_; | 347 bool is_off_the_record_; |
| 338 bool clear_local_state_on_exit_; | 348 bool clear_local_state_on_exit_; |
| 339 std::string accept_language_; | 349 std::string accept_language_; |
| 340 std::string accept_charset_; | 350 std::string accept_charset_; |
| 341 std::string referrer_charset_; | 351 std::string referrer_charset_; |
| 342 | 352 |
| 343 // TODO(aa): I think this can go away now as we no longer support standalone | 353 // TODO(aa): I think this can go away now as we no longer support standalone |
| 344 // user scripts. | 354 // user scripts. |
| 355 // TODO(willchan): Make these non-refcounted. |
| 345 FilePath user_script_dir_path_; | 356 FilePath user_script_dir_path_; |
| 346 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; | 357 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; |
| 347 scoped_refptr<ChromeAppCacheService> appcache_service_; | 358 scoped_refptr<ChromeAppCacheService> appcache_service_; |
| 348 scoped_refptr<webkit_database::DatabaseTracker> database_tracker_; | 359 scoped_refptr<webkit_database::DatabaseTracker> database_tracker_; |
| 349 scoped_refptr<HostZoomMap> host_zoom_map_; | 360 scoped_refptr<HostZoomMap> host_zoom_map_; |
| 350 scoped_refptr<net::TransportSecurityState> transport_security_state_; | 361 scoped_refptr<net::TransportSecurityState> transport_security_state_; |
| 351 scoped_refptr<net::SSLConfigService> ssl_config_service_; | 362 scoped_refptr<net::SSLConfigService> ssl_config_service_; |
| 352 scoped_refptr<net::CookieMonster::Delegate> cookie_monster_delegate_; | 363 scoped_refptr<net::CookieMonster::Delegate> cookie_monster_delegate_; |
| 353 scoped_refptr<ChromeBlobStorageContext> blob_storage_context_; | 364 scoped_refptr<ChromeBlobStorageContext> blob_storage_context_; |
| 354 scoped_refptr<fileapi::SandboxedFileSystemContext> file_system_context_; | 365 scoped_refptr<fileapi::SandboxedFileSystemContext> file_system_context_; |
| 355 scoped_refptr<ExtensionInfoMap> extension_info_map_; | 366 scoped_refptr<ExtensionInfoMap> extension_info_map_; |
| 367 scoped_refptr<PrerenderManager> prerender_manager_; |
| 356 | 368 |
| 357 FilePath profile_dir_path_; | 369 FilePath profile_dir_path_; |
| 358 | 370 |
| 359 private: | 371 private: |
| 360 IOThread* const io_thread_; | 372 IOThread* const io_thread_; |
| 361 | 373 |
| 362 DISALLOW_COPY_AND_ASSIGN(ChromeURLRequestContextFactory); | 374 DISALLOW_COPY_AND_ASSIGN(ChromeURLRequestContextFactory); |
| 363 }; | 375 }; |
| 364 | 376 |
| 365 #endif // CHROME_BROWSER_NET_CHROME_URL_REQUEST_CONTEXT_H_ | 377 #endif // CHROME_BROWSER_NET_CHROME_URL_REQUEST_CONTEXT_H_ |
| OLD | NEW |