| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 | 7 |
| 8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "chrome/browser/net/url_request_context_getter.h" | 9 #include "chrome/browser/net/url_request_context_getter.h" |
| 10 #include "chrome/common/appcache/chrome_appcache_service.h" | 10 #include "chrome/common/appcache/chrome_appcache_service.h" |
| 11 #include "chrome/common/notification_registrar.h" | 11 #include "chrome/common/notification_registrar.h" |
| 12 #include "chrome/common/pref_service.h" | 12 #include "chrome/common/pref_service.h" |
| 13 #include "net/url_request/url_request_context.h" | 13 #include "net/url_request/url_request_context.h" |
| 14 | 14 |
| 15 class Blacklist; | 15 class Blacklist; |
| 16 class BlacklistManager; |
| 16 class CommandLine; | 17 class CommandLine; |
| 17 class Profile; | 18 class Profile; |
| 18 | 19 |
| 19 namespace net { | 20 namespace net { |
| 20 class ProxyConfig; | 21 class ProxyConfig; |
| 21 } | 22 } |
| 22 | 23 |
| 23 class ChromeURLRequestContext; | 24 class ChromeURLRequestContext; |
| 24 class ChromeURLRequestContextFactory; | 25 class ChromeURLRequestContextFactory; |
| 25 | 26 |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 return extension_paths_; | 172 return extension_paths_; |
| 172 } | 173 } |
| 173 | 174 |
| 174 virtual const std::string& GetUserAgent(const GURL& url) const; | 175 virtual const std::string& GetUserAgent(const GURL& url) const; |
| 175 | 176 |
| 176 virtual bool InterceptCookie(const URLRequest* request, std::string* cookie); | 177 virtual bool InterceptCookie(const URLRequest* request, std::string* cookie); |
| 177 | 178 |
| 178 virtual bool AllowSendingCookies(const URLRequest* request) const; | 179 virtual bool AllowSendingCookies(const URLRequest* request) const; |
| 179 | 180 |
| 180 // Gets the Privacy Blacklist, if any for this context. | 181 // Gets the Privacy Blacklist, if any for this context. |
| 181 const Blacklist* blacklist() const { return blacklist_; } | 182 const Blacklist* GetBlacklist() const; |
| 182 | 183 |
| 183 // Callback for when new extensions are loaded. | 184 // Callback for when new extensions are loaded. |
| 184 void OnNewExtensions(const std::string& id, const FilePath& path); | 185 void OnNewExtensions(const std::string& id, const FilePath& path); |
| 185 | 186 |
| 186 // Callback for when an extension is unloaded. | 187 // Callback for when an extension is unloaded. |
| 187 void OnUnloadedExtension(const std::string& id); | 188 void OnUnloadedExtension(const std::string& id); |
| 188 | 189 |
| 189 protected: | 190 protected: |
| 190 // Copies the dependencies from |other| into |this|. If you use this | 191 // Copies the dependencies from |other| into |this|. If you use this |
| 191 // constructor, then you should hold a reference to |other|, as we | 192 // constructor, then you should hold a reference to |other|, as we |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 } | 236 } |
| 236 void set_is_off_the_record(bool is_off_the_record) { | 237 void set_is_off_the_record(bool is_off_the_record) { |
| 237 is_off_the_record_ = is_off_the_record; | 238 is_off_the_record_ = is_off_the_record; |
| 238 } | 239 } |
| 239 void set_is_media(bool is_media) { | 240 void set_is_media(bool is_media) { |
| 240 is_media_ = is_media; | 241 is_media_ = is_media; |
| 241 } | 242 } |
| 242 void set_extension_paths(const ExtensionPaths& paths) { | 243 void set_extension_paths(const ExtensionPaths& paths) { |
| 243 extension_paths_ = paths; | 244 extension_paths_ = paths; |
| 244 } | 245 } |
| 245 void set_blacklist(const Blacklist* blacklist) { | 246 void set_blacklist_manager(BlacklistManager* blacklist_manager); |
| 246 blacklist_ = blacklist; | |
| 247 } | |
| 248 void set_appcache_service(ChromeAppCacheService* service) { | 247 void set_appcache_service(ChromeAppCacheService* service) { |
| 249 appcache_service_ = service; | 248 appcache_service_ = service; |
| 250 } | 249 } |
| 251 | 250 |
| 252 // Callback for when the accept language changes. | 251 // Callback for when the accept language changes. |
| 253 void OnAcceptLanguageChange(const std::string& accept_language); | 252 void OnAcceptLanguageChange(const std::string& accept_language); |
| 254 | 253 |
| 255 // Callback for when the cookie policy changes. | 254 // Callback for when the cookie policy changes. |
| 256 void OnCookiePolicyChange(net::CookiePolicy::Type type); | 255 void OnCookiePolicyChange(net::CookiePolicy::Type type); |
| 257 | 256 |
| 258 // Callback for when the default charset changes. | 257 // Callback for when the default charset changes. |
| 259 void OnDefaultCharsetChange(const std::string& default_charset); | 258 void OnDefaultCharsetChange(const std::string& default_charset); |
| 260 | 259 |
| 261 protected: | 260 protected: |
| 262 // Maps extension IDs to paths on disk. This is initialized in the | 261 // Maps extension IDs to paths on disk. This is initialized in the |
| 263 // construtor and updated when extensions changed. | 262 // construtor and updated when extensions changed. |
| 264 ExtensionPaths extension_paths_; | 263 ExtensionPaths extension_paths_; |
| 265 | 264 |
| 266 // Path to the directory user scripts are stored in. | 265 // Path to the directory user scripts are stored in. |
| 267 FilePath user_script_dir_path_; | 266 FilePath user_script_dir_path_; |
| 268 | 267 |
| 269 scoped_refptr<ChromeAppCacheService> appcache_service_; | 268 scoped_refptr<ChromeAppCacheService> appcache_service_; |
| 269 scoped_refptr<BlacklistManager> blacklist_manager_; |
| 270 | 270 |
| 271 const Blacklist* blacklist_; | |
| 272 bool is_media_; | 271 bool is_media_; |
| 273 bool is_off_the_record_; | 272 bool is_off_the_record_; |
| 274 | 273 |
| 275 private: | 274 private: |
| 276 DISALLOW_COPY_AND_ASSIGN(ChromeURLRequestContext); | 275 DISALLOW_COPY_AND_ASSIGN(ChromeURLRequestContext); |
| 277 }; | 276 }; |
| 278 | 277 |
| 279 // Base class for a ChromeURLRequestContext factory. This includes | 278 // Base class for a ChromeURLRequestContext factory. This includes |
| 280 // the shared functionality like extracting the default language/charset | 279 // the shared functionality like extracting the default language/charset |
| 281 // from a profile. | 280 // from a profile. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 302 // NOTE: If you add any parameters here, keep it in sync with | 301 // NOTE: If you add any parameters here, keep it in sync with |
| 303 // ApplyProfileParametersToContext(). | 302 // ApplyProfileParametersToContext(). |
| 304 bool is_media_; | 303 bool is_media_; |
| 305 bool is_off_the_record_; | 304 bool is_off_the_record_; |
| 306 std::string accept_language_; | 305 std::string accept_language_; |
| 307 std::string accept_charset_; | 306 std::string accept_charset_; |
| 308 std::string referrer_charset_; | 307 std::string referrer_charset_; |
| 309 net::CookiePolicy::Type cookie_policy_type_; | 308 net::CookiePolicy::Type cookie_policy_type_; |
| 310 ChromeURLRequestContext::ExtensionPaths extension_paths_; | 309 ChromeURLRequestContext::ExtensionPaths extension_paths_; |
| 311 FilePath user_script_dir_path_; | 310 FilePath user_script_dir_path_; |
| 312 Blacklist* blacklist_; | 311 scoped_refptr<BlacklistManager> blacklist_manager_; |
| 313 net::StrictTransportSecurityState* strict_transport_security_state_; | 312 net::StrictTransportSecurityState* strict_transport_security_state_; |
| 314 scoped_refptr<net::SSLConfigService> ssl_config_service_; | 313 scoped_refptr<net::SSLConfigService> ssl_config_service_; |
| 315 | 314 |
| 316 FilePath profile_dir_path_; | 315 FilePath profile_dir_path_; |
| 317 | 316 |
| 318 DISALLOW_COPY_AND_ASSIGN(ChromeURLRequestContextFactory); | 317 DISALLOW_COPY_AND_ASSIGN(ChromeURLRequestContextFactory); |
| 319 }; | 318 }; |
| 320 | 319 |
| 321 // Creates a proxy configuration using the overrides specified on the command | 320 // Creates a proxy configuration using the overrides specified on the command |
| 322 // line. Returns NULL if the system defaults should be used instead. | 321 // line. Returns NULL if the system defaults should be used instead. |
| 323 net::ProxyConfig* CreateProxyConfig(const CommandLine& command_line); | 322 net::ProxyConfig* CreateProxyConfig(const CommandLine& command_line); |
| 324 | 323 |
| 325 #endif // CHROME_BROWSER_NET_CHROME_URL_REQUEST_CONTEXT_H_ | 324 #endif // CHROME_BROWSER_NET_CHROME_URL_REQUEST_CONTEXT_H_ |
| OLD | NEW |