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/local_database_manager.h" | 5 #include "chrome/browser/safe_browsing/local_database_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
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 15 matching lines...) Expand all Loading... |
26 #include "chrome/browser/safe_browsing/protocol_manager.h" | 26 #include "chrome/browser/safe_browsing/protocol_manager.h" |
27 #include "chrome/browser/safe_browsing/safe_browsing_database.h" | 27 #include "chrome/browser/safe_browsing/safe_browsing_database.h" |
28 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 28 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
29 #include "chrome/browser/safe_browsing/ui_manager.h" | 29 #include "chrome/browser/safe_browsing/ui_manager.h" |
30 #include "chrome/common/chrome_constants.h" | 30 #include "chrome/common/chrome_constants.h" |
31 #include "chrome/common/chrome_paths.h" | 31 #include "chrome/common/chrome_paths.h" |
32 #include "chrome/common/chrome_switches.h" | 32 #include "chrome/common/chrome_switches.h" |
33 #include "chrome/common/pref_names.h" | 33 #include "chrome/common/pref_names.h" |
34 #include "components/prefs/pref_service.h" | 34 #include "components/prefs/pref_service.h" |
35 #include "components/safe_browsing_db/util.h" | 35 #include "components/safe_browsing_db/util.h" |
| 36 #include "components/safe_browsing_db/v4_get_hash_protocol_manager.h" |
36 #include "content/public/browser/browser_thread.h" | 37 #include "content/public/browser/browser_thread.h" |
37 #include "content/public/browser/notification_service.h" | 38 #include "content/public/browser/notification_service.h" |
38 #include "url/url_constants.h" | 39 #include "url/url_constants.h" |
39 | 40 |
40 using content::BrowserThread; | 41 using content::BrowserThread; |
41 | 42 |
42 namespace safe_browsing { | 43 namespace safe_browsing { |
43 | 44 |
44 namespace { | 45 namespace { |
45 | 46 |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 } | 252 } |
252 default: | 253 default: |
253 NOTREACHED(); | 254 NOTREACHED(); |
254 } | 255 } |
255 } else { | 256 } else { |
256 NOTREACHED(); | 257 NOTREACHED(); |
257 } | 258 } |
258 } | 259 } |
259 | 260 |
260 LocalSafeBrowsingDatabaseManager::LocalSafeBrowsingDatabaseManager( | 261 LocalSafeBrowsingDatabaseManager::LocalSafeBrowsingDatabaseManager( |
261 const scoped_refptr<SafeBrowsingService>& service) | 262 const scoped_refptr<SafeBrowsingService>& service) : |
262 : sb_service_(service), | 263 LocalSafeBrowsingDatabaseManager(service, NULL, V4GetHashProtocolConfig()) { |
| 264 } |
| 265 |
| 266 LocalSafeBrowsingDatabaseManager::LocalSafeBrowsingDatabaseManager( |
| 267 const scoped_refptr<SafeBrowsingService>& service, |
| 268 net::URLRequestContextGetter* request_context_getter, |
| 269 const V4GetHashProtocolConfig& config) |
| 270 : SafeBrowsingDatabaseManager(request_context_getter, config), |
| 271 sb_service_(service), |
263 database_(NULL), | 272 database_(NULL), |
264 enabled_(false), | 273 enabled_(false), |
265 enable_download_protection_(false), | 274 enable_download_protection_(false), |
266 enable_csd_whitelist_(false), | 275 enable_csd_whitelist_(false), |
267 enable_download_whitelist_(false), | 276 enable_download_whitelist_(false), |
268 enable_extension_blacklist_(false), | 277 enable_extension_blacklist_(false), |
269 enable_ip_blacklist_(false), | 278 enable_ip_blacklist_(false), |
270 enable_unwanted_software_blacklist_(true), | 279 enable_unwanted_software_blacklist_(true), |
271 update_in_progress_(false), | 280 update_in_progress_(false), |
272 database_update_in_progress_(false), | 281 database_update_in_progress_(false), |
(...skipping 929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1202 FROM_HERE, base::Bind(&LocalSafeBrowsingDatabaseManager::TimeoutCallback, | 1211 FROM_HERE, base::Bind(&LocalSafeBrowsingDatabaseManager::TimeoutCallback, |
1203 check->weak_ptr_factory_->GetWeakPtr(), check), | 1212 check->weak_ptr_factory_->GetWeakPtr(), check), |
1204 check_timeout_); | 1213 check_timeout_); |
1205 } | 1214 } |
1206 | 1215 |
1207 bool LocalSafeBrowsingDatabaseManager::download_protection_enabled() const { | 1216 bool LocalSafeBrowsingDatabaseManager::download_protection_enabled() const { |
1208 return enable_download_protection_; | 1217 return enable_download_protection_; |
1209 } | 1218 } |
1210 | 1219 |
1211 } // namespace safe_browsing | 1220 } // namespace safe_browsing |
OLD | NEW |