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

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

Issue 935663004: Add checkbox for reporting invalid TLS/SSL cert chains (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix comment typo Created 5 years, 9 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"
(...skipping 17 matching lines...) Expand all
28 #include "chrome/browser/content_settings/cookie_settings.h" 28 #include "chrome/browser/content_settings/cookie_settings.h"
29 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" 29 #include "chrome/browser/custom_handlers/protocol_handler_registry.h"
30 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" 30 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h"
31 #include "chrome/browser/devtools/devtools_network_controller.h" 31 #include "chrome/browser/devtools/devtools_network_controller.h"
32 #include "chrome/browser/devtools/devtools_network_transaction_factory.h" 32 #include "chrome/browser/devtools/devtools_network_transaction_factory.h"
33 #include "chrome/browser/download/download_service.h" 33 #include "chrome/browser/download/download_service.h"
34 #include "chrome/browser/download/download_service_factory.h" 34 #include "chrome/browser/download/download_service_factory.h"
35 #include "chrome/browser/io_thread.h" 35 #include "chrome/browser/io_thread.h"
36 #include "chrome/browser/media/media_device_id_salt.h" 36 #include "chrome/browser/media/media_device_id_salt.h"
37 #include "chrome/browser/net/about_protocol_handler.h" 37 #include "chrome/browser/net/about_protocol_handler.h"
38 #include "chrome/browser/net/certificate_error_reporter.h"
38 #include "chrome/browser/net/chrome_fraudulent_certificate_reporter.h" 39 #include "chrome/browser/net/chrome_fraudulent_certificate_reporter.h"
39 #include "chrome/browser/net/chrome_http_user_agent_settings.h" 40 #include "chrome/browser/net/chrome_http_user_agent_settings.h"
40 #include "chrome/browser/net/chrome_net_log.h" 41 #include "chrome/browser/net/chrome_net_log.h"
41 #include "chrome/browser/net/chrome_network_delegate.h" 42 #include "chrome/browser/net/chrome_network_delegate.h"
42 #include "chrome/browser/net/chrome_url_request_context_getter.h" 43 #include "chrome/browser/net/chrome_url_request_context_getter.h"
43 #include "chrome/browser/net/cookie_store_util.h" 44 #include "chrome/browser/net/cookie_store_util.h"
44 #include "chrome/browser/net/proxy_service_factory.h" 45 #include "chrome/browser/net/proxy_service_factory.h"
45 #include "chrome/browser/net/resource_prefetch_predictor_observer.h" 46 #include "chrome/browser/net/resource_prefetch_predictor_observer.h"
46 #include "chrome/browser/predictors/resource_prefetch_predictor.h" 47 #include "chrome/browser/predictors/resource_prefetch_predictor.h"
47 #include "chrome/browser/predictors/resource_prefetch_predictor_factory.h" 48 #include "chrome/browser/predictors/resource_prefetch_predictor_factory.h"
(...skipping 29 matching lines...) Expand all
77 #include "net/ssl/client_cert_store.h" 78 #include "net/ssl/client_cert_store.h"
78 #include "net/url_request/data_protocol_handler.h" 79 #include "net/url_request/data_protocol_handler.h"
79 #include "net/url_request/file_protocol_handler.h" 80 #include "net/url_request/file_protocol_handler.h"
80 #include "net/url_request/ftp_protocol_handler.h" 81 #include "net/url_request/ftp_protocol_handler.h"
81 #include "net/url_request/url_request.h" 82 #include "net/url_request/url_request.h"
82 #include "net/url_request/url_request_context.h" 83 #include "net/url_request/url_request_context.h"
83 #include "net/url_request/url_request_file_job.h" 84 #include "net/url_request/url_request_file_job.h"
84 #include "net/url_request/url_request_intercepting_job_factory.h" 85 #include "net/url_request/url_request_intercepting_job_factory.h"
85 #include "net/url_request/url_request_interceptor.h" 86 #include "net/url_request/url_request_interceptor.h"
86 #include "net/url_request/url_request_job_factory_impl.h" 87 #include "net/url_request/url_request_job_factory_impl.h"
88 #include "url/gurl.h"
87 89
88 #if defined(ENABLE_CONFIGURATION_POLICY) 90 #if defined(ENABLE_CONFIGURATION_POLICY)
89 #include "chrome/browser/policy/cloud/policy_header_service_factory.h" 91 #include "chrome/browser/policy/cloud/policy_header_service_factory.h"
90 #include "chrome/browser/policy/policy_helpers.h" 92 #include "chrome/browser/policy/policy_helpers.h"
91 #include "components/policy/core/browser/url_blacklist_manager.h" 93 #include "components/policy/core/browser/url_blacklist_manager.h"
92 #include "components/policy/core/common/cloud/policy_header_io_helper.h" 94 #include "components/policy/core/common/cloud/policy_header_io_helper.h"
93 #include "components/policy/core/common/cloud/policy_header_service.h" 95 #include "components/policy/core/common/cloud/policy_header_service.h"
94 #include "components/policy/core/common/cloud/user_cloud_policy_manager.h" 96 #include "components/policy/core/common/cloud/user_cloud_policy_manager.h"
95 #endif 97 #endif
96 98
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 #endif 144 #endif
143 145
144 #if defined(OS_WIN) 146 #if defined(OS_WIN)
145 #include "net/ssl/client_cert_store_win.h" 147 #include "net/ssl/client_cert_store_win.h"
146 #endif 148 #endif
147 149
148 #if defined(OS_MACOSX) 150 #if defined(OS_MACOSX)
149 #include "net/ssl/client_cert_store_mac.h" 151 #include "net/ssl/client_cert_store_mac.h"
150 #endif 152 #endif
151 153
154 using chrome_browser_net::CertificateErrorReporter;
152 using content::BrowserContext; 155 using content::BrowserContext;
153 using content::BrowserThread; 156 using content::BrowserThread;
154 using content::ResourceContext; 157 using content::ResourceContext;
155 158
156 namespace { 159 namespace {
157 160
158 #if defined(DEBUG_DEVTOOLS) 161 #if defined(DEBUG_DEVTOOLS)
159 bool IsSupportedDevToolsURL(const GURL& url, base::FilePath* path) { 162 bool IsSupportedDevToolsURL(const GURL& url, base::FilePath* path) {
160 std::string bundled_path_prefix(chrome::kChromeUIDevToolsBundledPath); 163 std::string bundled_path_prefix(chrome::kChromeUIDevToolsBundledPath);
161 bundled_path_prefix = "/" + bundled_path_prefix + "/"; 164 bundled_path_prefix = "/" + bundled_path_prefix + "/";
(...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after
878 881
879 bool ProfileIOData::GetMetricsEnabledStateOnIOThread() const { 882 bool ProfileIOData::GetMetricsEnabledStateOnIOThread() const {
880 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 883 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
881 #if defined(OS_CHROMEOS) 884 #if defined(OS_CHROMEOS)
882 return enable_metrics_; 885 return enable_metrics_;
883 #else 886 #else
884 return enable_metrics_.GetValue(); 887 return enable_metrics_.GetValue();
885 #endif // defined(OS_CHROMEOS) 888 #endif // defined(OS_CHROMEOS)
886 } 889 }
887 890
891 void ProfileIOData::set_certificate_error_reporter_for_testing(
892 chrome_browser_net::CertificateErrorReporter* certificate_error_reporter) {
893 certificate_error_reporter_.reset(certificate_error_reporter);
894 }
895
888 bool ProfileIOData::IsDataReductionProxyEnabled() const { 896 bool ProfileIOData::IsDataReductionProxyEnabled() const {
889 return data_reduction_proxy_io_data()->IsEnabled(); 897 return data_reduction_proxy_io_data()->IsEnabled();
890 } 898 }
891 899
900 base::WeakPtr<CertificateErrorReporter>
901 ProfileIOData::certificate_error_reporter() const {
902 return certificate_error_reporter_->GetWeakPtr();
903 }
904
892 void ProfileIOData::set_data_reduction_proxy_io_data( 905 void ProfileIOData::set_data_reduction_proxy_io_data(
893 scoped_ptr<data_reduction_proxy::DataReductionProxyIOData> 906 scoped_ptr<data_reduction_proxy::DataReductionProxyIOData>
894 data_reduction_proxy_io_data) const { 907 data_reduction_proxy_io_data) const {
895 data_reduction_proxy_io_data_ = data_reduction_proxy_io_data.Pass(); 908 data_reduction_proxy_io_data_ = data_reduction_proxy_io_data.Pass();
896 } 909 }
897 910
898 base::WeakPtr<net::HttpServerProperties> 911 base::WeakPtr<net::HttpServerProperties>
899 ProfileIOData::http_server_properties() const { 912 ProfileIOData::http_server_properties() const {
900 return http_server_properties_->GetWeakPtr(); 913 return http_server_properties_->GetWeakPtr();
901 } 914 }
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
1053 network_delegate->set_profile(profile_params_->profile); 1066 network_delegate->set_profile(profile_params_->profile);
1054 network_delegate->set_profile_path(profile_params_->path); 1067 network_delegate->set_profile_path(profile_params_->path);
1055 network_delegate->set_cookie_settings(profile_params_->cookie_settings.get()); 1068 network_delegate->set_cookie_settings(profile_params_->cookie_settings.get());
1056 network_delegate->set_enable_do_not_track(&enable_do_not_track_); 1069 network_delegate->set_enable_do_not_track(&enable_do_not_track_);
1057 network_delegate->set_force_safe_search(&force_safesearch_); 1070 network_delegate->set_force_safe_search(&force_safesearch_);
1058 network_delegate->set_force_google_safe_search(&force_google_safesearch_); 1071 network_delegate->set_force_google_safe_search(&force_google_safesearch_);
1059 network_delegate->set_force_youtube_safety_mode(&force_youtube_safety_mode_); 1072 network_delegate->set_force_youtube_safety_mode(&force_youtube_safety_mode_);
1060 fraudulent_certificate_reporter_.reset( 1073 fraudulent_certificate_reporter_.reset(
1061 new chrome_browser_net::ChromeFraudulentCertificateReporter( 1074 new chrome_browser_net::ChromeFraudulentCertificateReporter(
1062 main_request_context_.get())); 1075 main_request_context_.get()));
1076 certificate_error_reporter_.reset(new CertificateErrorReporter(
1077 main_request_context_.get(),
mattm 2015/03/17 20:58:12 If these are going to be handled by safebrowsing s
estark 2015/03/17 21:26:15 Could SafeBrowsingPingManager be the thing that ow
mattm 2015/03/17 23:57:51 I suppose, yeah. Oh, I forgot to mention, with us
estark 2015/03/18 15:57:18 Done.
mattm 2015/03/23 05:31:17 Just need to remove the LOAD_DO_NOT_SEND_COOKIES a
felt 2015/03/23 14:04:32 Hold up real quick -- what are the implications of
estark 2015/03/23 20:55:28 Done. I think I should add unit tests that Certif
1078 GURL(chrome_browser_net::kExtendedReportingUploadUrl)));
1063 1079
1064 // TODO(vadimt): Remove ScopedTracker below once crbug.com/436671 is fixed. 1080 // TODO(vadimt): Remove ScopedTracker below once crbug.com/436671 is fixed.
1065 tracked_objects::ScopedTracker tracking_profile3( 1081 tracked_objects::ScopedTracker tracking_profile3(
1066 FROM_HERE_WITH_EXPLICIT_FUNCTION("436671 ProfileIOData::Init3")); 1082 FROM_HERE_WITH_EXPLICIT_FUNCTION("436671 ProfileIOData::Init3"));
1067 1083
1068 // NOTE: Proxy service uses the default io thread network delegate, not the 1084 // NOTE: Proxy service uses the default io thread network delegate, not the
1069 // delegate just created. 1085 // delegate just created.
1070 proxy_service_.reset( 1086 proxy_service_.reset(
1071 ProxyServiceFactory::CreateProxyService( 1087 ProxyServiceFactory::CreateProxyService(
1072 io_thread->net_log(), 1088 io_thread->net_log(),
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
1342 void ProfileIOData::SetCookieSettingsForTesting( 1358 void ProfileIOData::SetCookieSettingsForTesting(
1343 CookieSettings* cookie_settings) { 1359 CookieSettings* cookie_settings) {
1344 DCHECK(!cookie_settings_.get()); 1360 DCHECK(!cookie_settings_.get());
1345 cookie_settings_ = cookie_settings; 1361 cookie_settings_ = cookie_settings;
1346 } 1362 }
1347 1363
1348 void ProfileIOData::set_signin_names_for_testing( 1364 void ProfileIOData::set_signin_names_for_testing(
1349 SigninNamesOnIOThread* signin_names) { 1365 SigninNamesOnIOThread* signin_names) {
1350 signin_names_.reset(signin_names); 1366 signin_names_.reset(signin_names);
1351 } 1367 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698