| 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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 | 217 |
| 218 database_manager_ = CreateDatabaseManager(); | 218 database_manager_ = CreateDatabaseManager(); |
| 219 | 219 |
| 220 BrowserThread::PostTask( | 220 BrowserThread::PostTask( |
| 221 BrowserThread::IO, FROM_HERE, | 221 BrowserThread::IO, FROM_HERE, |
| 222 base::Bind( | 222 base::Bind( |
| 223 &SafeBrowsingService::InitURLRequestContextOnIOThread, this, | 223 &SafeBrowsingService::InitURLRequestContextOnIOThread, this, |
| 224 make_scoped_refptr(g_browser_process->system_request_context()))); | 224 make_scoped_refptr(g_browser_process->system_request_context()))); |
| 225 | 225 |
| 226 #if defined(FULL_SAFE_BROWSING) | 226 #if defined(FULL_SAFE_BROWSING) |
| 227 #if !defined(OS_ANDROID) |
| 227 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 228 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
| 228 switches::kDisableClientSidePhishingDetection)) { | 229 switches::kDisableClientSidePhishingDetection)) { |
| 229 csd_service_.reset(safe_browsing::ClientSideDetectionService::Create( | 230 csd_service_.reset(safe_browsing::ClientSideDetectionService::Create( |
| 230 url_request_context_getter_.get())); | 231 url_request_context_getter_.get())); |
| 231 } | 232 } |
| 232 download_service_.reset(new safe_browsing::DownloadProtectionService( | 233 download_service_.reset(new safe_browsing::DownloadProtectionService( |
| 233 this, url_request_context_getter_.get())); | 234 this, url_request_context_getter_.get())); |
| 235 #endif |
| 234 | 236 |
| 235 if (IsIncidentReportingServiceEnabled()) { | 237 if (IsIncidentReportingServiceEnabled()) { |
| 236 incident_service_.reset(new safe_browsing::IncidentReportingService( | 238 incident_service_.reset(new safe_browsing::IncidentReportingService( |
| 237 this, url_request_context_getter_)); | 239 this, url_request_context_getter_)); |
| 238 } | 240 } |
| 239 #endif | 241 #endif |
| 240 | 242 |
| 241 // Track the safe browsing preference of existing profiles. | 243 // Track the safe browsing preference of existing profiles. |
| 242 // The SafeBrowsingService will be started if any existing profile has the | 244 // The SafeBrowsingService will be started if any existing profile has the |
| 243 // preference enabled. It will also listen for updates to the preferences. | 245 // preference enabled. It will also listen for updates to the preferences. |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 else | 537 else |
| 536 Stop(false); | 538 Stop(false); |
| 537 | 539 |
| 538 #if defined(FULL_SAFE_BROWSING) | 540 #if defined(FULL_SAFE_BROWSING) |
| 539 if (csd_service_) | 541 if (csd_service_) |
| 540 csd_service_->SetEnabledAndRefreshState(enable); | 542 csd_service_->SetEnabledAndRefreshState(enable); |
| 541 if (download_service_) | 543 if (download_service_) |
| 542 download_service_->SetEnabled(enable); | 544 download_service_->SetEnabled(enable); |
| 543 #endif | 545 #endif |
| 544 } | 546 } |
| OLD | NEW |