| 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/custom_handlers/protocol_handler_registry.h" |
| 16 #include "chrome/browser/extensions/extension_info_map.h" | 17 #include "chrome/browser/extensions/extension_info_map.h" |
| 17 #include "chrome/browser/extensions/extension_io_event_router.h" | 18 #include "chrome/browser/extensions/extension_io_event_router.h" |
| 18 #include "chrome/browser/extensions/extension_webrequest_api.h" | 19 #include "chrome/browser/extensions/extension_webrequest_api.h" |
| 19 #include "chrome/browser/host_zoom_map.h" | 20 #include "chrome/browser/host_zoom_map.h" |
| 20 #include "chrome/browser/prefs/pref_change_registrar.h" | 21 #include "chrome/browser/prefs/pref_change_registrar.h" |
| 21 #include "chrome/browser/prefs/pref_service.h" | 22 #include "chrome/browser/prefs/pref_service.h" |
| 22 #include "chrome/browser/prerender/prerender_manager.h" | 23 #include "chrome/browser/prerender/prerender_manager.h" |
| 23 #include "chrome/common/extensions/extension_icon_set.h" | 24 #include "chrome/common/extensions/extension_icon_set.h" |
| 24 #include "chrome/common/net/url_request_context_getter.h" | 25 #include "chrome/common/net/url_request_context_getter.h" |
| 25 #include "net/base/cookie_policy.h" | 26 #include "net/base/cookie_policy.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 } | 92 } |
| 92 | 93 |
| 93 const ExtensionIOEventRouter* extension_io_event_router() const { | 94 const ExtensionIOEventRouter* extension_io_event_router() const { |
| 94 return extension_io_event_router_; | 95 return extension_io_event_router_; |
| 95 } | 96 } |
| 96 | 97 |
| 97 prerender::PrerenderManager* prerender_manager() { | 98 prerender::PrerenderManager* prerender_manager() { |
| 98 return prerender_manager_.get(); | 99 return prerender_manager_.get(); |
| 99 } | 100 } |
| 100 | 101 |
| 102 const ProtocolHandlerRegistry* protocol_handler_registry() { |
| 103 return protocol_handler_registry_.get(); |
| 104 } |
| 105 |
| 101 ChromeURLDataManagerBackend* GetChromeURLDataManagerBackend(); | 106 ChromeURLDataManagerBackend* GetChromeURLDataManagerBackend(); |
| 102 | 107 |
| 103 // Setters to simplify initializing from factory objects. | 108 // Setters to simplify initializing from factory objects. |
| 104 void set_chrome_cookie_policy(ChromeCookiePolicy* cookie_policy); | 109 void set_chrome_cookie_policy(ChromeCookiePolicy* cookie_policy); |
| 105 | 110 |
| 106 void set_user_script_dir_path(const FilePath& path) { | 111 void set_user_script_dir_path(const FilePath& path) { |
| 107 user_script_dir_path_ = path; | 112 user_script_dir_path_ = path; |
| 108 } | 113 } |
| 109 void set_is_off_the_record(bool is_off_the_record) { | 114 void set_is_off_the_record(bool is_off_the_record) { |
| 110 is_off_the_record_ = is_off_the_record; | 115 is_off_the_record_ = is_off_the_record; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 130 } | 135 } |
| 131 void set_extension_info_map(ExtensionInfoMap* map) { | 136 void set_extension_info_map(ExtensionInfoMap* map) { |
| 132 extension_info_map_ = map; | 137 extension_info_map_ = map; |
| 133 } | 138 } |
| 134 void set_extension_io_event_router(ExtensionIOEventRouter* router) { | 139 void set_extension_io_event_router(ExtensionIOEventRouter* router) { |
| 135 extension_io_event_router_ = router; | 140 extension_io_event_router_ = router; |
| 136 } | 141 } |
| 137 void set_prerender_manager(prerender::PrerenderManager* prerender_manager) { | 142 void set_prerender_manager(prerender::PrerenderManager* prerender_manager) { |
| 138 prerender_manager_ = prerender_manager; | 143 prerender_manager_ = prerender_manager; |
| 139 } | 144 } |
| 145 void set_protocol_handler_registry(ProtocolHandlerRegistry* registry) { |
| 146 protocol_handler_registry_ = registry; |
| 147 } |
| 140 | 148 |
| 141 // Callback for when the accept language changes. | 149 // Callback for when the accept language changes. |
| 142 void OnAcceptLanguageChange(const std::string& accept_language); | 150 void OnAcceptLanguageChange(const std::string& accept_language); |
| 143 | 151 |
| 144 // Callback for when the default charset changes. | 152 // Callback for when the default charset changes. |
| 145 void OnDefaultCharsetChange(const std::string& default_charset); | 153 void OnDefaultCharsetChange(const std::string& default_charset); |
| 146 | 154 |
| 147 protected: | 155 protected: |
| 148 virtual ~ChromeURLRequestContext(); | 156 virtual ~ChromeURLRequestContext(); |
| 149 | 157 |
| 150 private: | 158 private: |
| 151 // Path to the directory user scripts are stored in. | 159 // Path to the directory user scripts are stored in. |
| 152 FilePath user_script_dir_path_; | 160 FilePath user_script_dir_path_; |
| 153 | 161 |
| 154 // TODO(willchan): Make these non-refcounted. | 162 // TODO(willchan): Make these non-refcounted. |
| 155 scoped_refptr<ChromeAppCacheService> appcache_service_; | 163 scoped_refptr<ChromeAppCacheService> appcache_service_; |
| 156 scoped_refptr<webkit_database::DatabaseTracker> database_tracker_; | 164 scoped_refptr<webkit_database::DatabaseTracker> database_tracker_; |
| 157 scoped_refptr<ChromeCookiePolicy> chrome_cookie_policy_; | 165 scoped_refptr<ChromeCookiePolicy> chrome_cookie_policy_; |
| 158 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; | 166 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; |
| 159 scoped_refptr<HostZoomMap> host_zoom_map_; | 167 scoped_refptr<HostZoomMap> host_zoom_map_; |
| 160 scoped_refptr<ChromeBlobStorageContext> blob_storage_context_; | 168 scoped_refptr<ChromeBlobStorageContext> blob_storage_context_; |
| 161 scoped_refptr<fileapi::FileSystemContext> file_system_context_; | 169 scoped_refptr<fileapi::FileSystemContext> file_system_context_; |
| 162 // TODO(aa): This should use chrome/common/extensions/extension_set.h. | 170 // TODO(aa): This should use chrome/common/extensions/extension_set.h. |
| 163 scoped_refptr<ExtensionInfoMap> extension_info_map_; | 171 scoped_refptr<ExtensionInfoMap> extension_info_map_; |
| 164 scoped_refptr<ExtensionIOEventRouter> extension_io_event_router_; | 172 scoped_refptr<ExtensionIOEventRouter> extension_io_event_router_; |
| 165 scoped_refptr<prerender::PrerenderManager> prerender_manager_; | 173 scoped_refptr<prerender::PrerenderManager> prerender_manager_; |
| 166 scoped_ptr<ChromeURLDataManagerBackend> chrome_url_data_manager_backend_; | 174 scoped_ptr<ChromeURLDataManagerBackend> chrome_url_data_manager_backend_; |
| 175 scoped_refptr<ProtocolHandlerRegistry> protocol_handler_registry_; |
| 167 | 176 |
| 168 bool is_off_the_record_; | 177 bool is_off_the_record_; |
| 169 | 178 |
| 170 DISALLOW_COPY_AND_ASSIGN(ChromeURLRequestContext); | 179 DISALLOW_COPY_AND_ASSIGN(ChromeURLRequestContext); |
| 171 }; | 180 }; |
| 172 | 181 |
| 173 // A URLRequestContextGetter subclass used by the browser. This returns a | 182 // A URLRequestContextGetter subclass used by the browser. This returns a |
| 174 // subclass of net::URLRequestContext which can be used to store extra | 183 // subclass of net::URLRequestContext which can be used to store extra |
| 175 // information about requests. | 184 // information about requests. |
| 176 // | 185 // |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 | 280 |
| 272 // NULL if not yet initialized. Otherwise, it is the net::URLRequestContext | 281 // NULL if not yet initialized. Otherwise, it is the net::URLRequestContext |
| 273 // instance that was lazilly created by GetURLRequestContext. | 282 // instance that was lazilly created by GetURLRequestContext. |
| 274 // Access only from the IO thread. | 283 // Access only from the IO thread. |
| 275 scoped_refptr<net::URLRequestContext> url_request_context_; | 284 scoped_refptr<net::URLRequestContext> url_request_context_; |
| 276 | 285 |
| 277 DISALLOW_COPY_AND_ASSIGN(ChromeURLRequestContextGetter); | 286 DISALLOW_COPY_AND_ASSIGN(ChromeURLRequestContextGetter); |
| 278 }; | 287 }; |
| 279 | 288 |
| 280 #endif // CHROME_BROWSER_NET_CHROME_URL_REQUEST_CONTEXT_H_ | 289 #endif // CHROME_BROWSER_NET_CHROME_URL_REQUEST_CONTEXT_H_ |
| OLD | NEW |