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 "components/security_interstitials/core/ssl_error_ui.h" | 5 #include "components/security_interstitials/core/ssl_error_ui.h" |
6 | 6 |
7 #include "base/i18n/time_formatting.h" | 7 #include "base/i18n/time_formatting.h" |
8 #include "components/security_interstitials/core/common_string_util.h" | 8 #include "components/security_interstitials/core/common_string_util.h" |
9 #include "components/security_interstitials/core/metrics_helper.h" | 9 #include "components/security_interstitials/core/metrics_helper.h" |
10 #include "components/ssl_errors/error_classification.h" | 10 #include "components/ssl_errors/error_classification.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 return ((options & mask) != 0); | 22 return ((options & mask) != 0); |
23 } | 23 } |
24 | 24 |
25 } // namespace | 25 } // namespace |
26 | 26 |
27 SSLErrorUI::SSLErrorUI(const GURL& request_url, | 27 SSLErrorUI::SSLErrorUI(const GURL& request_url, |
28 int cert_error, | 28 int cert_error, |
29 const net::SSLInfo& ssl_info, | 29 const net::SSLInfo& ssl_info, |
30 int display_options, | 30 int display_options, |
31 const base::Time& time_triggered, | 31 const base::Time& time_triggered, |
| 32 const network_time::NetworkTimeTracker* network_time, |
32 const std::string& languages, | 33 const std::string& languages, |
33 ControllerClient* controller) | 34 ControllerClient* controller) |
34 : request_url_(request_url), | 35 : request_url_(request_url), |
35 cert_error_(cert_error), | 36 cert_error_(cert_error), |
36 ssl_info_(ssl_info), | 37 ssl_info_(ssl_info), |
37 time_triggered_(time_triggered), | 38 time_triggered_(time_triggered), |
38 languages_(languages), | 39 languages_(languages), |
39 requested_strict_enforcement_( | 40 requested_strict_enforcement_( |
40 IsMasked(display_options, STRICT_ENFORCEMENT)), | 41 IsMasked(display_options, STRICT_ENFORCEMENT)), |
41 soft_override_enabled_(IsMasked(display_options, SOFT_OVERRIDE_ENABLED)), | 42 soft_override_enabled_(IsMasked(display_options, SOFT_OVERRIDE_ENABLED)), |
42 hard_override_enabled_( | 43 hard_override_enabled_( |
43 !IsMasked(display_options, HARD_OVERRIDE_DISABLED)), | 44 !IsMasked(display_options, HARD_OVERRIDE_DISABLED)), |
44 controller_(controller), | 45 controller_(controller), |
45 user_made_decision_(false) { | 46 user_made_decision_(false) { |
46 controller_->metrics_helper()->RecordUserDecision(MetricsHelper::SHOW); | 47 controller_->metrics_helper()->RecordUserDecision(MetricsHelper::SHOW); |
47 controller_->metrics_helper()->RecordUserInteraction( | 48 controller_->metrics_helper()->RecordUserInteraction( |
48 MetricsHelper::TOTAL_VISITS); | 49 MetricsHelper::TOTAL_VISITS); |
49 ssl_errors::RecordUMAStatistics(soft_override_enabled_, time_triggered_, | 50 ssl_errors::RecordUMAStatistics(soft_override_enabled_, time_triggered_, |
50 request_url, cert_error_, | 51 network_time, request_url, cert_error_, |
51 *ssl_info_.cert.get()); | 52 *ssl_info_.cert.get()); |
52 } | 53 } |
53 | 54 |
54 SSLErrorUI::~SSLErrorUI() { | 55 SSLErrorUI::~SSLErrorUI() { |
55 // If the page is closing without an explicit decision, record it as not | 56 // If the page is closing without an explicit decision, record it as not |
56 // proceeding. | 57 // proceeding. |
57 if (!user_made_decision_) { | 58 if (!user_made_decision_) { |
58 controller_->metrics_helper()->RecordUserDecision( | 59 controller_->metrics_helper()->RecordUserDecision( |
59 MetricsHelper::DONT_PROCEED); | 60 MetricsHelper::DONT_PROCEED); |
60 } | 61 } |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 NOTREACHED() << "Unsupported command: " << command; | 194 NOTREACHED() << "Unsupported command: " << command; |
194 case CMD_ERROR: | 195 case CMD_ERROR: |
195 case CMD_TEXT_FOUND: | 196 case CMD_TEXT_FOUND: |
196 case CMD_TEXT_NOT_FOUND: | 197 case CMD_TEXT_NOT_FOUND: |
197 // Commands are for testing. | 198 // Commands are for testing. |
198 break; | 199 break; |
199 } | 200 } |
200 } | 201 } |
201 | 202 |
202 } // security_interstitials | 203 } // security_interstitials |
OLD | NEW |