| 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 #include "base/file_path.h" | 5 #include "base/file_path.h" |
| 6 #include "chrome/common/appcache/chrome_appcache_service.h" | 6 #include "chrome/common/appcache/chrome_appcache_service.h" |
| 7 #include "chrome/common/notification_registrar.h" | 7 #include "chrome/common/notification_registrar.h" |
| 8 #include "chrome/common/pref_service.h" | 8 #include "chrome/common/pref_service.h" |
| 9 #include "net/url_request/url_request_context.h" | 9 #include "net/url_request/url_request_context.h" |
| 10 | 10 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 | 76 |
| 77 virtual const std::string& GetUserAgent(const GURL& url) const; | 77 virtual const std::string& GetUserAgent(const GURL& url) const; |
| 78 | 78 |
| 79 virtual bool InterceptCookie(const URLRequest* request, std::string* cookie); | 79 virtual bool InterceptCookie(const URLRequest* request, std::string* cookie); |
| 80 | 80 |
| 81 virtual bool AllowSendingCookies(const URLRequest* request) const; | 81 virtual bool AllowSendingCookies(const URLRequest* request) const; |
| 82 | 82 |
| 83 // Gets the Privacy Blacklist, if any for this context. | 83 // Gets the Privacy Blacklist, if any for this context. |
| 84 const Blacklist* blacklist() const { return blacklist_; } | 84 const Blacklist* blacklist() const { return blacklist_; } |
| 85 | 85 |
| 86 // Callback for when new extensions are loaded. |
| 87 void OnNewExtensions(const std::string& id, const FilePath& path); |
| 88 |
| 89 // Callback for when an extension is unloaded. |
| 90 void OnUnloadedExtension(const std::string& id); |
| 91 |
| 86 protected: | 92 protected: |
| 87 // Private constructors, use the static factory methods instead. This is | 93 // Private constructors, use the static factory methods instead. This is |
| 88 // expected to be called on the UI thread. | 94 // expected to be called on the UI thread. |
| 89 ChromeURLRequestContext( | 95 ChromeURLRequestContext( |
| 90 Profile* profile, ChromeAppCacheService* appcache_service); | 96 Profile* profile, ChromeAppCacheService* appcache_service); |
| 91 ChromeURLRequestContext(ChromeURLRequestContext* other); | 97 ChromeURLRequestContext(ChromeURLRequestContext* other); |
| 92 | 98 |
| 93 // Create a request context for media resources from a regular request | 99 // Create a request context for media resources from a regular request |
| 94 // context. This helper method is called from CreateOriginalForMedia and | 100 // context. This helper method is called from CreateOriginalForMedia and |
| 95 // CreateOffTheRecordForMedia. | 101 // CreateOffTheRecordForMedia. |
| 96 static ChromeURLRequestContext* CreateRequestContextForMedia(Profile* profile, | 102 static ChromeURLRequestContext* CreateRequestContextForMedia(Profile* profile, |
| 97 const FilePath& disk_cache_path, int cache_size, bool off_the_record, | 103 const FilePath& disk_cache_path, int cache_size, bool off_the_record, |
| 98 ChromeAppCacheService* appache_service); | 104 ChromeAppCacheService* appache_service); |
| 99 | 105 |
| 100 // NotificationObserver implementation. | 106 // NotificationObserver implementation. |
| 101 virtual void Observe(NotificationType type, | 107 virtual void Observe(NotificationType type, |
| 102 const NotificationSource& source, | 108 const NotificationSource& source, |
| 103 const NotificationDetails& details); | 109 const NotificationDetails& details); |
| 104 | 110 |
| 105 // Callback for when the accept language changes. | 111 // Callback for when the accept language changes. |
| 106 void OnAcceptLanguageChange(const std::string& accept_language); | 112 void OnAcceptLanguageChange(const std::string& accept_language); |
| 107 | 113 |
| 108 // Callback for when the cookie policy changes. | 114 // Callback for when the cookie policy changes. |
| 109 void OnCookiePolicyChange(net::CookiePolicy::Type type); | 115 void OnCookiePolicyChange(net::CookiePolicy::Type type); |
| 110 | 116 |
| 111 // Callback for when the default charset changes. | 117 // Callback for when the default charset changes. |
| 112 void OnDefaultCharsetChange(const std::string& default_charset); | 118 void OnDefaultCharsetChange(const std::string& default_charset); |
| 113 | 119 |
| 114 // Callback for when new extensions are loaded. | |
| 115 void OnNewExtensions(ExtensionPaths* new_paths); | |
| 116 | |
| 117 // Callback for when an extension is unloaded. | |
| 118 void OnUnloadedExtension(const std::string& id); | |
| 119 | |
| 120 // Destructor. | 120 // Destructor. |
| 121 virtual ~ChromeURLRequestContext(); | 121 virtual ~ChromeURLRequestContext(); |
| 122 | 122 |
| 123 NotificationRegistrar registrar_; | 123 NotificationRegistrar registrar_; |
| 124 | 124 |
| 125 // Maps extension IDs to paths on disk. This is initialized in the | 125 // Maps extension IDs to paths on disk. This is initialized in the |
| 126 // construtor and updated when extensions changed. | 126 // construtor and updated when extensions changed. |
| 127 ExtensionPaths extension_paths_; | 127 ExtensionPaths extension_paths_; |
| 128 | 128 |
| 129 // Path to the directory user scripts are stored in. | 129 // Path to the directory user scripts are stored in. |
| 130 FilePath user_script_dir_path_; | 130 FilePath user_script_dir_path_; |
| 131 | 131 |
| 132 scoped_refptr<ChromeAppCacheService> appcache_service_; | 132 scoped_refptr<ChromeAppCacheService> appcache_service_; |
| 133 | 133 |
| 134 PrefService* prefs_; | 134 PrefService* prefs_; |
| 135 const Blacklist* blacklist_; | 135 const Blacklist* blacklist_; |
| 136 bool is_media_; | 136 bool is_media_; |
| 137 bool is_off_the_record_; | 137 bool is_off_the_record_; |
| 138 }; | 138 }; |
| 139 | 139 |
| 140 // Creates a proxy configuration using the overrides specified on the command | 140 // Creates a proxy configuration using the overrides specified on the command |
| 141 // line. Returns NULL if the system defaults should be used instead. | 141 // line. Returns NULL if the system defaults should be used instead. |
| 142 net::ProxyConfig* CreateProxyConfig(const CommandLine& command_line); | 142 net::ProxyConfig* CreateProxyConfig(const CommandLine& command_line); |
| OLD | NEW |