Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 906 // enabled. | 906 // enabled. |
| 907 #ifdef OS_CHROMEOS | 907 #ifdef OS_CHROMEOS |
| 908 // Client-side detection is disabled on ChromeOS for now, so don't bother | 908 // Client-side detection is disabled on ChromeOS for now, so don't bother |
| 909 // downloading the whitelist. | 909 // downloading the whitelist. |
| 910 enable_csd_whitelist_ = false; | 910 enable_csd_whitelist_ = false; |
| 911 #else | 911 #else |
| 912 enable_csd_whitelist_ = | 912 enable_csd_whitelist_ = |
| 913 !cmdline->HasSwitch(switches::kDisableClientSidePhishingDetection); | 913 !cmdline->HasSwitch(switches::kDisableClientSidePhishingDetection); |
| 914 #endif | 914 #endif |
| 915 | 915 |
| 916 enable_download_whitelist_ = cmdline->HasSwitch( | 916 // TODO(noelutz): remove this boolean variable since it should always be true |
| 917 switches::kEnableImprovedDownloadProtection); | 917 // if SafeBrowsing is enabled. Unfortunately, we have no test data for this |
| 918 // list right now. This means that we need to be able to disable this list | |
| 919 // for the SafeBrowsing test to pass. | |
| 920 enable_download_whitelist_ = enable_csd_whitelist_; | |
|
Brian Ryner
2011/10/28 23:00:59
This will cause the --disable-client-side-phishing
noelutz
2011/10/28 23:11:24
Yes. That's intentional. We need a way to disabl
| |
| 918 | 921 |
| 919 BrowserThread::PostTask( | 922 BrowserThread::PostTask( |
| 920 BrowserThread::IO, FROM_HERE, | 923 BrowserThread::IO, FROM_HERE, |
| 921 NewRunnableMethod( | 924 NewRunnableMethod( |
| 922 this, &SafeBrowsingService::OnIOInitialize, client_key, wrapped_key, | 925 this, &SafeBrowsingService::OnIOInitialize, client_key, wrapped_key, |
| 923 request_context_getter)); | 926 request_context_getter)); |
| 924 } | 927 } |
| 925 | 928 |
| 926 void SafeBrowsingService::Stop() { | 929 void SafeBrowsingService::Stop() { |
| 927 BrowserThread::PostTask( | 930 BrowserThread::PostTask( |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1356 Stop(); | 1359 Stop(); |
| 1357 | 1360 |
| 1358 if (csd_service_.get()) | 1361 if (csd_service_.get()) |
| 1359 csd_service_->SetEnabledAndRefreshState(enable); | 1362 csd_service_->SetEnabledAndRefreshState(enable); |
| 1360 if (download_service_.get()) { | 1363 if (download_service_.get()) { |
| 1361 download_service_->SetEnabled( | 1364 download_service_->SetEnabled( |
| 1362 enable && CommandLine::ForCurrentProcess()->HasSwitch( | 1365 enable && CommandLine::ForCurrentProcess()->HasSwitch( |
| 1363 switches::kEnableImprovedDownloadProtection)); | 1366 switches::kEnableImprovedDownloadProtection)); |
| 1364 } | 1367 } |
| 1365 } | 1368 } |
| OLD | NEW |