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