| 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 else if (harmful) | 172 else if (harmful) |
| 173 interstitial_reason_ = SB_REASON_HARMFUL; | 173 interstitial_reason_ = SB_REASON_HARMFUL; |
| 174 else | 174 else |
| 175 interstitial_reason_ = SB_REASON_PHISHING; | 175 interstitial_reason_ = SB_REASON_PHISHING; |
| 176 | 176 |
| 177 // This must be done after calculating |interstitial_reason_| above. | 177 // This must be done after calculating |interstitial_reason_| above. |
| 178 security_interstitials::MetricsHelper::ReportDetails reporting_info; | 178 security_interstitials::MetricsHelper::ReportDetails reporting_info; |
| 179 reporting_info.metric_prefix = GetMetricPrefix(); | 179 reporting_info.metric_prefix = GetMetricPrefix(); |
| 180 reporting_info.extra_suffix = GetExtraMetricsSuffix(); | 180 reporting_info.extra_suffix = GetExtraMetricsSuffix(); |
| 181 reporting_info.rappor_prefix = GetRapporPrefix(); | 181 reporting_info.rappor_prefix = GetRapporPrefix(); |
| 182 reporting_info.rappor_report_type = rappor::SAFEBROWSING_RAPPOR_TYPE; | 182 reporting_info.deprecated_rappor_prefix = GetDeprecatedRapporPrefix(); |
| 183 reporting_info.rappor_report_type = |
| 184 rappor::LOW_FREQUENCY_SAFEBROWSING_RAPPOR_TYPE; |
| 185 reporting_info.deprecated_rappor_report_type = |
| 186 rappor::SAFEBROWSING_RAPPOR_TYPE; |
| 183 set_metrics_helper(base::WrapUnique(new ChromeMetricsHelper( | 187 set_metrics_helper(base::WrapUnique(new ChromeMetricsHelper( |
| 184 web_contents, request_url(), reporting_info, GetSamplingEventName()))); | 188 web_contents, request_url(), reporting_info, GetSamplingEventName()))); |
| 185 metrics_helper()->RecordUserDecision( | 189 metrics_helper()->RecordUserDecision( |
| 186 security_interstitials::MetricsHelper::SHOW); | 190 security_interstitials::MetricsHelper::SHOW); |
| 187 metrics_helper()->RecordUserInteraction( | 191 metrics_helper()->RecordUserInteraction( |
| 188 security_interstitials::MetricsHelper::TOTAL_VISITS); | 192 security_interstitials::MetricsHelper::TOTAL_VISITS); |
| 189 if (IsPrefEnabled(prefs::kSafeBrowsingProceedAnywayDisabled)) { | 193 if (IsPrefEnabled(prefs::kSafeBrowsingProceedAnywayDisabled)) { |
| 190 metrics_helper()->RecordUserDecision( | 194 metrics_helper()->RecordUserDecision( |
| 191 security_interstitials::MetricsHelper::PROCEEDING_DISABLED); | 195 security_interstitials::MetricsHelper::PROCEEDING_DISABLED); |
| 192 } | 196 } |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 561 case safe_browsing::ThreatSource::UNKNOWN: | 565 case safe_browsing::ThreatSource::UNKNOWN: |
| 562 break; | 566 break; |
| 563 } | 567 } |
| 564 NOTREACHED(); | 568 NOTREACHED(); |
| 565 return std::string(); | 569 return std::string(); |
| 566 } | 570 } |
| 567 | 571 |
| 568 std::string SafeBrowsingBlockingPage::GetRapporPrefix() const { | 572 std::string SafeBrowsingBlockingPage::GetRapporPrefix() const { |
| 569 switch (interstitial_reason_) { | 573 switch (interstitial_reason_) { |
| 570 case SB_REASON_MALWARE: | 574 case SB_REASON_MALWARE: |
| 575 return "malware2"; |
| 576 case SB_REASON_HARMFUL: |
| 577 return "harmful2"; |
| 578 case SB_REASON_PHISHING: |
| 579 return "phishing2"; |
| 580 } |
| 581 NOTREACHED(); |
| 582 return std::string(); |
| 583 } |
| 584 |
| 585 std::string SafeBrowsingBlockingPage::GetDeprecatedRapporPrefix() const { |
| 586 switch (interstitial_reason_) { |
| 587 case SB_REASON_MALWARE: |
| 571 return "malware"; | 588 return "malware"; |
| 572 case SB_REASON_HARMFUL: | 589 case SB_REASON_HARMFUL: |
| 573 return "harmful"; | 590 return "harmful"; |
| 574 case SB_REASON_PHISHING: | 591 case SB_REASON_PHISHING: |
| 575 return "phishing"; | 592 return "phishing"; |
| 576 } | 593 } |
| 577 NOTREACHED(); | 594 NOTREACHED(); |
| 578 return std::string(); | 595 return std::string(); |
| 579 } | 596 } |
| 580 | 597 |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 724 } else { | 741 } else { |
| 725 load_time_data->SetString( | 742 load_time_data->SetString( |
| 726 "finalParagraph", | 743 "finalParagraph", |
| 727 l10n_util::GetStringUTF16(IDS_PHISHING_V3_PROCEED_PARAGRAPH)); | 744 l10n_util::GetStringUTF16(IDS_PHISHING_V3_PROCEED_PARAGRAPH)); |
| 728 } | 745 } |
| 729 | 746 |
| 730 PopulateExtendedReportingOption(load_time_data); | 747 PopulateExtendedReportingOption(load_time_data); |
| 731 } | 748 } |
| 732 | 749 |
| 733 } // namespace safe_browsing | 750 } // namespace safe_browsing |
| OLD | NEW |