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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 | 244 |
245 #if defined(FULL_SAFE_BROWSING) | 245 #if defined(FULL_SAFE_BROWSING) |
246 #if defined(SAFE_BROWSING_CSD) | 246 #if defined(SAFE_BROWSING_CSD) |
247 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( | 247 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
248 switches::kDisableClientSidePhishingDetection)) { | 248 switches::kDisableClientSidePhishingDetection)) { |
249 csd_service_.reset(safe_browsing::ClientSideDetectionService::Create( | 249 csd_service_.reset(safe_browsing::ClientSideDetectionService::Create( |
250 url_request_context_getter_.get())); | 250 url_request_context_getter_.get())); |
251 } | 251 } |
252 #endif // defined(SAFE_BROWSING_CSD) | 252 #endif // defined(SAFE_BROWSING_CSD) |
253 | 253 |
254 // TODO(nparker): Adding SAFE_BROWSING_SERVICE_DOWNLOAD to control this might | |
255 // allow removing FULL_SAFE_BROWSING above. | |
256 #if !defined(OS_ANDROID) | |
257 download_service_.reset(new safe_browsing::DownloadProtectionService( | 254 download_service_.reset(new safe_browsing::DownloadProtectionService( |
258 this, url_request_context_getter_.get())); | 255 this, url_request_context_getter_.get())); |
259 #endif | |
260 | 256 |
261 if (safe_browsing::IncidentReportingService::IsEnabled()) { | 257 if (safe_browsing::IncidentReportingService::IsEnabled()) { |
262 incident_service_.reset(new safe_browsing::IncidentReportingService( | 258 incident_service_.reset(new safe_browsing::IncidentReportingService( |
263 this, url_request_context_getter_)); | 259 this, url_request_context_getter_)); |
264 resource_request_detector_.reset(new safe_browsing::ResourceRequestDetector( | 260 resource_request_detector_.reset(new safe_browsing::ResourceRequestDetector( |
265 incident_service_->GetIncidentReceiver())); | 261 incident_service_->GetIncidentReceiver())); |
266 } | 262 } |
267 | 263 |
268 off_domain_inclusion_detector_.reset( | 264 off_domain_inclusion_detector_.reset( |
269 new safe_browsing::OffDomainInclusionDetector(database_manager_)); | 265 new safe_browsing::OffDomainInclusionDetector(database_manager_)); |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
660 | 656 |
661 state_callback_list_.Notify(); | 657 state_callback_list_.Notify(); |
662 | 658 |
663 #if defined(FULL_SAFE_BROWSING) | 659 #if defined(FULL_SAFE_BROWSING) |
664 if (csd_service_) | 660 if (csd_service_) |
665 csd_service_->SetEnabledAndRefreshState(enable); | 661 csd_service_->SetEnabledAndRefreshState(enable); |
666 if (download_service_) | 662 if (download_service_) |
667 download_service_->SetEnabled(enable); | 663 download_service_->SetEnabled(enable); |
668 #endif | 664 #endif |
669 } | 665 } |
OLD | NEW |