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

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

Issue 9235004: [Garbled Text][Infobar] Adding infobar to suggest turning on encoding detection. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rebase Created 8 years, 11 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
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"
11 #include "base/bind_helpers.h" 11 #include "base/bind_helpers.h"
12 #include "base/command_line.h" 12 #include "base/command_line.h"
13 #include "base/compiler_specific.h" 13 #include "base/compiler_specific.h"
14 #include "base/logging.h" 14 #include "base/logging.h"
15 #include "base/stl_util.h" 15 #include "base/stl_util.h"
16 #include "base/string_number_conversions.h" 16 #include "base/string_number_conversions.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/cookie_settings.h"
19 #include "chrome/browser/content_settings/host_content_settings_map.h" 19 #include "chrome/browser/content_settings/host_content_settings_map.h"
20 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" 20 #include "chrome/browser/custom_handlers/protocol_handler_registry.h"
21 #include "chrome/browser/download/download_service.h" 21 #include "chrome/browser/download/download_service.h"
22 #include "chrome/browser/download/download_service_factory.h" 22 #include "chrome/browser/download/download_service_factory.h"
23 #include "chrome/browser/extensions/extension_info_map.h" 23 #include "chrome/browser/extensions/extension_info_map.h"
24 #include "chrome/browser/extensions/extension_protocols.h" 24 #include "chrome/browser/extensions/extension_protocols.h"
25 #include "chrome/browser/garbled_text_service.h"
26 #include "chrome/browser/garbled_text_url_tracker.h"
25 #include "chrome/browser/io_thread.h" 27 #include "chrome/browser/io_thread.h"
26 #include "chrome/browser/media/media_internals.h" 28 #include "chrome/browser/media/media_internals.h"
27 #include "chrome/browser/net/chrome_cookie_notification_details.h" 29 #include "chrome/browser/net/chrome_cookie_notification_details.h"
28 #include "chrome/browser/net/chrome_fraudulent_certificate_reporter.h" 30 #include "chrome/browser/net/chrome_fraudulent_certificate_reporter.h"
29 #include "chrome/browser/net/chrome_net_log.h" 31 #include "chrome/browser/net/chrome_net_log.h"
30 #include "chrome/browser/net/chrome_network_delegate.h" 32 #include "chrome/browser/net/chrome_network_delegate.h"
31 #include "chrome/browser/net/proxy_service_factory.h" 33 #include "chrome/browser/net/proxy_service_factory.h"
32 #include "chrome/browser/notifications/desktop_notification_service_factory.h" 34 #include "chrome/browser/notifications/desktop_notification_service_factory.h"
33 #include "chrome/browser/policy/url_blacklist_manager.h" 35 #include "chrome/browser/policy/url_blacklist_manager.h"
34 #include "chrome/browser/prefs/pref_service.h" 36 #include "chrome/browser/prefs/pref_service.h"
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 new ChromeCookieMonsterDelegate(profile_getter); 237 new ChromeCookieMonsterDelegate(profile_getter);
236 params->database_tracker = profile->GetDatabaseTracker(); 238 params->database_tracker = profile->GetDatabaseTracker();
237 params->appcache_service = profile->GetAppCacheService(); 239 params->appcache_service = profile->GetAppCacheService();
238 params->blob_storage_context = profile->GetBlobStorageContext(); 240 params->blob_storage_context = profile->GetBlobStorageContext();
239 params->file_system_context = profile->GetFileSystemContext(); 241 params->file_system_context = profile->GetFileSystemContext();
240 params->quota_manager = profile->GetQuotaManager(); 242 params->quota_manager = profile->GetQuotaManager();
241 params->extension_info_map = profile->GetExtensionInfoMap(); 243 params->extension_info_map = profile->GetExtensionInfoMap();
242 params->notification_service = 244 params->notification_service =
243 DesktopNotificationServiceFactory::GetForProfile(profile); 245 DesktopNotificationServiceFactory::GetForProfile(profile);
244 params->protocol_handler_registry = profile->GetProtocolHandlerRegistry(); 246 params->protocol_handler_registry = profile->GetProtocolHandlerRegistry();
247 params->garbled_text_params.reset(
248 new GarbledTextServiceParams(
249 profile->GetPrefs(),
250 GarbledTextServiceFactory::GetForProfile(profile)));
245 251
246 ChromeProxyConfigService* proxy_config_service = 252 ChromeProxyConfigService* proxy_config_service =
247 ProxyServiceFactory::CreateProxyConfigService(true); 253 ProxyServiceFactory::CreateProxyConfigService(true);
248 params->proxy_config_service.reset(proxy_config_service); 254 params->proxy_config_service.reset(proxy_config_service);
249 profile->GetProxyConfigTracker()->SetChromeProxyConfigService( 255 profile->GetProxyConfigTracker()->SetChromeProxyConfigService(
250 proxy_config_service); 256 proxy_config_service);
251 params->profile = profile; 257 params->profile = profile;
252 profile_params_.reset(params.release()); 258 profile_params_.reset(params.release());
253 259
254 // The URLBlacklistManager has to be created on the UI thread to register 260 // The URLBlacklistManager has to be created on the UI thread to register
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 database_tracker_ = profile_params_->database_tracker; 502 database_tracker_ = profile_params_->database_tracker;
497 appcache_service_ = profile_params_->appcache_service; 503 appcache_service_ = profile_params_->appcache_service;
498 blob_storage_context_ = profile_params_->blob_storage_context; 504 blob_storage_context_ = profile_params_->blob_storage_context;
499 file_system_context_ = profile_params_->file_system_context; 505 file_system_context_ = profile_params_->file_system_context;
500 quota_manager_ = profile_params_->quota_manager; 506 quota_manager_ = profile_params_->quota_manager;
501 host_zoom_map_ = profile_params_->host_zoom_map; 507 host_zoom_map_ = profile_params_->host_zoom_map;
502 host_content_settings_map_ = profile_params_->host_content_settings_map; 508 host_content_settings_map_ = profile_params_->host_content_settings_map;
503 cookie_settings_ = profile_params_->cookie_settings; 509 cookie_settings_ = profile_params_->cookie_settings;
504 notification_service_ = profile_params_->notification_service; 510 notification_service_ = profile_params_->notification_service;
505 extension_info_map_ = profile_params_->extension_info_map; 511 extension_info_map_ = profile_params_->extension_info_map;
512 garbled_text_url_tracker_ = profile_params_->garbled_text_params->
513 CreateTracker(garbled_text_fix_enabled_).Pass();
506 514
507 resource_context_.set_host_resolver(io_thread_globals->host_resolver.get()); 515 resource_context_.set_host_resolver(io_thread_globals->host_resolver.get());
508 resource_context_.set_request_context(main_request_context_); 516 resource_context_.set_request_context(main_request_context_);
509 resource_context_.set_database_tracker(database_tracker_); 517 resource_context_.set_database_tracker(database_tracker_);
510 resource_context_.set_appcache_service(appcache_service_); 518 resource_context_.set_appcache_service(appcache_service_);
511 resource_context_.set_blob_storage_context(blob_storage_context_); 519 resource_context_.set_blob_storage_context(blob_storage_context_);
512 resource_context_.set_file_system_context(file_system_context_); 520 resource_context_.set_file_system_context(file_system_context_);
513 resource_context_.set_quota_manager(quota_manager_); 521 resource_context_.set_quota_manager(quota_manager_);
514 resource_context_.set_host_zoom_map(host_zoom_map_); 522 resource_context_.set_host_zoom_map(host_zoom_map_);
515 resource_context_.SetUserData(NULL, const_cast<ProfileIOData*>(this)); 523 resource_context_.SetUserData(NULL, const_cast<ProfileIOData*>(this));
(...skipping 16 matching lines...) Expand all
532 context->set_accept_charset(profile_params_->accept_charset); 540 context->set_accept_charset(profile_params_->accept_charset);
533 context->set_referrer_charset(profile_params_->referrer_charset); 541 context->set_referrer_charset(profile_params_->referrer_charset);
534 context->set_ssl_config_service(profile_params_->ssl_config_service); 542 context->set_ssl_config_service(profile_params_->ssl_config_service);
535 } 543 }
536 544
537 void ProfileIOData::ShutdownOnUIThread() { 545 void ProfileIOData::ShutdownOnUIThread() {
538 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 546 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
539 enable_referrers_.Destroy(); 547 enable_referrers_.Destroy();
540 clear_local_state_on_exit_.Destroy(); 548 clear_local_state_on_exit_.Destroy();
541 safe_browsing_enabled_.Destroy(); 549 safe_browsing_enabled_.Destroy();
550 garbled_text_fix_enabled_.Destroy();
542 #if defined(ENABLE_CONFIGURATION_POLICY) 551 #if defined(ENABLE_CONFIGURATION_POLICY)
543 if (url_blacklist_manager_.get()) 552 if (url_blacklist_manager_.get())
544 url_blacklist_manager_->ShutdownOnUIThread(); 553 url_blacklist_manager_->ShutdownOnUIThread();
545 #endif 554 #endif
546 BrowserThread::PostTask( 555 BrowserThread::PostTask(
547 BrowserThread::IO, FROM_HERE, 556 BrowserThread::IO, FROM_HERE,
548 base::Bind( 557 base::Bind(
549 &ResourceDispatcherHost::CancelRequestsForContext, 558 &ResourceDispatcherHost::CancelRequestsForContext,
550 base::Unretained(ResourceDispatcherHost::Get()), 559 base::Unretained(ResourceDispatcherHost::Get()),
551 &resource_context_)); 560 &resource_context_));
552 bool posted = BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, this); 561 bool posted = BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, this);
553 if (!posted) 562 if (!posted)
554 delete this; 563 delete this;
555 } 564 }
556 565
557 void ProfileIOData::set_origin_bound_cert_service( 566 void ProfileIOData::set_origin_bound_cert_service(
558 net::OriginBoundCertService* origin_bound_cert_service) const { 567 net::OriginBoundCertService* origin_bound_cert_service) const {
559 origin_bound_cert_service_.reset(origin_bound_cert_service); 568 origin_bound_cert_service_.reset(origin_bound_cert_service);
560 } 569 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_io_data.h ('k') | chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698