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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 | 141 |
142 void SafeBrowsingPingManager::SetCertificateErrorReporterForTesting( | 142 void SafeBrowsingPingManager::SetCertificateErrorReporterForTesting( |
143 std::unique_ptr<certificate_reporting::ErrorReporter> | 143 std::unique_ptr<certificate_reporting::ErrorReporter> |
144 certificate_error_reporter) { | 144 certificate_error_reporter) { |
145 certificate_error_reporter_ = std::move(certificate_error_reporter); | 145 certificate_error_reporter_ = std::move(certificate_error_reporter); |
146 } | 146 } |
147 | 147 |
148 void SafeBrowsingPingManager::ReportPermissionAction( | 148 void SafeBrowsingPingManager::ReportPermissionAction( |
149 const GURL& origin, | 149 const GURL& origin, |
150 content::PermissionType permission, | 150 content::PermissionType permission, |
151 PermissionAction action) { | 151 PermissionAction action, |
152 permission_reporter_->SendReport(origin, permission, action); | 152 SourceUI source_ui) { |
| 153 permission_reporter_->SendReport(origin, permission, action, source_ui); |
153 } | 154 } |
154 | 155 |
155 GURL SafeBrowsingPingManager::SafeBrowsingHitUrl( | 156 GURL SafeBrowsingPingManager::SafeBrowsingHitUrl( |
156 const safe_browsing::HitReport& hit_report) const { | 157 const safe_browsing::HitReport& hit_report) const { |
157 DCHECK(hit_report.threat_type == SB_THREAT_TYPE_URL_MALWARE || | 158 DCHECK(hit_report.threat_type == SB_THREAT_TYPE_URL_MALWARE || |
158 hit_report.threat_type == SB_THREAT_TYPE_URL_PHISHING || | 159 hit_report.threat_type == SB_THREAT_TYPE_URL_PHISHING || |
159 hit_report.threat_type == SB_THREAT_TYPE_URL_UNWANTED || | 160 hit_report.threat_type == SB_THREAT_TYPE_URL_UNWANTED || |
160 hit_report.threat_type == SB_THREAT_TYPE_BINARY_MALWARE_URL || | 161 hit_report.threat_type == SB_THREAT_TYPE_BINARY_MALWARE_URL || |
161 hit_report.threat_type == SB_THREAT_TYPE_CLIENT_SIDE_PHISHING_URL || | 162 hit_report.threat_type == SB_THREAT_TYPE_CLIENT_SIDE_PHISHING_URL || |
162 hit_report.threat_type == SB_THREAT_TYPE_CLIENT_SIDE_MALWARE_URL); | 163 hit_report.threat_type == SB_THREAT_TYPE_CLIENT_SIDE_MALWARE_URL); |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 version_.c_str()); | 243 version_.c_str()); |
243 std::string api_key = google_apis::GetAPIKey(); | 244 std::string api_key = google_apis::GetAPIKey(); |
244 if (!api_key.empty()) { | 245 if (!api_key.empty()) { |
245 base::StringAppendF(&url, "&key=%s", | 246 base::StringAppendF(&url, "&key=%s", |
246 net::EscapeQueryParamValue(api_key, true).c_str()); | 247 net::EscapeQueryParamValue(api_key, true).c_str()); |
247 } | 248 } |
248 return GURL(url); | 249 return GURL(url); |
249 } | 250 } |
250 | 251 |
251 } // namespace safe_browsing | 252 } // namespace safe_browsing |
OLD | NEW |