OLD | NEW |
---|---|
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 // Implementation of the SafeBrowsingBlockingPage class. | 5 // Implementation of the SafeBrowsingBlockingPage class. |
6 | 6 |
7 #include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h" | 7 #include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h" |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
165 interstitial_reason_ = SB_REASON_HARMFUL; | 165 interstitial_reason_ = SB_REASON_HARMFUL; |
166 else | 166 else |
167 interstitial_reason_ = SB_REASON_PHISHING; | 167 interstitial_reason_ = SB_REASON_PHISHING; |
168 | 168 |
169 // This must be done after calculating |interstitial_reason_| above. | 169 // This must be done after calculating |interstitial_reason_| above. |
170 security_interstitials::MetricsHelper::ReportDetails reporting_info; | 170 security_interstitials::MetricsHelper::ReportDetails reporting_info; |
171 reporting_info.metric_prefix = GetMetricPrefix(); | 171 reporting_info.metric_prefix = GetMetricPrefix(); |
172 reporting_info.extra_suffix = GetExtraMetricsSuffix(); | 172 reporting_info.extra_suffix = GetExtraMetricsSuffix(); |
173 reporting_info.rappor_prefix = GetRapporPrefix(); | 173 reporting_info.rappor_prefix = GetRapporPrefix(); |
174 reporting_info.rappor_report_type = rappor::SAFEBROWSING_RAPPOR_TYPE; | 174 reporting_info.rappor_report_type = rappor::SAFEBROWSING_RAPPOR_TYPE; |
175 set_metrics_helper(new ChromeMetricsHelper( | 175 set_metrics_helper( |
176 web_contents, request_url(), reporting_info, GetSamplingEventName())); | 176 scoped_ptr<ChromeMetricsHelper>( |
estark
2015/09/25 23:53:34
optional nit: you can also use make_scoped_ptr() t
felt
2015/09/27 20:08:15
Done.
| |
177 new ChromeMetricsHelper(web_contents, request_url(), reporting_info, | |
178 GetSamplingEventName())) | |
179 .Pass()); | |
177 metrics_helper()->RecordUserDecision( | 180 metrics_helper()->RecordUserDecision( |
178 security_interstitials::MetricsHelper::SHOW); | 181 security_interstitials::MetricsHelper::SHOW); |
179 metrics_helper()->RecordUserInteraction( | 182 metrics_helper()->RecordUserInteraction( |
180 security_interstitials::MetricsHelper::TOTAL_VISITS); | 183 security_interstitials::MetricsHelper::TOTAL_VISITS); |
181 if (IsPrefEnabled(prefs::kSafeBrowsingProceedAnywayDisabled)) { | 184 if (IsPrefEnabled(prefs::kSafeBrowsingProceedAnywayDisabled)) { |
182 metrics_helper()->RecordUserDecision( | 185 metrics_helper()->RecordUserDecision( |
183 security_interstitials::MetricsHelper::PROCEEDING_DISABLED); | 186 security_interstitials::MetricsHelper::PROCEEDING_DISABLED); |
184 } | 187 } |
185 | 188 |
186 if (!is_main_frame_load_blocked_) { | 189 if (!is_main_frame_load_blocked_) { |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
707 "finalParagraph", l10n_util::GetStringUTF16( | 710 "finalParagraph", l10n_util::GetStringUTF16( |
708 IDS_PHISHING_V4_PROCEED_AND_REPORT_PARAGRAPH)); | 711 IDS_PHISHING_V4_PROCEED_AND_REPORT_PARAGRAPH)); |
709 } else { | 712 } else { |
710 load_time_data->SetString( | 713 load_time_data->SetString( |
711 "finalParagraph", | 714 "finalParagraph", |
712 l10n_util::GetStringUTF16(IDS_PHISHING_V3_PROCEED_PARAGRAPH)); | 715 l10n_util::GetStringUTF16(IDS_PHISHING_V3_PROCEED_PARAGRAPH)); |
713 } | 716 } |
714 | 717 |
715 PopulateExtendedReportingOption(load_time_data); | 718 PopulateExtendedReportingOption(load_time_data); |
716 } | 719 } |
OLD | NEW |