Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(282)

Side by Side Diff: chrome/browser/profiles/profile_io_data.cc

Issue 7019030: Remove ProtocolFactory/Interceptor uses in GViewRequestInterceptor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix release. Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
52 namespace { 56 namespace {
53 57
54 // ---------------------------------------------------------------------------- 58 // ----------------------------------------------------------------------------
55 // CookieMonster::Delegate implementation 59 // CookieMonster::Delegate implementation
56 // ---------------------------------------------------------------------------- 60 // ----------------------------------------------------------------------------
57 class ChromeCookieMonsterDelegate : public net::CookieMonster::Delegate { 61 class ChromeCookieMonsterDelegate : public net::CookieMonster::Delegate {
58 public: 62 public:
59 explicit ChromeCookieMonsterDelegate(Profile* profile) { 63 explicit ChromeCookieMonsterDelegate(Profile* profile) {
60 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 64 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
61 profile_getter_ = new ProfileGetter(profile); 65 profile_getter_ = new ProfileGetter(profile);
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 new ChromeBlobProtocolHandler( 454 new ChromeBlobProtocolHandler(
451 profile_params_->blob_storage_context->controller(), 455 profile_params_->blob_storage_context->controller(),
452 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE))); 456 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE)));
453 DCHECK(set_protocol); 457 DCHECK(set_protocol);
454 set_protocol = job_factory_->SetProtocolHandler( 458 set_protocol = job_factory_->SetProtocolHandler(
455 chrome::kFileSystemScheme, 459 chrome::kFileSystemScheme,
456 CreateFileSystemProtocolHandler( 460 CreateFileSystemProtocolHandler(
457 profile_params_->file_system_context, 461 profile_params_->file_system_context,
458 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE))); 462 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE)));
459 DCHECK(set_protocol); 463 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)
460 471
461 // Take ownership over these parameters. 472 // Take ownership over these parameters.
462 database_tracker_ = profile_params_->database_tracker; 473 database_tracker_ = profile_params_->database_tracker;
463 appcache_service_ = profile_params_->appcache_service; 474 appcache_service_ = profile_params_->appcache_service;
464 blob_storage_context_ = profile_params_->blob_storage_context; 475 blob_storage_context_ = profile_params_->blob_storage_context;
465 file_system_context_ = profile_params_->file_system_context; 476 file_system_context_ = profile_params_->file_system_context;
466 quota_manager_ = profile_params_->quota_manager; 477 quota_manager_ = profile_params_->quota_manager;
467 host_zoom_map_ = profile_params_->host_zoom_map; 478 host_zoom_map_ = profile_params_->host_zoom_map;
468 host_content_settings_map_ = profile_params_->host_content_settings_map; 479 host_content_settings_map_ = profile_params_->host_content_settings_map;
469 extension_info_map_ = profile_params_->extension_info_map; 480 extension_info_map_ = profile_params_->extension_info_map;
(...skipping 30 matching lines...) Expand all
500 context->set_appcache_service(profile_params_->appcache_service); 511 context->set_appcache_service(profile_params_->appcache_service);
501 context->set_blob_storage_context(profile_params_->blob_storage_context); 512 context->set_blob_storage_context(profile_params_->blob_storage_context);
502 context->set_file_system_context(profile_params_->file_system_context); 513 context->set_file_system_context(profile_params_->file_system_context);
503 context->set_extension_info_map(profile_params_->extension_info_map); 514 context->set_extension_info_map(profile_params_->extension_info_map);
504 } 515 }
505 516
506 void ProfileIOData::ShutdownOnUIThread() { 517 void ProfileIOData::ShutdownOnUIThread() {
507 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 518 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
508 enable_referrers_.Destroy(); 519 enable_referrers_.Destroy();
509 } 520 }
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/gview_request_interceptor_unittest.cc ('k') | chrome/browser/ui/browser_init.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698