OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/profiles/profile_io_data.h" | 5 #include "chrome/browser/profiles/profile_io_data.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 #include "chrome/browser/prefs/pref_service.h" | 35 #include "chrome/browser/prefs/pref_service.h" |
36 #include "chrome/browser/profiles/profile.h" | 36 #include "chrome/browser/profiles/profile.h" |
37 #include "chrome/browser/profiles/profile_manager.h" | 37 #include "chrome/browser/profiles/profile_manager.h" |
38 #include "chrome/browser/transport_security_persister.h" | 38 #include "chrome/browser/transport_security_persister.h" |
39 #include "chrome/browser/ui/webui/chrome_url_data_manager_backend.h" | 39 #include "chrome/browser/ui/webui/chrome_url_data_manager_backend.h" |
40 #include "chrome/common/chrome_notification_types.h" | 40 #include "chrome/common/chrome_notification_types.h" |
41 #include "chrome/common/chrome_switches.h" | 41 #include "chrome/common/chrome_switches.h" |
42 #include "chrome/common/pref_names.h" | 42 #include "chrome/common/pref_names.h" |
43 #include "chrome/common/url_constants.h" | 43 #include "chrome/common/url_constants.h" |
44 #include "content/browser/renderer_host/resource_dispatcher_host.h" | 44 #include "content/browser/renderer_host/resource_dispatcher_host.h" |
45 #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h" | 45 #include "content/browser/renderer_host/resource_request_info_impl.h" |
46 #include "content/public/browser/browser_thread.h" | 46 #include "content/public/browser/browser_thread.h" |
47 #include "content/public/browser/host_zoom_map.h" | 47 #include "content/public/browser/host_zoom_map.h" |
48 #include "content/public/browser/notification_service.h" | 48 #include "content/public/browser/notification_service.h" |
49 #include "content/public/browser/resource_context.h" | 49 #include "content/public/browser/resource_context.h" |
50 #include "net/base/origin_bound_cert_service.h" | 50 #include "net/base/origin_bound_cert_service.h" |
51 #include "net/http/http_transaction_factory.h" | 51 #include "net/http/http_transaction_factory.h" |
52 #include "net/http/http_util.h" | 52 #include "net/http/http_util.h" |
53 #include "net/proxy/proxy_config_service_fixed.h" | 53 #include "net/proxy/proxy_config_service_fixed.h" |
54 #include "net/proxy/proxy_script_fetcher_impl.h" | 54 #include "net/proxy/proxy_script_fetcher_impl.h" |
55 #include "net/proxy/proxy_service.h" | 55 #include "net/proxy/proxy_service.h" |
56 #include "net/url_request/url_request.h" | 56 #include "net/url_request/url_request.h" |
57 #include "webkit/blob/blob_data.h" | 57 #include "webkit/blob/blob_data.h" |
58 #include "webkit/blob/blob_url_request_job_factory.h" | 58 #include "webkit/blob/blob_url_request_job_factory.h" |
59 #include "webkit/fileapi/file_system_url_request_job_factory.h" | 59 #include "webkit/fileapi/file_system_url_request_job_factory.h" |
60 | 60 |
61 #if defined(OS_CHROMEOS) | 61 #if defined(OS_CHROMEOS) |
62 #include "chrome/browser/chromeos/gview_request_interceptor.h" | 62 #include "chrome/browser/chromeos/gview_request_interceptor.h" |
63 #include "chrome/browser/chromeos/proxy_config_service_impl.h" | 63 #include "chrome/browser/chromeos/proxy_config_service_impl.h" |
64 #endif // defined(OS_CHROMEOS) | 64 #endif // defined(OS_CHROMEOS) |
65 | 65 |
66 using content::BrowserContext; | 66 using content::BrowserContext; |
67 using content::BrowserThread; | 67 using content::BrowserThread; |
68 using content::ResourceContext; | 68 using content::ResourceContext; |
| 69 using content::ResourceRequestInfoImpl; |
69 | 70 |
70 namespace { | 71 namespace { |
71 | 72 |
72 // ---------------------------------------------------------------------------- | 73 // ---------------------------------------------------------------------------- |
73 // CookieMonster::Delegate implementation | 74 // CookieMonster::Delegate implementation |
74 // ---------------------------------------------------------------------------- | 75 // ---------------------------------------------------------------------------- |
75 class ChromeCookieMonsterDelegate : public net::CookieMonster::Delegate { | 76 class ChromeCookieMonsterDelegate : public net::CookieMonster::Delegate { |
76 public: | 77 public: |
77 explicit ChromeCookieMonsterDelegate( | 78 explicit ChromeCookieMonsterDelegate( |
78 const base::Callback<Profile*(void)>& profile_getter) | 79 const base::Callback<Profile*(void)>& profile_getter) |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 net::URLRequest* request) const OVERRIDE { | 141 net::URLRequest* request) const OVERRIDE { |
141 return NULL; | 142 return NULL; |
142 } | 143 } |
143 | 144 |
144 private: | 145 private: |
145 const scoped_refptr<ProtocolHandlerRegistry> protocol_handler_registry_; | 146 const scoped_refptr<ProtocolHandlerRegistry> protocol_handler_registry_; |
146 | 147 |
147 DISALLOW_COPY_AND_ASSIGN(ProtocolHandlerRegistryInterceptor); | 148 DISALLOW_COPY_AND_ASSIGN(ProtocolHandlerRegistryInterceptor); |
148 }; | 149 }; |
149 | 150 |
| 151 // TODO(darin): Move this class to src/content |
150 class ChromeBlobProtocolHandler : public webkit_blob::BlobProtocolHandler { | 152 class ChromeBlobProtocolHandler : public webkit_blob::BlobProtocolHandler { |
151 public: | 153 public: |
152 ChromeBlobProtocolHandler( | 154 ChromeBlobProtocolHandler( |
153 webkit_blob::BlobStorageController* blob_storage_controller, | 155 webkit_blob::BlobStorageController* blob_storage_controller, |
154 base::MessageLoopProxy* loop_proxy) | 156 base::MessageLoopProxy* loop_proxy) |
155 : webkit_blob::BlobProtocolHandler(blob_storage_controller, | 157 : webkit_blob::BlobProtocolHandler(blob_storage_controller, |
156 loop_proxy) {} | 158 loop_proxy) {} |
157 | 159 |
158 virtual ~ChromeBlobProtocolHandler() {} | 160 virtual ~ChromeBlobProtocolHandler() {} |
159 | 161 |
160 private: | 162 private: |
161 virtual scoped_refptr<webkit_blob::BlobData> | 163 virtual scoped_refptr<webkit_blob::BlobData> |
162 LookupBlobData(net::URLRequest* request) const { | 164 LookupBlobData(net::URLRequest* request) const { |
163 ResourceDispatcherHostRequestInfo* info = | 165 const ResourceRequestInfoImpl* info = |
164 ResourceDispatcherHost::InfoForRequest(request); | 166 ResourceDispatcherHost::InfoForRequest(request); |
165 if (!info) | 167 if (!info) |
166 return NULL; | 168 return NULL; |
167 return info->requested_blob_data(); | 169 return info->requested_blob_data(); |
168 } | 170 } |
169 | 171 |
170 DISALLOW_COPY_AND_ASSIGN(ChromeBlobProtocolHandler); | 172 DISALLOW_COPY_AND_ASSIGN(ChromeBlobProtocolHandler); |
171 }; | 173 }; |
172 | 174 |
173 Profile* GetProfileOnUI(ProfileManager* profile_manager, Profile* profile) { | 175 Profile* GetProfileOnUI(ProfileManager* profile_manager, Profile* profile) { |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 &resource_context_)); | 560 &resource_context_)); |
559 bool posted = BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, this); | 561 bool posted = BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, this); |
560 if (!posted) | 562 if (!posted) |
561 delete this; | 563 delete this; |
562 } | 564 } |
563 | 565 |
564 void ProfileIOData::set_origin_bound_cert_service( | 566 void ProfileIOData::set_origin_bound_cert_service( |
565 net::OriginBoundCertService* origin_bound_cert_service) const { | 567 net::OriginBoundCertService* origin_bound_cert_service) const { |
566 origin_bound_cert_service_.reset(origin_bound_cert_service); | 568 origin_bound_cert_service_.reset(origin_bound_cert_service); |
567 } | 569 } |
OLD | NEW |