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

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

Issue 9416070: Move creation and ownership of HostZoomMap to content instead of having every embedder do this. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix mac/cros browsertests Created 8 years, 10 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) 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/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/bind.h" 10 #include "base/bind.h"
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 // have an *arguably* better default charset for interpreting a raw 8bit 213 // have an *arguably* better default charset for interpreting a raw 8bit
214 // C-D header field. It means the native OS codepage fallback in 214 // C-D header field. It means the native OS codepage fallback in
215 // net_util::GetSuggestedFilename is unlikely to be taken. 215 // net_util::GetSuggestedFilename is unlikely to be taken.
216 params->referrer_charset = default_charset; 216 params->referrer_charset = default_charset;
217 217
218 params->io_thread = g_browser_process->io_thread(); 218 params->io_thread = g_browser_process->io_thread();
219 params->audio_manager = g_browser_process->audio_manager(); 219 params->audio_manager = g_browser_process->audio_manager();
220 220
221 params->host_content_settings_map = profile->GetHostContentSettingsMap(); 221 params->host_content_settings_map = profile->GetHostContentSettingsMap();
222 params->cookie_settings = CookieSettings::Factory::GetForProfile(profile); 222 params->cookie_settings = CookieSettings::Factory::GetForProfile(profile);
223 params->host_zoom_map = profile->GetHostZoomMap();
224 params->ssl_config_service = profile->GetSSLConfigService(); 223 params->ssl_config_service = profile->GetSSLConfigService();
225 base::Callback<Profile*(void)> profile_getter = 224 base::Callback<Profile*(void)> profile_getter =
226 base::Bind(&GetProfileOnUI, g_browser_process->profile_manager(), 225 base::Bind(&GetProfileOnUI, g_browser_process->profile_manager(),
227 profile); 226 profile);
228 params->cookie_monster_delegate = 227 params->cookie_monster_delegate =
229 new ChromeCookieMonsterDelegate(profile_getter); 228 new ChromeCookieMonsterDelegate(profile_getter);
230 params->extension_info_map = profile->GetExtensionInfoMap(); 229 params->extension_info_map = profile->GetExtensionInfoMap();
231 params->notification_service = 230 params->notification_service =
232 DesktopNotificationServiceFactory::GetForProfile(profile); 231 DesktopNotificationServiceFactory::GetForProfile(profile);
233 params->protocol_handler_registry = profile->GetProtocolHandlerRegistry(); 232 params->protocol_handler_registry = profile->GetProtocolHandlerRegistry();
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 EnsureInitialized(); 405 EnsureInitialized();
407 return host_resolver_; 406 return host_resolver_;
408 } 407 }
409 408
410 net::URLRequestContext* ProfileIOData::ResourceContext::GetRequestContext() { 409 net::URLRequestContext* ProfileIOData::ResourceContext::GetRequestContext() {
411 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 410 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
412 EnsureInitialized(); 411 EnsureInitialized();
413 return request_context_; 412 return request_context_;
414 } 413 }
415 414
416 content::HostZoomMap* ProfileIOData::ResourceContext::GetHostZoomMap() {
417 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
418 EnsureInitialized();
419 return host_zoom_map_;
420 }
421
422 MediaObserver* ProfileIOData::ResourceContext::GetMediaObserver() { 415 MediaObserver* ProfileIOData::ResourceContext::GetMediaObserver() {
423 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 416 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
424 EnsureInitialized(); 417 EnsureInitialized();
425 return media_observer_; 418 return media_observer_;
426 } 419 }
427 420
428 media_stream::MediaStreamManager* 421 media_stream::MediaStreamManager*
429 ProfileIOData::ResourceContext::GetMediaStreamManager() { 422 ProfileIOData::ResourceContext::GetMediaStreamManager() {
430 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 423 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
431 EnsureInitialized(); 424 EnsureInitialized();
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 // of compatible documents (PDF, etc) to the GView document viewer. 518 // of compatible documents (PDF, etc) to the GView document viewer.
526 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); 519 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess();
527 if (parsed_command_line.HasSwitch(switches::kEnableGView)) 520 if (parsed_command_line.HasSwitch(switches::kEnableGView))
528 job_factory_->AddInterceptor(new chromeos::GViewRequestInterceptor); 521 job_factory_->AddInterceptor(new chromeos::GViewRequestInterceptor);
529 #endif // defined(OS_CHROMEOS) && !defined(GOOGLE_CHROME_BUILD) 522 #endif // defined(OS_CHROMEOS) && !defined(GOOGLE_CHROME_BUILD)
530 523
531 media_stream_manager_.reset( 524 media_stream_manager_.reset(
532 new media_stream::MediaStreamManager(profile_params_->audio_manager)); 525 new media_stream::MediaStreamManager(profile_params_->audio_manager));
533 526
534 // Take ownership over these parameters. 527 // Take ownership over these parameters.
535 host_zoom_map_ = profile_params_->host_zoom_map;
536 host_content_settings_map_ = profile_params_->host_content_settings_map; 528 host_content_settings_map_ = profile_params_->host_content_settings_map;
537 cookie_settings_ = profile_params_->cookie_settings; 529 cookie_settings_ = profile_params_->cookie_settings;
538 notification_service_ = profile_params_->notification_service; 530 notification_service_ = profile_params_->notification_service;
539 extension_info_map_ = profile_params_->extension_info_map; 531 extension_info_map_ = profile_params_->extension_info_map;
540 532
541 resource_context_.host_resolver_ = io_thread_globals->host_resolver.get(); 533 resource_context_.host_resolver_ = io_thread_globals->host_resolver.get();
542 resource_context_.request_context_ = main_request_context_; 534 resource_context_.request_context_ = main_request_context_;
543 resource_context_.host_zoom_map_ = host_zoom_map_;
544 resource_context_.media_observer_ = 535 resource_context_.media_observer_ =
545 io_thread_globals->media.media_internals.get(); 536 io_thread_globals->media.media_internals.get();
546 resource_context_.media_stream_manager_ = media_stream_manager_.get(); 537 resource_context_.media_stream_manager_ = media_stream_manager_.get();
547 resource_context_.audio_manager_ = profile_params_->audio_manager; 538 resource_context_.audio_manager_ = profile_params_->audio_manager;
548 539
549 LazyInitializeInternal(profile_params_.get()); 540 LazyInitializeInternal(profile_params_.get());
550 541
551 profile_params_.reset(); 542 profile_params_.reset();
552 initialized_ = true; 543 initialized_ = true;
553 } 544 }
(...skipping 25 matching lines...) Expand all
579 &resource_context_)); 570 &resource_context_));
580 bool posted = BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, this); 571 bool posted = BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, this);
581 if (!posted) 572 if (!posted)
582 delete this; 573 delete this;
583 } 574 }
584 575
585 void ProfileIOData::set_origin_bound_cert_service( 576 void ProfileIOData::set_origin_bound_cert_service(
586 net::OriginBoundCertService* origin_bound_cert_service) const { 577 net::OriginBoundCertService* origin_bound_cert_service) const {
587 origin_bound_cert_service_.reset(origin_bound_cert_service); 578 origin_bound_cert_service_.reset(origin_bound_cert_service);
588 } 579 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_io_data.h ('k') | chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698