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

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

Issue 8383004: Adding CookieSettings for storing cookie content settings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing the rebase. Created 9 years, 1 month 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_fraudulent_certificate_reporter.h" 27 #include "chrome/browser/net/chrome_fraudulent_certificate_reporter.h"
27 #include "chrome/browser/net/chrome_net_log.h" 28 #include "chrome/browser/net/chrome_net_log.h"
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 // For the latter, we need a change on the webkit-side. 214 // For the latter, we need a change on the webkit-side.
214 // We initialize it to the default charset here and a user will 215 // We initialize it to the default charset here and a user will
215 // have an *arguably* better default charset for interpreting a raw 8bit 216 // have an *arguably* better default charset for interpreting a raw 8bit
216 // C-D header field. It means the native OS codepage fallback in 217 // C-D header field. It means the native OS codepage fallback in
217 // net_util::GetSuggestedFilename is unlikely to be taken. 218 // net_util::GetSuggestedFilename is unlikely to be taken.
218 params->referrer_charset = default_charset; 219 params->referrer_charset = default_charset;
219 220
220 params->io_thread = g_browser_process->io_thread(); 221 params->io_thread = g_browser_process->io_thread();
221 222
222 params->host_content_settings_map = profile->GetHostContentSettingsMap(); 223 params->host_content_settings_map = profile->GetHostContentSettingsMap();
224 params->cookie_settings = CookieSettings::GetForProfile(profile);
223 params->host_zoom_map = profile->GetHostZoomMap(); 225 params->host_zoom_map = profile->GetHostZoomMap();
224 params->ssl_config_service = profile->GetSSLConfigService(); 226 params->ssl_config_service = profile->GetSSLConfigService();
225 base::Callback<Profile*(void)> profile_getter = 227 base::Callback<Profile*(void)> profile_getter =
226 base::Bind(&GetProfileOnUI, g_browser_process->profile_manager(), 228 base::Bind(&GetProfileOnUI, g_browser_process->profile_manager(),
227 profile); 229 profile);
228 params->cookie_monster_delegate = 230 params->cookie_monster_delegate =
229 new ChromeCookieMonsterDelegate(profile_getter); 231 new ChromeCookieMonsterDelegate(profile_getter);
230 params->database_tracker = profile->GetDatabaseTracker(); 232 params->database_tracker = profile->GetDatabaseTracker();
231 params->appcache_service = profile->GetAppCacheService(); 233 params->appcache_service = profile->GetAppCacheService();
232 params->blob_storage_context = profile->GetBlobStorageContext(); 234 params->blob_storage_context = profile->GetBlobStorageContext();
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 } 366 }
365 367
366 ExtensionInfoMap* ProfileIOData::GetExtensionInfoMap() const { 368 ExtensionInfoMap* ProfileIOData::GetExtensionInfoMap() const {
367 return extension_info_map_; 369 return extension_info_map_;
368 } 370 }
369 371
370 HostContentSettingsMap* ProfileIOData::GetHostContentSettingsMap() const { 372 HostContentSettingsMap* ProfileIOData::GetHostContentSettingsMap() const {
371 return host_content_settings_map_; 373 return host_content_settings_map_;
372 } 374 }
373 375
376 CookieSettings* ProfileIOData::GetCookieSettings() const {
377 return cookie_settings_;
378 }
379
374 DesktopNotificationService* ProfileIOData::GetNotificationService() const { 380 DesktopNotificationService* ProfileIOData::GetNotificationService() const {
375 return notification_service_; 381 return notification_service_;
376 } 382 }
377 383
378 ProfileIOData::ResourceContext::ResourceContext(const ProfileIOData* io_data) 384 ProfileIOData::ResourceContext::ResourceContext(const ProfileIOData* io_data)
379 : io_data_(io_data) { 385 : io_data_(io_data) {
380 DCHECK(io_data); 386 DCHECK(io_data);
381 } 387 }
382 388
383 ProfileIOData::ResourceContext::~ResourceContext() {} 389 ProfileIOData::ResourceContext::~ResourceContext() {}
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 media_stream_manager_.reset(new media_stream::MediaStreamManager); 485 media_stream_manager_.reset(new media_stream::MediaStreamManager);
480 486
481 // Take ownership over these parameters. 487 // Take ownership over these parameters.
482 database_tracker_ = profile_params_->database_tracker; 488 database_tracker_ = profile_params_->database_tracker;
483 appcache_service_ = profile_params_->appcache_service; 489 appcache_service_ = profile_params_->appcache_service;
484 blob_storage_context_ = profile_params_->blob_storage_context; 490 blob_storage_context_ = profile_params_->blob_storage_context;
485 file_system_context_ = profile_params_->file_system_context; 491 file_system_context_ = profile_params_->file_system_context;
486 quota_manager_ = profile_params_->quota_manager; 492 quota_manager_ = profile_params_->quota_manager;
487 host_zoom_map_ = profile_params_->host_zoom_map; 493 host_zoom_map_ = profile_params_->host_zoom_map;
488 host_content_settings_map_ = profile_params_->host_content_settings_map; 494 host_content_settings_map_ = profile_params_->host_content_settings_map;
495 cookie_settings_ = profile_params_->cookie_settings;
489 notification_service_ = profile_params_->notification_service; 496 notification_service_ = profile_params_->notification_service;
490 extension_info_map_ = profile_params_->extension_info_map; 497 extension_info_map_ = profile_params_->extension_info_map;
491 498
492 resource_context_.set_host_resolver(io_thread_globals->host_resolver.get()); 499 resource_context_.set_host_resolver(io_thread_globals->host_resolver.get());
493 resource_context_.set_request_context(main_request_context_); 500 resource_context_.set_request_context(main_request_context_);
494 resource_context_.set_database_tracker(database_tracker_); 501 resource_context_.set_database_tracker(database_tracker_);
495 resource_context_.set_appcache_service(appcache_service_); 502 resource_context_.set_appcache_service(appcache_service_);
496 resource_context_.set_blob_storage_context(blob_storage_context_); 503 resource_context_.set_blob_storage_context(blob_storage_context_);
497 resource_context_.set_file_system_context(file_system_context_); 504 resource_context_.set_file_system_context(file_system_context_);
498 resource_context_.set_quota_manager(quota_manager_); 505 resource_context_.set_quota_manager(quota_manager_);
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 bool posted = BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, 543 bool posted = BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
537 new DeleteTask<ProfileIOData>(this)); 544 new DeleteTask<ProfileIOData>(this));
538 if (!posted) 545 if (!posted)
539 delete this; 546 delete this;
540 } 547 }
541 548
542 void ProfileIOData::set_origin_bound_cert_service( 549 void ProfileIOData::set_origin_bound_cert_service(
543 net::OriginBoundCertService* origin_bound_cert_service) const { 550 net::OriginBoundCertService* origin_bound_cert_service) const {
544 origin_bound_cert_service_.reset(origin_bound_cert_service); 551 origin_bound_cert_service_.reset(origin_bound_cert_service);
545 } 552 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_io_data.h ('k') | chrome/browser/renderer_host/chrome_render_message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698