| 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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 DownloadManagerDelegate* OffTheRecordProfileImpl::GetDownloadManagerDelegate() { | 251 DownloadManagerDelegate* OffTheRecordProfileImpl::GetDownloadManagerDelegate() { |
| 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 content::ProtocolHandlerMap* protocol_handlers) { |
| 262 blob_protocol_handler, | 262 return io_data_.CreateMainRequestContextGetter(protocol_handlers); |
| 263 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 264 file_system_protocol_handler, | |
| 265 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 266 developer_protocol_handler, | |
| 267 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 268 chrome_protocol_handler, | |
| 269 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 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 } | 263 } |
| 275 | 264 |
| 276 net::URLRequestContextGetter* | 265 net::URLRequestContextGetter* |
| 277 OffTheRecordProfileImpl::GetRequestContextForRenderProcess( | 266 OffTheRecordProfileImpl::GetRequestContextForRenderProcess( |
| 278 int renderer_child_id) { | 267 int renderer_child_id) { |
| 279 content::RenderProcessHost* rph = content::RenderProcessHost::FromID( | 268 content::RenderProcessHost* rph = content::RenderProcessHost::FromID( |
| 280 renderer_child_id); | 269 renderer_child_id); |
| 281 return rph->GetStoragePartition()->GetURLRequestContext(); | 270 return rph->GetStoragePartition()->GetURLRequestContext(); |
| 282 } | 271 } |
| 283 | 272 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 303 | 292 |
| 304 net::URLRequestContextGetter* | 293 net::URLRequestContextGetter* |
| 305 OffTheRecordProfileImpl::GetRequestContextForExtensions() { | 294 OffTheRecordProfileImpl::GetRequestContextForExtensions() { |
| 306 return io_data_.GetExtensionsRequestContextGetter(); | 295 return io_data_.GetExtensionsRequestContextGetter(); |
| 307 } | 296 } |
| 308 | 297 |
| 309 net::URLRequestContextGetter* | 298 net::URLRequestContextGetter* |
| 310 OffTheRecordProfileImpl::CreateRequestContextForStoragePartition( | 299 OffTheRecordProfileImpl::CreateRequestContextForStoragePartition( |
| 311 const base::FilePath& partition_path, | 300 const base::FilePath& partition_path, |
| 312 bool in_memory, | 301 bool in_memory, |
| 313 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 302 content::ProtocolHandlerMap* protocol_handlers) { |
| 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, | |
| 319 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 320 chrome_protocol_handler, | |
| 321 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 322 chrome_devtools_protocol_handler) { | |
| 323 return io_data_.CreateIsolatedAppRequestContextGetter( | 303 return io_data_.CreateIsolatedAppRequestContextGetter( |
| 324 partition_path, in_memory, blob_protocol_handler.Pass(), | 304 partition_path, in_memory, protocol_handlers); |
| 325 file_system_protocol_handler.Pass(), developer_protocol_handler.Pass(), | |
| 326 chrome_protocol_handler.Pass(), chrome_devtools_protocol_handler.Pass()); | |
| 327 } | 305 } |
| 328 | 306 |
| 329 content::ResourceContext* OffTheRecordProfileImpl::GetResourceContext() { | 307 content::ResourceContext* OffTheRecordProfileImpl::GetResourceContext() { |
| 330 return io_data_.GetResourceContext(); | 308 return io_data_.GetResourceContext(); |
| 331 } | 309 } |
| 332 | 310 |
| 333 net::SSLConfigService* OffTheRecordProfileImpl::GetSSLConfigService() { | 311 net::SSLConfigService* OffTheRecordProfileImpl::GetSSLConfigService() { |
| 334 return profile_->GetSSLConfigService(); | 312 return profile_->GetSSLConfigService(); |
| 335 } | 313 } |
| 336 | 314 |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 void OffTheRecordProfileImpl::OnZoomLevelChanged(const std::string& host) { | 472 void OffTheRecordProfileImpl::OnZoomLevelChanged(const std::string& host) { |
| 495 if (host.empty()) | 473 if (host.empty()) |
| 496 return; | 474 return; |
| 497 | 475 |
| 498 HostZoomMap* host_zoom_map = HostZoomMap::GetForBrowserContext(this); | 476 HostZoomMap* host_zoom_map = HostZoomMap::GetForBrowserContext(this); |
| 499 HostZoomMap* parent_host_zoom_map = | 477 HostZoomMap* parent_host_zoom_map = |
| 500 HostZoomMap::GetForBrowserContext(profile_); | 478 HostZoomMap::GetForBrowserContext(profile_); |
| 501 double level = parent_host_zoom_map->GetZoomLevel(host); | 479 double level = parent_host_zoom_map->GetZoomLevel(host); |
| 502 host_zoom_map->SetZoomLevel(host, level); | 480 host_zoom_map->SetZoomLevel(host, level); |
| 503 } | 481 } |
| OLD | NEW |