| 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" | 
| 11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" | 
| 12 #include "base/metrics/field_trial.h" | 12 #include "base/metrics/field_trial.h" | 
| 13 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" | 
| 14 #include "base/metrics/sparse_histogram.h" | 14 #include "base/metrics/sparse_histogram.h" | 
| 15 #include "base/sequenced_task_runner_helpers.h" | 15 #include "base/sequenced_task_runner_helpers.h" | 
| 16 #include "base/stl_util.h" | 16 #include "base/stl_util.h" | 
| 17 #include "base/strings/string_number_conversions.h" | 17 #include "base/strings/string_number_conversions.h" | 
| 18 #include "base/strings/string_util.h" | 18 #include "base/strings/string_util.h" | 
| 19 #include "base/strings/stringprintf.h" | 19 #include "base/strings/stringprintf.h" | 
| 20 #include "base/task/cancelable_task_tracker.h" | 20 #include "base/task/cancelable_task_tracker.h" | 
| 21 #include "base/threading/sequenced_worker_pool.h" | 21 #include "base/threading/sequenced_worker_pool.h" | 
| 22 #include "base/time/time.h" | 22 #include "base/time/time.h" | 
| 23 #include "chrome/browser/browser_process.h" | 23 #include "chrome/browser/browser_process.h" | 
| 24 #include "chrome/browser/history/history_service_factory.h" | 24 #include "chrome/browser/history/history_service_factory.h" | 
| 25 #include "chrome/browser/profiles/profile.h" | 25 #include "chrome/browser/profiles/profile.h" | 
| 26 #include "chrome/browser/safe_browsing/binary_feature_extractor.h" |  | 
| 27 #include "chrome/browser/safe_browsing/download_feedback_service.h" | 26 #include "chrome/browser/safe_browsing/download_feedback_service.h" | 
| 28 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 27 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 
| 29 #include "chrome/browser/safe_browsing/sandboxed_zip_analyzer.h" | 28 #include "chrome/browser/safe_browsing/sandboxed_zip_analyzer.h" | 
| 30 #include "chrome/browser/ui/browser.h" | 29 #include "chrome/browser/ui/browser.h" | 
| 31 #include "chrome/browser/ui/browser_list.h" | 30 #include "chrome/browser/ui/browser_list.h" | 
|  | 31 #include "chrome/common/safe_browsing/binary_feature_extractor.h" | 
| 32 #include "chrome/common/safe_browsing/csd.pb.h" | 32 #include "chrome/common/safe_browsing/csd.pb.h" | 
| 33 #include "chrome/common/safe_browsing/download_protection_util.h" | 33 #include "chrome/common/safe_browsing/download_protection_util.h" | 
| 34 #include "chrome/common/safe_browsing/zip_analyzer.h" | 34 #include "chrome/common/safe_browsing/zip_analyzer.h" | 
| 35 #include "chrome/common/url_constants.h" | 35 #include "chrome/common/url_constants.h" | 
| 36 #include "components/google/core/browser/google_util.h" | 36 #include "components/google/core/browser/google_util.h" | 
| 37 #include "components/history/core/browser/history_service.h" | 37 #include "components/history/core/browser/history_service.h" | 
| 38 #include "content/public/browser/browser_thread.h" | 38 #include "content/public/browser/browser_thread.h" | 
| 39 #include "content/public/browser/download_item.h" | 39 #include "content/public/browser/download_item.h" | 
| 40 #include "content/public/browser/page_navigator.h" | 40 #include "content/public/browser/page_navigator.h" | 
| 41 #include "crypto/sha2.h" | 41 #include "crypto/sha2.h" | 
| (...skipping 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1136 GURL DownloadProtectionService::GetDownloadRequestUrl() { | 1136 GURL DownloadProtectionService::GetDownloadRequestUrl() { | 
| 1137   GURL url(kDownloadRequestUrl); | 1137   GURL url(kDownloadRequestUrl); | 
| 1138   std::string api_key = google_apis::GetAPIKey(); | 1138   std::string api_key = google_apis::GetAPIKey(); | 
| 1139   if (!api_key.empty()) | 1139   if (!api_key.empty()) | 
| 1140     url = url.Resolve("?key=" + net::EscapeQueryParamValue(api_key, true)); | 1140     url = url.Resolve("?key=" + net::EscapeQueryParamValue(api_key, true)); | 
| 1141 | 1141 | 
| 1142   return url; | 1142   return url; | 
| 1143 } | 1143 } | 
| 1144 | 1144 | 
| 1145 }  // namespace safe_browsing | 1145 }  // namespace safe_browsing | 
| OLD | NEW | 
|---|