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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/format_macros.h" | 12 #include "base/format_macros.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
16 #include "base/metrics/field_trial.h" | 16 #include "base/metrics/field_trial.h" |
17 #include "base/metrics/histogram.h" | 17 #include "base/metrics/histogram.h" |
18 #include "base/metrics/sparse_histogram.h" | 18 #include "base/metrics/sparse_histogram.h" |
19 #include "base/prefs/pref_service.h" | |
20 #include "base/sequenced_task_runner_helpers.h" | 19 #include "base/sequenced_task_runner_helpers.h" |
21 #include "base/stl_util.h" | 20 #include "base/stl_util.h" |
22 #include "base/strings/string_number_conversions.h" | 21 #include "base/strings/string_number_conversions.h" |
23 #include "base/strings/string_split.h" | 22 #include "base/strings/string_split.h" |
24 #include "base/strings/string_util.h" | 23 #include "base/strings/string_util.h" |
25 #include "base/strings/stringprintf.h" | 24 #include "base/strings/stringprintf.h" |
26 #include "base/task/cancelable_task_tracker.h" | 25 #include "base/task/cancelable_task_tracker.h" |
27 #include "base/threading/sequenced_worker_pool.h" | 26 #include "base/threading/sequenced_worker_pool.h" |
28 #include "base/time/time.h" | 27 #include "base/time/time.h" |
29 #include "build/build_config.h" | 28 #include "build/build_config.h" |
30 #include "chrome/browser/browser_process.h" | 29 #include "chrome/browser/browser_process.h" |
31 #include "chrome/browser/history/history_service_factory.h" | 30 #include "chrome/browser/history/history_service_factory.h" |
32 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" | 31 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" |
33 #include "chrome/browser/profiles/profile.h" | 32 #include "chrome/browser/profiles/profile.h" |
34 #include "chrome/browser/profiles/profile_manager.h" | 33 #include "chrome/browser/profiles/profile_manager.h" |
35 #include "chrome/browser/safe_browsing/download_feedback_service.h" | 34 #include "chrome/browser/safe_browsing/download_feedback_service.h" |
36 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 35 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
37 #include "chrome/browser/safe_browsing/sandboxed_zip_analyzer.h" | 36 #include "chrome/browser/safe_browsing/sandboxed_zip_analyzer.h" |
38 #include "chrome/browser/ui/browser.h" | 37 #include "chrome/browser/ui/browser.h" |
39 #include "chrome/browser/ui/browser_list.h" | 38 #include "chrome/browser/ui/browser_list.h" |
40 #include "chrome/common/chrome_switches.h" | 39 #include "chrome/common/chrome_switches.h" |
41 #include "chrome/common/pref_names.h" | 40 #include "chrome/common/pref_names.h" |
42 #include "chrome/common/safe_browsing/binary_feature_extractor.h" | 41 #include "chrome/common/safe_browsing/binary_feature_extractor.h" |
43 #include "chrome/common/safe_browsing/csd.pb.h" | 42 #include "chrome/common/safe_browsing/csd.pb.h" |
44 #include "chrome/common/safe_browsing/download_protection_util.h" | 43 #include "chrome/common/safe_browsing/download_protection_util.h" |
45 #include "chrome/common/safe_browsing/zip_analyzer_results.h" | 44 #include "chrome/common/safe_browsing/zip_analyzer_results.h" |
46 #include "chrome/common/url_constants.h" | 45 #include "chrome/common/url_constants.h" |
47 #include "components/google/core/browser/google_util.h" | 46 #include "components/google/core/browser/google_util.h" |
48 #include "components/history/core/browser/history_service.h" | 47 #include "components/history/core/browser/history_service.h" |
| 48 #include "components/prefs/pref_service.h" |
49 #include "content/public/browser/browser_thread.h" | 49 #include "content/public/browser/browser_thread.h" |
50 #include "content/public/browser/download_item.h" | 50 #include "content/public/browser/download_item.h" |
51 #include "content/public/browser/page_navigator.h" | 51 #include "content/public/browser/page_navigator.h" |
52 #include "crypto/sha2.h" | 52 #include "crypto/sha2.h" |
53 #include "google_apis/google_api_keys.h" | 53 #include "google_apis/google_api_keys.h" |
54 #include "net/base/escape.h" | 54 #include "net/base/escape.h" |
55 #include "net/base/load_flags.h" | 55 #include "net/base/load_flags.h" |
56 #include "net/base/url_util.h" | 56 #include "net/base/url_util.h" |
57 #include "net/cert/x509_cert_types.h" | 57 #include "net/cert/x509_cert_types.h" |
58 #include "net/cert/x509_certificate.h" | 58 #include "net/cert/x509_certificate.h" |
(...skipping 1183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1242 GURL DownloadProtectionService::GetDownloadRequestUrl() { | 1242 GURL DownloadProtectionService::GetDownloadRequestUrl() { |
1243 GURL url(kDownloadRequestUrl); | 1243 GURL url(kDownloadRequestUrl); |
1244 std::string api_key = google_apis::GetAPIKey(); | 1244 std::string api_key = google_apis::GetAPIKey(); |
1245 if (!api_key.empty()) | 1245 if (!api_key.empty()) |
1246 url = url.Resolve("?key=" + net::EscapeQueryParamValue(api_key, true)); | 1246 url = url.Resolve("?key=" + net::EscapeQueryParamValue(api_key, true)); |
1247 | 1247 |
1248 return url; | 1248 return url; |
1249 } | 1249 } |
1250 | 1250 |
1251 } // namespace safe_browsing | 1251 } // namespace safe_browsing |
OLD | NEW |