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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 GURL& origin, |
140 content::PermissionType permission, | 140 content::PermissionType permission, |
141 PermissionAction action, | 141 PermissionAction action, |
142 PermissionSourceUI source_ui) { | 142 PermissionSourceUI source_ui, |
143 permission_reporter_->SendReport(origin, permission, action, source_ui); | 143 bool user_gesture) { |
| 144 permission_reporter_->SendReport(origin, permission, action, source_ui, |
| 145 user_gesture); |
144 } | 146 } |
145 | 147 |
146 GURL SafeBrowsingPingManager::SafeBrowsingHitUrl( | 148 GURL SafeBrowsingPingManager::SafeBrowsingHitUrl( |
147 const safe_browsing::HitReport& hit_report) const { | 149 const safe_browsing::HitReport& hit_report) const { |
148 DCHECK(hit_report.threat_type == SB_THREAT_TYPE_URL_MALWARE || | 150 DCHECK(hit_report.threat_type == SB_THREAT_TYPE_URL_MALWARE || |
149 hit_report.threat_type == SB_THREAT_TYPE_URL_PHISHING || | 151 hit_report.threat_type == SB_THREAT_TYPE_URL_PHISHING || |
150 hit_report.threat_type == SB_THREAT_TYPE_URL_UNWANTED || | 152 hit_report.threat_type == SB_THREAT_TYPE_URL_UNWANTED || |
151 hit_report.threat_type == SB_THREAT_TYPE_BINARY_MALWARE_URL || | 153 hit_report.threat_type == SB_THREAT_TYPE_BINARY_MALWARE_URL || |
152 hit_report.threat_type == SB_THREAT_TYPE_CLIENT_SIDE_PHISHING_URL || | 154 hit_report.threat_type == SB_THREAT_TYPE_CLIENT_SIDE_PHISHING_URL || |
153 hit_report.threat_type == SB_THREAT_TYPE_CLIENT_SIDE_MALWARE_URL); | 155 hit_report.threat_type == SB_THREAT_TYPE_CLIENT_SIDE_MALWARE_URL); |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 version_.c_str()); | 235 version_.c_str()); |
234 std::string api_key = google_apis::GetAPIKey(); | 236 std::string api_key = google_apis::GetAPIKey(); |
235 if (!api_key.empty()) { | 237 if (!api_key.empty()) { |
236 base::StringAppendF(&url, "&key=%s", | 238 base::StringAppendF(&url, "&key=%s", |
237 net::EscapeQueryParamValue(api_key, true).c_str()); | 239 net::EscapeQueryParamValue(api_key, true).c_str()); |
238 } | 240 } |
239 return GURL(url); | 241 return GURL(url); |
240 } | 242 } |
241 | 243 |
242 } // namespace safe_browsing | 244 } // namespace safe_browsing |
OLD | NEW |