| 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/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 | 129 |
| 130 void SafeBrowsingPingManager::SetCertificateErrorReporterForTesting( | 130 void SafeBrowsingPingManager::SetCertificateErrorReporterForTesting( |
| 131 std::unique_ptr<certificate_reporting::ErrorReporter> | 131 std::unique_ptr<certificate_reporting::ErrorReporter> |
| 132 certificate_error_reporter) { | 132 certificate_error_reporter) { |
| 133 certificate_error_reporter_ = std::move(certificate_error_reporter); | 133 certificate_error_reporter_ = std::move(certificate_error_reporter); |
| 134 } | 134 } |
| 135 | 135 |
| 136 void SafeBrowsingPingManager::ReportPermissionAction( | 136 void SafeBrowsingPingManager::ReportPermissionAction( |
| 137 const GURL& origin, | 137 const GURL& origin, |
| 138 content::PermissionType permission, | 138 content::PermissionType permission, |
| 139 PermissionAction action) { | 139 PermissionAction action, |
| 140 permission_reporter_->SendReport(origin, permission, action); | 140 SourceUI source_ui) { |
| 141 permission_reporter_->SendReport(origin, permission, action, source_ui); |
| 141 } | 142 } |
| 142 | 143 |
| 143 GURL SafeBrowsingPingManager::SafeBrowsingHitUrl( | 144 GURL SafeBrowsingPingManager::SafeBrowsingHitUrl( |
| 144 const safe_browsing::HitReport& hit_report) const { | 145 const safe_browsing::HitReport& hit_report) const { |
| 145 DCHECK(hit_report.threat_type == SB_THREAT_TYPE_URL_MALWARE || | 146 DCHECK(hit_report.threat_type == SB_THREAT_TYPE_URL_MALWARE || |
| 146 hit_report.threat_type == SB_THREAT_TYPE_URL_PHISHING || | 147 hit_report.threat_type == SB_THREAT_TYPE_URL_PHISHING || |
| 147 hit_report.threat_type == SB_THREAT_TYPE_URL_UNWANTED || | 148 hit_report.threat_type == SB_THREAT_TYPE_URL_UNWANTED || |
| 148 hit_report.threat_type == SB_THREAT_TYPE_BINARY_MALWARE_URL || | 149 hit_report.threat_type == SB_THREAT_TYPE_BINARY_MALWARE_URL || |
| 149 hit_report.threat_type == SB_THREAT_TYPE_CLIENT_SIDE_PHISHING_URL || | 150 hit_report.threat_type == SB_THREAT_TYPE_CLIENT_SIDE_PHISHING_URL || |
| 150 hit_report.threat_type == SB_THREAT_TYPE_CLIENT_SIDE_MALWARE_URL); | 151 hit_report.threat_type == SB_THREAT_TYPE_CLIENT_SIDE_MALWARE_URL); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 version_.c_str()); | 231 version_.c_str()); |
| 231 std::string api_key = google_apis::GetAPIKey(); | 232 std::string api_key = google_apis::GetAPIKey(); |
| 232 if (!api_key.empty()) { | 233 if (!api_key.empty()) { |
| 233 base::StringAppendF(&url, "&key=%s", | 234 base::StringAppendF(&url, "&key=%s", |
| 234 net::EscapeQueryParamValue(api_key, true).c_str()); | 235 net::EscapeQueryParamValue(api_key, true).c_str()); |
| 235 } | 236 } |
| 236 return GURL(url); | 237 return GURL(url); |
| 237 } | 238 } |
| 238 | 239 |
| 239 } // namespace safe_browsing | 240 } // namespace safe_browsing |
| OLD | NEW |