| 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 #include "chrome/browser/safe_browsing/ping_manager.h" | 5 #include "chrome/browser/safe_browsing/ping_manager.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 certificate_error_reporter_->SendExtendedReportingReport(serialized_report); | 129 certificate_error_reporter_->SendExtendedReportingReport(serialized_report); |
| 130 } | 130 } |
| 131 | 131 |
| 132 void SafeBrowsingPingManager::SetCertificateErrorReporterForTesting( | 132 void SafeBrowsingPingManager::SetCertificateErrorReporterForTesting( |
| 133 std::unique_ptr<certificate_reporting::ErrorReporter> | 133 std::unique_ptr<certificate_reporting::ErrorReporter> |
| 134 certificate_error_reporter) { | 134 certificate_error_reporter) { |
| 135 certificate_error_reporter_ = std::move(certificate_error_reporter); | 135 certificate_error_reporter_ = std::move(certificate_error_reporter); |
| 136 } | 136 } |
| 137 | 137 |
| 138 void SafeBrowsingPingManager::ReportPermissionAction( | 138 void SafeBrowsingPingManager::ReportPermissionAction( |
| 139 const GURL& origin, | 139 const PermissionReportInfo& report_info) { |
| 140 content::PermissionType permission, | 140 permission_reporter_->SendReport(report_info); |
| 141 PermissionAction action, | |
| 142 PermissionSourceUI source_ui, | |
| 143 PermissionRequestGestureType gesture_type, | |
| 144 int num_prior_dismissals, | |
| 145 int num_prior_ignores) { | |
| 146 permission_reporter_->SendReport(origin, permission, action, source_ui, | |
| 147 gesture_type, num_prior_dismissals, num_prior_ignores); | |
| 148 } | 141 } |
| 149 | 142 |
| 150 GURL SafeBrowsingPingManager::SafeBrowsingHitUrl( | 143 GURL SafeBrowsingPingManager::SafeBrowsingHitUrl( |
| 151 const safe_browsing::HitReport& hit_report) const { | 144 const safe_browsing::HitReport& hit_report) const { |
| 152 DCHECK(hit_report.threat_type == SB_THREAT_TYPE_URL_MALWARE || | 145 DCHECK(hit_report.threat_type == SB_THREAT_TYPE_URL_MALWARE || |
| 153 hit_report.threat_type == SB_THREAT_TYPE_URL_PHISHING || | 146 hit_report.threat_type == SB_THREAT_TYPE_URL_PHISHING || |
| 154 hit_report.threat_type == SB_THREAT_TYPE_URL_UNWANTED || | 147 hit_report.threat_type == SB_THREAT_TYPE_URL_UNWANTED || |
| 155 hit_report.threat_type == SB_THREAT_TYPE_BINARY_MALWARE_URL || | 148 hit_report.threat_type == SB_THREAT_TYPE_BINARY_MALWARE_URL || |
| 156 hit_report.threat_type == SB_THREAT_TYPE_CLIENT_SIDE_PHISHING_URL || | 149 hit_report.threat_type == SB_THREAT_TYPE_CLIENT_SIDE_PHISHING_URL || |
| 157 hit_report.threat_type == SB_THREAT_TYPE_CLIENT_SIDE_MALWARE_URL); | 150 hit_report.threat_type == SB_THREAT_TYPE_CLIENT_SIDE_MALWARE_URL); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 version_.c_str()); | 230 version_.c_str()); |
| 238 std::string api_key = google_apis::GetAPIKey(); | 231 std::string api_key = google_apis::GetAPIKey(); |
| 239 if (!api_key.empty()) { | 232 if (!api_key.empty()) { |
| 240 base::StringAppendF(&url, "&key=%s", | 233 base::StringAppendF(&url, "&key=%s", |
| 241 net::EscapeQueryParamValue(api_key, true).c_str()); | 234 net::EscapeQueryParamValue(api_key, true).c_str()); |
| 242 } | 235 } |
| 243 return GURL(url); | 236 return GURL(url); |
| 244 } | 237 } |
| 245 | 238 |
| 246 } // namespace safe_browsing | 239 } // namespace safe_browsing |
| OLD | NEW |