| 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" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 #include "net/proxy/proxy_config_service_fixed.h" | 42 #include "net/proxy/proxy_config_service_fixed.h" |
| 43 #include "net/proxy/proxy_script_fetcher_impl.h" | 43 #include "net/proxy/proxy_script_fetcher_impl.h" |
| 44 #include "net/proxy/proxy_service.h" | 44 #include "net/proxy/proxy_service.h" |
| 45 #include "net/url_request/url_request.h" | 45 #include "net/url_request/url_request.h" |
| 46 #include "webkit/blob/blob_data.h" | 46 #include "webkit/blob/blob_data.h" |
| 47 #include "webkit/blob/blob_url_request_job_factory.h" | 47 #include "webkit/blob/blob_url_request_job_factory.h" |
| 48 #include "webkit/fileapi/file_system_url_request_job_factory.h" | 48 #include "webkit/fileapi/file_system_url_request_job_factory.h" |
| 49 #include "webkit/database/database_tracker.h" | 49 #include "webkit/database/database_tracker.h" |
| 50 #include "webkit/quota/quota_manager.h" | 50 #include "webkit/quota/quota_manager.h" |
| 51 | 51 |
| 52 #if defined(OS_CHROMEOS) | |
| 53 #include "chrome/browser/chromeos/gview_request_interceptor.h" | |
| 54 #endif // defined(OS_CHROMEOS) | |
| 55 | |
| 56 namespace { | 52 namespace { |
| 57 | 53 |
| 58 // ---------------------------------------------------------------------------- | 54 // ---------------------------------------------------------------------------- |
| 59 // CookieMonster::Delegate implementation | 55 // CookieMonster::Delegate implementation |
| 60 // ---------------------------------------------------------------------------- | 56 // ---------------------------------------------------------------------------- |
| 61 class ChromeCookieMonsterDelegate : public net::CookieMonster::Delegate { | 57 class ChromeCookieMonsterDelegate : public net::CookieMonster::Delegate { |
| 62 public: | 58 public: |
| 63 explicit ChromeCookieMonsterDelegate(Profile* profile) { | 59 explicit ChromeCookieMonsterDelegate(Profile* profile) { |
| 64 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 60 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 65 profile_getter_ = new ProfileGetter(profile); | 61 profile_getter_ = new ProfileGetter(profile); |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 new ChromeBlobProtocolHandler( | 450 new ChromeBlobProtocolHandler( |
| 455 profile_params_->blob_storage_context->controller(), | 451 profile_params_->blob_storage_context->controller(), |
| 456 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE))); | 452 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE))); |
| 457 DCHECK(set_protocol); | 453 DCHECK(set_protocol); |
| 458 set_protocol = job_factory_->SetProtocolHandler( | 454 set_protocol = job_factory_->SetProtocolHandler( |
| 459 chrome::kFileSystemScheme, | 455 chrome::kFileSystemScheme, |
| 460 CreateFileSystemProtocolHandler( | 456 CreateFileSystemProtocolHandler( |
| 461 profile_params_->file_system_context, | 457 profile_params_->file_system_context, |
| 462 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE))); | 458 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE))); |
| 463 DCHECK(set_protocol); | 459 DCHECK(set_protocol); |
| 464 #if defined(OS_CHROMEOS) | |
| 465 // Install the GView request interceptor that will redirect requests | |
| 466 // of compatible documents (PDF, etc) to the GView document viewer. | |
| 467 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); | |
| 468 if (parsed_command_line.HasSwitch(switches::kEnableGView)) | |
| 469 job_factory_->AddInterceptor(new chromeos::GViewRequestInterceptor); | |
| 470 #endif // defined(OS_CHROMEOS) | |
| 471 | 460 |
| 472 // Take ownership over these parameters. | 461 // Take ownership over these parameters. |
| 473 database_tracker_ = profile_params_->database_tracker; | 462 database_tracker_ = profile_params_->database_tracker; |
| 474 appcache_service_ = profile_params_->appcache_service; | 463 appcache_service_ = profile_params_->appcache_service; |
| 475 blob_storage_context_ = profile_params_->blob_storage_context; | 464 blob_storage_context_ = profile_params_->blob_storage_context; |
| 476 file_system_context_ = profile_params_->file_system_context; | 465 file_system_context_ = profile_params_->file_system_context; |
| 477 quota_manager_ = profile_params_->quota_manager; | 466 quota_manager_ = profile_params_->quota_manager; |
| 478 host_zoom_map_ = profile_params_->host_zoom_map; | 467 host_zoom_map_ = profile_params_->host_zoom_map; |
| 479 host_content_settings_map_ = profile_params_->host_content_settings_map; | 468 host_content_settings_map_ = profile_params_->host_content_settings_map; |
| 480 extension_info_map_ = profile_params_->extension_info_map; | 469 extension_info_map_ = profile_params_->extension_info_map; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 511 context->set_appcache_service(profile_params_->appcache_service); | 500 context->set_appcache_service(profile_params_->appcache_service); |
| 512 context->set_blob_storage_context(profile_params_->blob_storage_context); | 501 context->set_blob_storage_context(profile_params_->blob_storage_context); |
| 513 context->set_file_system_context(profile_params_->file_system_context); | 502 context->set_file_system_context(profile_params_->file_system_context); |
| 514 context->set_extension_info_map(profile_params_->extension_info_map); | 503 context->set_extension_info_map(profile_params_->extension_info_map); |
| 515 } | 504 } |
| 516 | 505 |
| 517 void ProfileIOData::ShutdownOnUIThread() { | 506 void ProfileIOData::ShutdownOnUIThread() { |
| 518 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 507 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 519 enable_referrers_.Destroy(); | 508 enable_referrers_.Destroy(); |
| 520 } | 509 } |
| OLD | NEW |