| 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/off_the_record_profile_impl.h" | 5 #include "chrome/browser/profiles/off_the_record_profile_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 return DownloadServiceFactory::GetForProfile(this)-> | 252 return DownloadServiceFactory::GetForProfile(this)-> |
| 253 GetDownloadManagerDelegate(); | 253 GetDownloadManagerDelegate(); |
| 254 } | 254 } |
| 255 | 255 |
| 256 net::URLRequestContextGetter* OffTheRecordProfileImpl::GetRequestContext() { | 256 net::URLRequestContextGetter* OffTheRecordProfileImpl::GetRequestContext() { |
| 257 return GetDefaultStoragePartition(this)->GetURLRequestContext(); | 257 return GetDefaultStoragePartition(this)->GetURLRequestContext(); |
| 258 } | 258 } |
| 259 | 259 |
| 260 net::URLRequestContextGetter* OffTheRecordProfileImpl::CreateRequestContext( | 260 net::URLRequestContextGetter* OffTheRecordProfileImpl::CreateRequestContext( |
| 261 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 261 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 262 blob_protocol_handler, | |
| 263 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 264 file_system_protocol_handler, | |
| 265 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 266 developer_protocol_handler, | 262 developer_protocol_handler, |
| 267 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 263 content::ProtocolHandlerMap* protocol_handlers) { |
| 268 chrome_protocol_handler, | 264 return io_data_.CreateMainRequestContextGetter( |
| 269 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 265 developer_protocol_handler.Pass(), protocol_handlers); |
| 270 chrome_devtools_protocol_handler) { | |
| 271 return io_data_.CreateMainRequestContextGetter(blob_protocol_handler.Pass(), | |
| 272 file_system_protocol_handler.Pass(), developer_protocol_handler.Pass(), | |
| 273 chrome_protocol_handler.Pass(), chrome_devtools_protocol_handler.Pass()); | |
| 274 } | 266 } |
| 275 | 267 |
| 276 net::URLRequestContextGetter* | 268 net::URLRequestContextGetter* |
| 277 OffTheRecordProfileImpl::GetRequestContextForRenderProcess( | 269 OffTheRecordProfileImpl::GetRequestContextForRenderProcess( |
| 278 int renderer_child_id) { | 270 int renderer_child_id) { |
| 279 content::RenderProcessHost* rph = content::RenderProcessHost::FromID( | 271 content::RenderProcessHost* rph = content::RenderProcessHost::FromID( |
| 280 renderer_child_id); | 272 renderer_child_id); |
| 281 return rph->GetStoragePartition()->GetURLRequestContext(); | 273 return rph->GetStoragePartition()->GetURLRequestContext(); |
| 282 } | 274 } |
| 283 | 275 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 304 net::URLRequestContextGetter* | 296 net::URLRequestContextGetter* |
| 305 OffTheRecordProfileImpl::GetRequestContextForExtensions() { | 297 OffTheRecordProfileImpl::GetRequestContextForExtensions() { |
| 306 return io_data_.GetExtensionsRequestContextGetter(); | 298 return io_data_.GetExtensionsRequestContextGetter(); |
| 307 } | 299 } |
| 308 | 300 |
| 309 net::URLRequestContextGetter* | 301 net::URLRequestContextGetter* |
| 310 OffTheRecordProfileImpl::CreateRequestContextForStoragePartition( | 302 OffTheRecordProfileImpl::CreateRequestContextForStoragePartition( |
| 311 const base::FilePath& partition_path, | 303 const base::FilePath& partition_path, |
| 312 bool in_memory, | 304 bool in_memory, |
| 313 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 305 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 314 blob_protocol_handler, | |
| 315 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 316 file_system_protocol_handler, | |
| 317 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 318 developer_protocol_handler, | 306 developer_protocol_handler, |
| 319 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 307 content::ProtocolHandlerMap* protocol_handlers) { |
| 320 chrome_protocol_handler, | |
| 321 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 322 chrome_devtools_protocol_handler) { | |
| 323 return io_data_.CreateIsolatedAppRequestContextGetter( | 308 return io_data_.CreateIsolatedAppRequestContextGetter( |
| 324 partition_path, in_memory, blob_protocol_handler.Pass(), | 309 partition_path, in_memory, developer_protocol_handler.Pass(), |
| 325 file_system_protocol_handler.Pass(), developer_protocol_handler.Pass(), | 310 protocol_handlers); |
| 326 chrome_protocol_handler.Pass(), chrome_devtools_protocol_handler.Pass()); | |
| 327 } | 311 } |
| 328 | 312 |
| 329 content::ResourceContext* OffTheRecordProfileImpl::GetResourceContext() { | 313 content::ResourceContext* OffTheRecordProfileImpl::GetResourceContext() { |
| 330 return io_data_.GetResourceContext(); | 314 return io_data_.GetResourceContext(); |
| 331 } | 315 } |
| 332 | 316 |
| 333 net::SSLConfigService* OffTheRecordProfileImpl::GetSSLConfigService() { | 317 net::SSLConfigService* OffTheRecordProfileImpl::GetSSLConfigService() { |
| 334 return profile_->GetSSLConfigService(); | 318 return profile_->GetSSLConfigService(); |
| 335 } | 319 } |
| 336 | 320 |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 void OffTheRecordProfileImpl::OnZoomLevelChanged(const std::string& host) { | 478 void OffTheRecordProfileImpl::OnZoomLevelChanged(const std::string& host) { |
| 495 if (host.empty()) | 479 if (host.empty()) |
| 496 return; | 480 return; |
| 497 | 481 |
| 498 HostZoomMap* host_zoom_map = HostZoomMap::GetForBrowserContext(this); | 482 HostZoomMap* host_zoom_map = HostZoomMap::GetForBrowserContext(this); |
| 499 HostZoomMap* parent_host_zoom_map = | 483 HostZoomMap* parent_host_zoom_map = |
| 500 HostZoomMap::GetForBrowserContext(profile_); | 484 HostZoomMap::GetForBrowserContext(profile_); |
| 501 double level = parent_host_zoom_map->GetZoomLevel(host); | 485 double level = parent_host_zoom_map->GetZoomLevel(host); |
| 502 host_zoom_map->SetZoomLevel(host, level); | 486 host_zoom_map->SetZoomLevel(host, level); |
| 503 } | 487 } |
| OLD | NEW |