| 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 <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/file_path.h" | 13 #include "base/file_path.h" |
| 14 #include "base/linked_ptr.h" | 14 #include "base/linked_ptr.h" |
| 15 #include "chrome/browser/appcache/chrome_appcache_service.h" | 15 #include "chrome/browser/appcache/chrome_appcache_service.h" |
| 16 #include "chrome/browser/chrome_blob_storage_context.h" |
| 16 #include "chrome/browser/host_content_settings_map.h" | 17 #include "chrome/browser/host_content_settings_map.h" |
| 17 #include "chrome/browser/host_zoom_map.h" | 18 #include "chrome/browser/host_zoom_map.h" |
| 18 #include "chrome/browser/io_thread.h" | 19 #include "chrome/browser/io_thread.h" |
| 19 #include "chrome/browser/net/chrome_cookie_policy.h" | 20 #include "chrome/browser/net/chrome_cookie_policy.h" |
| 20 #include "chrome/browser/prefs/pref_service.h" | 21 #include "chrome/browser/prefs/pref_service.h" |
| 21 #include "chrome/common/extensions/extension.h" | 22 #include "chrome/common/extensions/extension.h" |
| 22 #include "chrome/common/net/url_request_context_getter.h" | 23 #include "chrome/common/net/url_request_context_getter.h" |
| 23 #include "chrome/common/notification_registrar.h" | 24 #include "chrome/common/notification_registrar.h" |
| 24 #include "net/base/cookie_monster.h" | 25 #include "net/base/cookie_monster.h" |
| 25 #include "net/base/cookie_policy.h" | 26 #include "net/base/cookie_policy.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 // May be NULL if requests for this context aren't subject to appcaching. | 105 // May be NULL if requests for this context aren't subject to appcaching. |
| 105 ChromeAppCacheService* appcache_service() const { | 106 ChromeAppCacheService* appcache_service() const { |
| 106 return appcache_service_.get(); | 107 return appcache_service_.get(); |
| 107 } | 108 } |
| 108 | 109 |
| 109 // Gets the database tracker associated with this context's profile. | 110 // Gets the database tracker associated with this context's profile. |
| 110 webkit_database::DatabaseTracker* database_tracker() const { | 111 webkit_database::DatabaseTracker* database_tracker() const { |
| 111 return database_tracker_.get(); | 112 return database_tracker_.get(); |
| 112 } | 113 } |
| 113 | 114 |
| 115 // Gets the blob storage context associated with this context's profile. |
| 116 ChromeBlobStorageContext* blob_storage_context() const { |
| 117 return blob_storage_context_.get(); |
| 118 } |
| 119 |
| 114 bool is_off_the_record() const { | 120 bool is_off_the_record() const { |
| 115 return is_off_the_record_; | 121 return is_off_the_record_; |
| 116 } | 122 } |
| 117 bool is_media() const { | 123 bool is_media() const { |
| 118 return is_media_; | 124 return is_media_; |
| 119 } | 125 } |
| 120 | 126 |
| 121 virtual const std::string& GetUserAgent(const GURL& url) const; | 127 virtual const std::string& GetUserAgent(const GURL& url) const; |
| 122 | 128 |
| 123 HostContentSettingsMap* host_content_settings_map() { | 129 HostContentSettingsMap* host_content_settings_map() { |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 } | 212 } |
| 207 void set_host_zoom_map(HostZoomMap* host_zoom_map) { | 213 void set_host_zoom_map(HostZoomMap* host_zoom_map) { |
| 208 host_zoom_map_ = host_zoom_map; | 214 host_zoom_map_ = host_zoom_map; |
| 209 } | 215 } |
| 210 void set_appcache_service(ChromeAppCacheService* service) { | 216 void set_appcache_service(ChromeAppCacheService* service) { |
| 211 appcache_service_ = service; | 217 appcache_service_ = service; |
| 212 } | 218 } |
| 213 void set_database_tracker(webkit_database::DatabaseTracker* tracker) { | 219 void set_database_tracker(webkit_database::DatabaseTracker* tracker) { |
| 214 database_tracker_ = tracker; | 220 database_tracker_ = tracker; |
| 215 } | 221 } |
| 222 void set_blob_storage_context(ChromeBlobStorageContext* context) { |
| 223 blob_storage_context_ = context; |
| 224 } |
| 216 void set_net_log(net::NetLog* net_log) { | 225 void set_net_log(net::NetLog* net_log) { |
| 217 net_log_ = net_log; | 226 net_log_ = net_log; |
| 218 } | 227 } |
| 219 void set_network_delegate( | 228 void set_network_delegate( |
| 220 net::HttpNetworkDelegate* network_delegate) { | 229 net::HttpNetworkDelegate* network_delegate) { |
| 221 network_delegate_ = network_delegate; | 230 network_delegate_ = network_delegate; |
| 222 } | 231 } |
| 223 | 232 |
| 224 // Callback for when the accept language changes. | 233 // Callback for when the accept language changes. |
| 225 void OnAcceptLanguageChange(const std::string& accept_language); | 234 void OnAcceptLanguageChange(const std::string& accept_language); |
| 226 | 235 |
| 227 // Callback for when the default charset changes. | 236 // Callback for when the default charset changes. |
| 228 void OnDefaultCharsetChange(const std::string& default_charset); | 237 void OnDefaultCharsetChange(const std::string& default_charset); |
| 229 | 238 |
| 230 protected: | 239 protected: |
| 231 ExtensionInfoMap extension_info_; | 240 ExtensionInfoMap extension_info_; |
| 232 | 241 |
| 233 // Path to the directory user scripts are stored in. | 242 // Path to the directory user scripts are stored in. |
| 234 FilePath user_script_dir_path_; | 243 FilePath user_script_dir_path_; |
| 235 | 244 |
| 236 scoped_refptr<ChromeAppCacheService> appcache_service_; | 245 scoped_refptr<ChromeAppCacheService> appcache_service_; |
| 237 scoped_refptr<webkit_database::DatabaseTracker> database_tracker_; | 246 scoped_refptr<webkit_database::DatabaseTracker> database_tracker_; |
| 238 scoped_refptr<ChromeCookiePolicy> chrome_cookie_policy_; | 247 scoped_refptr<ChromeCookiePolicy> chrome_cookie_policy_; |
| 239 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; | 248 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; |
| 240 scoped_refptr<HostZoomMap> host_zoom_map_; | 249 scoped_refptr<HostZoomMap> host_zoom_map_; |
| 250 scoped_refptr<ChromeBlobStorageContext> blob_storage_context_; |
| 241 | 251 |
| 242 bool is_media_; | 252 bool is_media_; |
| 243 bool is_off_the_record_; | 253 bool is_off_the_record_; |
| 244 | 254 |
| 245 private: | 255 private: |
| 246 | 256 |
| 247 DISALLOW_COPY_AND_ASSIGN(ChromeURLRequestContext); | 257 DISALLOW_COPY_AND_ASSIGN(ChromeURLRequestContext); |
| 248 }; | 258 }; |
| 249 | 259 |
| 250 // A URLRequestContextGetter subclass used by the browser. This returns a | 260 // A URLRequestContextGetter subclass used by the browser. This returns a |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 // TODO(aa): I think this can go away now as we no longer support standalone | 403 // TODO(aa): I think this can go away now as we no longer support standalone |
| 394 // user scripts. | 404 // user scripts. |
| 395 FilePath user_script_dir_path_; | 405 FilePath user_script_dir_path_; |
| 396 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; | 406 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; |
| 397 scoped_refptr<ChromeAppCacheService> appcache_service_; | 407 scoped_refptr<ChromeAppCacheService> appcache_service_; |
| 398 scoped_refptr<webkit_database::DatabaseTracker> database_tracker_; | 408 scoped_refptr<webkit_database::DatabaseTracker> database_tracker_; |
| 399 scoped_refptr<HostZoomMap> host_zoom_map_; | 409 scoped_refptr<HostZoomMap> host_zoom_map_; |
| 400 scoped_refptr<net::TransportSecurityState> transport_security_state_; | 410 scoped_refptr<net::TransportSecurityState> transport_security_state_; |
| 401 scoped_refptr<net::SSLConfigService> ssl_config_service_; | 411 scoped_refptr<net::SSLConfigService> ssl_config_service_; |
| 402 scoped_refptr<net::CookieMonster::Delegate> cookie_monster_delegate_; | 412 scoped_refptr<net::CookieMonster::Delegate> cookie_monster_delegate_; |
| 413 scoped_refptr<ChromeBlobStorageContext> blob_storage_context_; |
| 403 | 414 |
| 404 FilePath profile_dir_path_; | 415 FilePath profile_dir_path_; |
| 405 | 416 |
| 406 private: | 417 private: |
| 407 IOThread* const io_thread_; | 418 IOThread* const io_thread_; |
| 408 | 419 |
| 409 DISALLOW_COPY_AND_ASSIGN(ChromeURLRequestContextFactory); | 420 DISALLOW_COPY_AND_ASSIGN(ChromeURLRequestContextFactory); |
| 410 }; | 421 }; |
| 411 | 422 |
| 412 // Creates a proxy configuration from proxy-related preferences fetched | 423 // Creates a proxy configuration from proxy-related preferences fetched |
| 413 // from |pref_service|. The relevant preferences in |pref_service| are | 424 // from |pref_service|. The relevant preferences in |pref_service| are |
| 414 // initialized from the process' command line or by applicable proxy policies. | 425 // initialized from the process' command line or by applicable proxy policies. |
| 415 net::ProxyConfig* CreateProxyConfig(const PrefService* pref_service); | 426 net::ProxyConfig* CreateProxyConfig(const PrefService* pref_service); |
| 416 | 427 |
| 417 #endif // CHROME_BROWSER_NET_CHROME_URL_REQUEST_CONTEXT_H_ | 428 #endif // CHROME_BROWSER_NET_CHROME_URL_REQUEST_CONTEXT_H_ |
| OLD | NEW |