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

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

Issue 7713034: HostContentSettingsMap refactoring. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Tiny fixes (unnecessary #includes, win + mac fixes). Created 9 years, 3 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/bind.h" 10 #include "base/bind.h"
11 #include "base/command_line.h" 11 #include "base/command_line.h"
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "base/logging.h" 13 #include "base/logging.h"
14 #include "base/stl_util.h" 14 #include "base/stl_util.h"
15 #include "base/string_number_conversions.h" 15 #include "base/string_number_conversions.h"
16 #include "base/task.h" 16 #include "base/task.h"
17 #include "chrome/browser/browser_process.h" 17 #include "chrome/browser/browser_process.h"
18 #include "chrome/browser/content_settings/cookie_settings.h"
18 #include "chrome/browser/content_settings/host_content_settings_map.h" 19 #include "chrome/browser/content_settings/host_content_settings_map.h"
19 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" 20 #include "chrome/browser/custom_handlers/protocol_handler_registry.h"
20 #include "chrome/browser/extensions/extension_info_map.h" 21 #include "chrome/browser/extensions/extension_info_map.h"
21 #include "chrome/browser/extensions/extension_protocols.h" 22 #include "chrome/browser/extensions/extension_protocols.h"
22 #include "chrome/browser/io_thread.h" 23 #include "chrome/browser/io_thread.h"
23 #include "chrome/browser/media/media_internals.h" 24 #include "chrome/browser/media/media_internals.h"
24 #include "chrome/browser/net/chrome_cookie_notification_details.h" 25 #include "chrome/browser/net/chrome_cookie_notification_details.h"
25 #include "chrome/browser/net/chrome_dns_cert_provenance_checker_factory.h" 26 #include "chrome/browser/net/chrome_dns_cert_provenance_checker_factory.h"
26 #include "chrome/browser/net/chrome_net_log.h" 27 #include "chrome/browser/net/chrome_net_log.h"
27 #include "chrome/browser/net/chrome_network_delegate.h" 28 #include "chrome/browser/net/chrome_network_delegate.h"
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 // For the latter, we need a change on the webkit-side. 217 // For the latter, we need a change on the webkit-side.
217 // We initialize it to the default charset here and a user will 218 // We initialize it to the default charset here and a user will
218 // have an *arguably* better default charset for interpreting a raw 8bit 219 // have an *arguably* better default charset for interpreting a raw 8bit
219 // C-D header field. It means the native OS codepage fallback in 220 // C-D header field. It means the native OS codepage fallback in
220 // net_util::GetSuggestedFilename is unlikely to be taken. 221 // net_util::GetSuggestedFilename is unlikely to be taken.
221 params->referrer_charset = default_charset; 222 params->referrer_charset = default_charset;
222 223
223 params->io_thread = g_browser_process->io_thread(); 224 params->io_thread = g_browser_process->io_thread();
224 225
225 params->host_content_settings_map = profile->GetHostContentSettingsMap(); 226 params->host_content_settings_map = profile->GetHostContentSettingsMap();
227 params->cookie_settings = CookieSettings::GetForProfile(profile);
226 params->host_zoom_map = profile->GetHostZoomMap(); 228 params->host_zoom_map = profile->GetHostZoomMap();
227 params->transport_security_state = profile->GetTransportSecurityState(); 229 params->transport_security_state = profile->GetTransportSecurityState();
228 params->ssl_config_service = profile->GetSSLConfigService(); 230 params->ssl_config_service = profile->GetSSLConfigService();
229 base::Callback<Profile*(void)> profile_getter = 231 base::Callback<Profile*(void)> profile_getter =
230 base::Bind(&GetProfileOnUI, g_browser_process->profile_manager(), 232 base::Bind(&GetProfileOnUI, g_browser_process->profile_manager(),
231 profile); 233 profile);
232 params->cookie_monster_delegate = 234 params->cookie_monster_delegate =
233 new ChromeCookieMonsterDelegate(profile_getter); 235 new ChromeCookieMonsterDelegate(profile_getter);
234 params->database_tracker = profile->GetDatabaseTracker(); 236 params->database_tracker = profile->GetDatabaseTracker();
235 params->appcache_service = profile->GetAppCacheService(); 237 params->appcache_service = profile->GetAppCacheService();
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 } 363 }
362 364
363 ExtensionInfoMap* ProfileIOData::GetExtensionInfoMap() const { 365 ExtensionInfoMap* ProfileIOData::GetExtensionInfoMap() const {
364 return extension_info_map_; 366 return extension_info_map_;
365 } 367 }
366 368
367 HostContentSettingsMap* ProfileIOData::GetHostContentSettingsMap() const { 369 HostContentSettingsMap* ProfileIOData::GetHostContentSettingsMap() const {
368 return host_content_settings_map_; 370 return host_content_settings_map_;
369 } 371 }
370 372
373 CookieSettings* ProfileIOData::GetCookieSettings() const {
374 return cookie_settings_;
375 }
376
371 DesktopNotificationService* ProfileIOData::GetNotificationService() const { 377 DesktopNotificationService* ProfileIOData::GetNotificationService() const {
372 return notification_service_; 378 return notification_service_;
373 } 379 }
374 380
375 ProfileIOData::ResourceContext::ResourceContext(const ProfileIOData* io_data) 381 ProfileIOData::ResourceContext::ResourceContext(const ProfileIOData* io_data)
376 : io_data_(io_data) { 382 : io_data_(io_data) {
377 DCHECK(io_data); 383 DCHECK(io_data);
378 } 384 }
379 385
380 ProfileIOData::ResourceContext::~ResourceContext() {} 386 ProfileIOData::ResourceContext::~ResourceContext() {}
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 #endif // defined(OS_CHROMEOS) 469 #endif // defined(OS_CHROMEOS)
464 470
465 // Take ownership over these parameters. 471 // Take ownership over these parameters.
466 database_tracker_ = profile_params_->database_tracker; 472 database_tracker_ = profile_params_->database_tracker;
467 appcache_service_ = profile_params_->appcache_service; 473 appcache_service_ = profile_params_->appcache_service;
468 blob_storage_context_ = profile_params_->blob_storage_context; 474 blob_storage_context_ = profile_params_->blob_storage_context;
469 file_system_context_ = profile_params_->file_system_context; 475 file_system_context_ = profile_params_->file_system_context;
470 quota_manager_ = profile_params_->quota_manager; 476 quota_manager_ = profile_params_->quota_manager;
471 host_zoom_map_ = profile_params_->host_zoom_map; 477 host_zoom_map_ = profile_params_->host_zoom_map;
472 host_content_settings_map_ = profile_params_->host_content_settings_map; 478 host_content_settings_map_ = profile_params_->host_content_settings_map;
479 cookie_settings_ = profile_params_->cookie_settings;
473 notification_service_ = profile_params_->notification_service; 480 notification_service_ = profile_params_->notification_service;
474 extension_info_map_ = profile_params_->extension_info_map; 481 extension_info_map_ = profile_params_->extension_info_map;
475 prerender_manager_getter_ = profile_params_->prerender_manager_getter; 482 prerender_manager_getter_ = profile_params_->prerender_manager_getter;
476 483
477 resource_context_.set_host_resolver(io_thread_globals->host_resolver.get()); 484 resource_context_.set_host_resolver(io_thread_globals->host_resolver.get());
478 resource_context_.set_request_context(main_request_context_); 485 resource_context_.set_request_context(main_request_context_);
479 resource_context_.set_database_tracker(database_tracker_); 486 resource_context_.set_database_tracker(database_tracker_);
480 resource_context_.set_appcache_service(appcache_service_); 487 resource_context_.set_appcache_service(appcache_service_);
481 resource_context_.set_blob_storage_context(blob_storage_context_); 488 resource_context_.set_blob_storage_context(blob_storage_context_);
482 resource_context_.set_file_system_context(file_system_context_); 489 resource_context_.set_file_system_context(file_system_context_);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 bool posted = BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, 525 bool posted = BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
519 new DeleteTask<ProfileIOData>(this)); 526 new DeleteTask<ProfileIOData>(this));
520 if (!posted) 527 if (!posted)
521 delete this; 528 delete this;
522 } 529 }
523 530
524 void ProfileIOData::set_origin_bound_cert_service( 531 void ProfileIOData::set_origin_bound_cert_service(
525 net::OriginBoundCertService* origin_bound_cert_service) const { 532 net::OriginBoundCertService* origin_bound_cert_service) const {
526 origin_bound_cert_service_.reset(origin_bound_cert_service); 533 origin_bound_cert_service_.reset(origin_bound_cert_service);
527 } 534 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698