| 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/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 GURL SafeBrowsingPingManager::SafeBrowsingHitUrl( | 212 GURL SafeBrowsingPingManager::SafeBrowsingHitUrl( |
| 213 const safe_browsing::HitReport& hit_report) const { | 213 const safe_browsing::HitReport& hit_report) const { |
| 214 DCHECK(hit_report.threat_type == SB_THREAT_TYPE_URL_MALWARE || | 214 DCHECK(hit_report.threat_type == SB_THREAT_TYPE_URL_MALWARE || |
| 215 hit_report.threat_type == SB_THREAT_TYPE_URL_PHISHING || | 215 hit_report.threat_type == SB_THREAT_TYPE_URL_PHISHING || |
| 216 hit_report.threat_type == SB_THREAT_TYPE_URL_UNWANTED || | 216 hit_report.threat_type == SB_THREAT_TYPE_URL_UNWANTED || |
| 217 hit_report.threat_type == SB_THREAT_TYPE_BINARY_MALWARE_URL || | 217 hit_report.threat_type == SB_THREAT_TYPE_BINARY_MALWARE_URL || |
| 218 hit_report.threat_type == SB_THREAT_TYPE_CLIENT_SIDE_PHISHING_URL || | 218 hit_report.threat_type == SB_THREAT_TYPE_CLIENT_SIDE_PHISHING_URL || |
| 219 hit_report.threat_type == SB_THREAT_TYPE_CLIENT_SIDE_MALWARE_URL); | 219 hit_report.threat_type == SB_THREAT_TYPE_CLIENT_SIDE_MALWARE_URL); |
| 220 std::string url = SafeBrowsingProtocolManagerHelper::ComposeUrl( | 220 std::string url = SafeBrowsingProtocolManagerHelper::ComposeUrl( |
| 221 url_prefix_, "report", client_name_, version_, std::string(), | 221 url_prefix_, "report", client_name_, version_, std::string(), |
| 222 hit_report.is_extended_reporting); | 222 hit_report.extended_reporting_level); |
| 223 | 223 |
| 224 std::string threat_list = "none"; | 224 std::string threat_list = "none"; |
| 225 switch (hit_report.threat_type) { | 225 switch (hit_report.threat_type) { |
| 226 case SB_THREAT_TYPE_URL_MALWARE: | 226 case SB_THREAT_TYPE_URL_MALWARE: |
| 227 threat_list = "malblhit"; | 227 threat_list = "malblhit"; |
| 228 break; | 228 break; |
| 229 case SB_THREAT_TYPE_URL_PHISHING: | 229 case SB_THREAT_TYPE_URL_PHISHING: |
| 230 threat_list = "phishblhit"; | 230 threat_list = "phishblhit"; |
| 231 break; | 231 break; |
| 232 case SB_THREAT_TYPE_URL_UNWANTED: | 232 case SB_THREAT_TYPE_URL_UNWANTED: |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 version_.c_str()); | 299 version_.c_str()); |
| 300 std::string api_key = google_apis::GetAPIKey(); | 300 std::string api_key = google_apis::GetAPIKey(); |
| 301 if (!api_key.empty()) { | 301 if (!api_key.empty()) { |
| 302 base::StringAppendF(&url, "&key=%s", | 302 base::StringAppendF(&url, "&key=%s", |
| 303 net::EscapeQueryParamValue(api_key, true).c_str()); | 303 net::EscapeQueryParamValue(api_key, true).c_str()); |
| 304 } | 304 } |
| 305 return GURL(url); | 305 return GURL(url); |
| 306 } | 306 } |
| 307 | 307 |
| 308 } // namespace safe_browsing | 308 } // namespace safe_browsing |
| OLD | NEW |