| 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/safe_browsing_service.h" | 5 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 // be deleted on the IOThread, and the SafeBrowsingService outlives the IO | 339 // be deleted on the IOThread, and the SafeBrowsingService outlives the IO |
| 340 // thread. | 340 // thread. |
| 341 url_request_context_getter_ = nullptr; | 341 url_request_context_getter_ = nullptr; |
| 342 } | 342 } |
| 343 | 343 |
| 344 // Binhash verification is only enabled for UMA users for now. | 344 // Binhash verification is only enabled for UMA users for now. |
| 345 bool SafeBrowsingService::DownloadBinHashNeeded() const { | 345 bool SafeBrowsingService::DownloadBinHashNeeded() const { |
| 346 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 346 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 347 | 347 |
| 348 #if defined(FULL_SAFE_BROWSING) | 348 #if defined(FULL_SAFE_BROWSING) |
| 349 return (database_manager_->download_protection_enabled() && | 349 return (database_manager_->IsDownloadProtectionEnabled() && |
| 350 ChromeMetricsServiceAccessor::IsMetricsAndCrashReportingEnabled()) || | 350 ChromeMetricsServiceAccessor::IsMetricsAndCrashReportingEnabled()) || |
| 351 (download_protection_service() && | 351 (download_protection_service() && |
| 352 download_protection_service()->enabled()); | 352 download_protection_service()->enabled()); |
| 353 #else | 353 #else |
| 354 return false; | 354 return false; |
| 355 #endif | 355 #endif |
| 356 } | 356 } |
| 357 | 357 |
| 358 net::URLRequestContextGetter* SafeBrowsingService::url_request_context() { | 358 net::URLRequestContextGetter* SafeBrowsingService::url_request_context() { |
| 359 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 359 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 693 } | 693 } |
| 694 | 694 |
| 695 void SafeBrowsingService::OnSendSerializedDownloadReport( | 695 void SafeBrowsingService::OnSendSerializedDownloadReport( |
| 696 const std::string& report) { | 696 const std::string& report) { |
| 697 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 697 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 698 if (ping_manager()) | 698 if (ping_manager()) |
| 699 ping_manager()->ReportThreatDetails(report); | 699 ping_manager()->ReportThreatDetails(report); |
| 700 } | 700 } |
| 701 | 701 |
| 702 } // namespace safe_browsing | 702 } // namespace safe_browsing |
| OLD | NEW |