| 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 #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/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/stl_util-inl.h" | 13 #include "base/stl_util-inl.h" |
| 14 #include "base/string_number_conversions.h" | 14 #include "base/string_number_conversions.h" |
| 15 #include "chrome/browser/browser_process.h" | 15 #include "chrome/browser/browser_process.h" |
| 16 #include "chrome/browser/content_settings/host_content_settings_map.h" | 16 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| 17 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" | 17 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
| 18 #include "chrome/browser/extensions/extension_protocols.h" | 18 #include "chrome/browser/extensions/extension_protocols.h" |
| 19 #include "chrome/browser/extensions/user_script_master.h" | 19 #include "chrome/browser/extensions/user_script_master.h" |
| 20 #include "chrome/browser/io_thread.h" | 20 #include "chrome/browser/io_thread.h" |
| 21 #include "chrome/browser/net/chrome_cookie_notification_details.h" | 21 #include "chrome/browser/net/chrome_cookie_notification_details.h" |
| 22 #include "chrome/browser/net/chrome_dns_cert_provenance_checker_factory.h" | 22 #include "chrome/browser/net/chrome_dns_cert_provenance_checker_factory.h" |
| 23 #include "chrome/browser/net/chrome_net_log.h" | 23 #include "chrome/browser/net/chrome_net_log.h" |
| 24 #include "chrome/browser/net/chrome_network_delegate.h" | 24 #include "chrome/browser/net/chrome_network_delegate.h" |
| 25 #include "chrome/browser/net/connect_interceptor.h" |
| 25 #include "chrome/browser/net/metadata_url_request.h" | 26 #include "chrome/browser/net/metadata_url_request.h" |
| 27 #include "chrome/browser/net/predictor.h" |
| 26 #include "chrome/browser/net/pref_proxy_config_service.h" | 28 #include "chrome/browser/net/pref_proxy_config_service.h" |
| 27 #include "chrome/browser/net/proxy_service_factory.h" | 29 #include "chrome/browser/net/proxy_service_factory.h" |
| 28 #include "chrome/browser/notifications/desktop_notification_service_factory.h" | 30 #include "chrome/browser/notifications/desktop_notification_service_factory.h" |
| 29 #include "chrome/browser/prefs/pref_service.h" | 31 #include "chrome/browser/prefs/pref_service.h" |
| 30 #include "chrome/browser/prerender/prerender_manager.h" | 32 #include "chrome/browser/prerender/prerender_manager.h" |
| 31 #include "chrome/browser/profiles/profile.h" | 33 #include "chrome/browser/profiles/profile.h" |
| 32 #include "chrome/browser/ui/webui/chrome_url_data_manager_backend.h" | 34 #include "chrome/browser/ui/webui/chrome_url_data_manager_backend.h" |
| 33 #include "chrome/common/chrome_switches.h" | 35 #include "chrome/common/chrome_switches.h" |
| 34 #include "chrome/common/pref_names.h" | 36 #include "chrome/common/pref_names.h" |
| 35 #include "chrome/common/url_constants.h" | 37 #include "chrome/common/url_constants.h" |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 new ChromeBlobProtocolHandler( | 458 new ChromeBlobProtocolHandler( |
| 457 profile_params_->blob_storage_context->controller(), | 459 profile_params_->blob_storage_context->controller(), |
| 458 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE))); | 460 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE))); |
| 459 DCHECK(set_protocol); | 461 DCHECK(set_protocol); |
| 460 set_protocol = job_factory_->SetProtocolHandler( | 462 set_protocol = job_factory_->SetProtocolHandler( |
| 461 chrome::kFileSystemScheme, | 463 chrome::kFileSystemScheme, |
| 462 CreateFileSystemProtocolHandler( | 464 CreateFileSystemProtocolHandler( |
| 463 profile_params_->file_system_context, | 465 profile_params_->file_system_context, |
| 464 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE))); | 466 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE))); |
| 465 DCHECK(set_protocol); | 467 DCHECK(set_protocol); |
| 468 job_factory_->AddInterceptor( |
| 469 new chrome_browser_net::ConnectInterceptor(predictor_.get())); |
| 466 #if defined(OS_CHROMEOS) | 470 #if defined(OS_CHROMEOS) |
| 467 // Install the GView request interceptor that will redirect requests | 471 // Install the GView request interceptor that will redirect requests |
| 468 // of compatible documents (PDF, etc) to the GView document viewer. | 472 // of compatible documents (PDF, etc) to the GView document viewer. |
| 469 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); | 473 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); |
| 470 if (parsed_command_line.HasSwitch(switches::kEnableGView)) | 474 if (parsed_command_line.HasSwitch(switches::kEnableGView)) |
| 471 job_factory_->AddInterceptor(new chromeos::GViewRequestInterceptor); | 475 job_factory_->AddInterceptor(new chromeos::GViewRequestInterceptor); |
| 472 #endif // defined(OS_CHROMEOS) | 476 #endif // defined(OS_CHROMEOS) |
| 473 | 477 |
| 474 // Take ownership over these parameters. | 478 // Take ownership over these parameters. |
| 475 database_tracker_ = profile_params_->database_tracker; | 479 database_tracker_ = profile_params_->database_tracker; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 context->set_appcache_service(profile_params_->appcache_service); | 516 context->set_appcache_service(profile_params_->appcache_service); |
| 513 context->set_blob_storage_context(profile_params_->blob_storage_context); | 517 context->set_blob_storage_context(profile_params_->blob_storage_context); |
| 514 context->set_file_system_context(profile_params_->file_system_context); | 518 context->set_file_system_context(profile_params_->file_system_context); |
| 515 context->set_extension_info_map(profile_params_->extension_info_map); | 519 context->set_extension_info_map(profile_params_->extension_info_map); |
| 516 } | 520 } |
| 517 | 521 |
| 518 void ProfileIOData::ShutdownOnUIThread() { | 522 void ProfileIOData::ShutdownOnUIThread() { |
| 519 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 523 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 520 enable_referrers_.Destroy(); | 524 enable_referrers_.Destroy(); |
| 521 } | 525 } |
| 526 |
| 527 chrome_browser_net::Predictor* ProfileIOData::GetPredictor() { |
| 528 return predictor_.get(); |
| 529 } |
| 530 |
| 531 void ProfileIOData::SetPredictor(chrome_browser_net::Predictor* predictor) { |
| 532 predictor_.reset(predictor); |
| 533 } |
| OLD | NEW |