| 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/download_protection_service.h" | 5 #include "chrome/browser/safe_browsing/download_protection_service.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 #include "chrome/common/safe_browsing/csd.pb.h" | 25 #include "chrome/common/safe_browsing/csd.pb.h" |
| 26 #include "chrome/common/safe_browsing/download_protection_util.h" | 26 #include "chrome/common/safe_browsing/download_protection_util.h" |
| 27 #include "chrome/common/safe_browsing/zip_analyzer.h" | 27 #include "chrome/common/safe_browsing/zip_analyzer.h" |
| 28 #include "chrome/common/url_constants.h" | 28 #include "chrome/common/url_constants.h" |
| 29 #include "content/public/browser/browser_thread.h" | 29 #include "content/public/browser/browser_thread.h" |
| 30 #include "content/public/browser/download_item.h" | 30 #include "content/public/browser/download_item.h" |
| 31 #include "content/public/browser/page_navigator.h" | 31 #include "content/public/browser/page_navigator.h" |
| 32 #include "google_apis/google_api_keys.h" | 32 #include "google_apis/google_api_keys.h" |
| 33 #include "net/base/escape.h" | 33 #include "net/base/escape.h" |
| 34 #include "net/base/load_flags.h" | 34 #include "net/base/load_flags.h" |
| 35 #include "net/base/x509_cert_types.h" | 35 #include "net/cert/x509_cert_types.h" |
| 36 #include "net/base/x509_certificate.h" | 36 #include "net/cert/x509_certificate.h" |
| 37 #include "net/http/http_status_code.h" | 37 #include "net/http/http_status_code.h" |
| 38 #include "net/url_request/url_fetcher.h" | 38 #include "net/url_request/url_fetcher.h" |
| 39 #include "net/url_request/url_fetcher_delegate.h" | 39 #include "net/url_request/url_fetcher_delegate.h" |
| 40 #include "net/url_request/url_request_context_getter.h" | 40 #include "net/url_request/url_request_context_getter.h" |
| 41 #include "net/url_request/url_request_status.h" | 41 #include "net/url_request/url_request_status.h" |
| 42 | 42 |
| 43 using content::BrowserThread; | 43 using content::BrowserThread; |
| 44 | 44 |
| 45 namespace { | 45 namespace { |
| 46 static const int64 kDownloadRequestTimeoutMs = 3000; | 46 static const int64 kDownloadRequestTimeoutMs = 3000; |
| (...skipping 897 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 944 std::string url = kDownloadRequestUrl; | 944 std::string url = kDownloadRequestUrl; |
| 945 std::string api_key = google_apis::GetAPIKey(); | 945 std::string api_key = google_apis::GetAPIKey(); |
| 946 if (!api_key.empty()) { | 946 if (!api_key.empty()) { |
| 947 base::StringAppendF(&url, "?key=%s", | 947 base::StringAppendF(&url, "?key=%s", |
| 948 net::EscapeQueryParamValue(api_key, true).c_str()); | 948 net::EscapeQueryParamValue(api_key, true).c_str()); |
| 949 } | 949 } |
| 950 return url; | 950 return url; |
| 951 } | 951 } |
| 952 | 952 |
| 953 } // namespace safe_browsing | 953 } // namespace safe_browsing |
| OLD | NEW |