| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/ssl/cert_report_helper.h" | 5 #include "chrome/browser/ssl/cert_report_helper.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 bool overridable, | 53 bool overridable, |
| 54 const base::Time& interstitial_time, | 54 const base::Time& interstitial_time, |
| 55 security_interstitials::MetricsHelper* metrics_helper) | 55 security_interstitials::MetricsHelper* metrics_helper) |
| 56 : ssl_cert_reporter_(std::move(ssl_cert_reporter)), | 56 : ssl_cert_reporter_(std::move(ssl_cert_reporter)), |
| 57 web_contents_(web_contents), | 57 web_contents_(web_contents), |
| 58 request_url_(request_url), | 58 request_url_(request_url), |
| 59 ssl_info_(ssl_info), | 59 ssl_info_(ssl_info), |
| 60 interstitial_reason_(interstitial_reason), | 60 interstitial_reason_(interstitial_reason), |
| 61 overridable_(overridable), | 61 overridable_(overridable), |
| 62 interstitial_time_(interstitial_time), | 62 interstitial_time_(interstitial_time), |
| 63 metrics_helper_(metrics_helper) {} | 63 metrics_helper_(metrics_helper) { |
| 64 DCHECK(ssl_cert_reporter); |
| 65 } |
| 64 | 66 |
| 65 CertReportHelper::~CertReportHelper() { | 67 CertReportHelper::~CertReportHelper() { |
| 66 } | 68 } |
| 67 | 69 |
| 68 void CertReportHelper::PopulateExtendedReportingOption( | 70 void CertReportHelper::PopulateExtendedReportingOption( |
| 69 base::DictionaryValue* load_time_data) { | 71 base::DictionaryValue* load_time_data) { |
| 70 // Only show the checkbox if not off-the-record and if this client is | 72 // Only show the checkbox if not off-the-record and if this client is |
| 71 // part of the respective Finch group, and the feature is not disabled | 73 // part of the respective Finch group, and the feature is not disabled |
| 72 // by policy. | 74 // by policy. |
| 73 const bool show = ShouldShowCertificateReporterCheckbox(); | 75 const bool show = ShouldShowCertificateReporterCheckbox(); |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 if (sendingThreshold >= 0.0 && sendingThreshold <= 1.0) | 162 if (sendingThreshold >= 0.0 && sendingThreshold <= 1.0) |
| 161 return base::RandDouble() <= sendingThreshold; | 163 return base::RandDouble() <= sendingThreshold; |
| 162 } | 164 } |
| 163 } | 165 } |
| 164 return false; | 166 return false; |
| 165 } | 167 } |
| 166 | 168 |
| 167 bool CertReportHelper::IsPrefEnabled(const char* pref) { | 169 bool CertReportHelper::IsPrefEnabled(const char* pref) { |
| 168 return GetProfile(web_contents_)->GetPrefs()->GetBoolean(pref); | 170 return GetProfile(web_contents_)->GetPrefs()->GetBoolean(pref); |
| 169 } | 171 } |
| OLD | NEW |