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 868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
879 // We only download the csd-whitelist if client-side phishing detection is | 879 // We only download the csd-whitelist if client-side phishing detection is |
880 // enabled and if the user has opted in with stats collection. Note: we | 880 // enabled and if the user has opted in with stats collection. Note: we |
881 // cannot check whether the metrics_service() object is created because it | 881 // cannot check whether the metrics_service() object is created because it |
882 // may be initialized after this method is called. | 882 // may be initialized after this method is called. |
883 #ifdef OS_CHROMEOS | 883 #ifdef OS_CHROMEOS |
884 // Client-side detection is disabled on ChromeOS for now, so don't bother | 884 // Client-side detection is disabled on ChromeOS for now, so don't bother |
885 // downloading the whitelist. | 885 // downloading the whitelist. |
886 enable_csd_whitelist_ = false; | 886 enable_csd_whitelist_ = false; |
887 #else | 887 #else |
888 enable_csd_whitelist_ = | 888 enable_csd_whitelist_ = |
889 (!cmdline->HasSwitch(switches::kDisableClientSidePhishingDetection) && | 889 (cmdline->HasSwitch( |
890 local_state && local_state->GetBoolean(prefs::kMetricsReportingEnabled)); | 890 switches::kEnableSanitizedClientSidePhishingDetection) || |
| 891 (!cmdline->HasSwitch(switches::kDisableClientSidePhishingDetection) && |
| 892 local_state && |
| 893 local_state->GetBoolean(prefs::kMetricsReportingEnabled))); |
891 #endif | 894 #endif |
892 | 895 |
893 BrowserThread::PostTask( | 896 BrowserThread::PostTask( |
894 BrowserThread::IO, FROM_HERE, | 897 BrowserThread::IO, FROM_HERE, |
895 NewRunnableMethod( | 898 NewRunnableMethod( |
896 this, &SafeBrowsingService::OnIOInitialize, client_key, wrapped_key, | 899 this, &SafeBrowsingService::OnIOInitialize, client_key, wrapped_key, |
897 request_context_getter)); | 900 request_context_getter)); |
898 } | 901 } |
899 | 902 |
900 void SafeBrowsingService::OnCloseDatabase() { | 903 void SafeBrowsingService::OnCloseDatabase() { |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1316 enable = true; | 1319 enable = true; |
1317 break; | 1320 break; |
1318 } | 1321 } |
1319 } | 1322 } |
1320 | 1323 |
1321 if (enable) | 1324 if (enable) |
1322 Start(); | 1325 Start(); |
1323 else | 1326 else |
1324 ShutDown(); | 1327 ShutDown(); |
1325 } | 1328 } |
OLD | NEW |