OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/extensions/blacklist.h" | 5 #include "chrome/browser/extensions/blacklist.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <iterator> | 8 #include <iterator> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 namespace extensions { | 27 namespace extensions { |
28 | 28 |
29 namespace { | 29 namespace { |
30 | 30 |
31 // The safe browsing database manager to use. Make this a global/static variable | 31 // The safe browsing database manager to use. Make this a global/static variable |
32 // rather than a member of Blacklist because Blacklist accesses the real | 32 // rather than a member of Blacklist because Blacklist accesses the real |
33 // database manager before it has a chance to get a fake one. | 33 // database manager before it has a chance to get a fake one. |
34 class LazySafeBrowsingDatabaseManager { | 34 class LazySafeBrowsingDatabaseManager { |
35 public: | 35 public: |
36 LazySafeBrowsingDatabaseManager() { | 36 LazySafeBrowsingDatabaseManager() { |
37 #if defined(FULL_SAFE_BROWSING) || defined(MOBILE_SAFE_BROWSING) | 37 #if defined(SAFE_BROWSING_DATABASE) |
38 if (g_browser_process && g_browser_process->safe_browsing_service()) { | 38 if (g_browser_process && g_browser_process->safe_browsing_service()) { |
39 instance_ = | 39 instance_ = |
40 g_browser_process->safe_browsing_service()->database_manager(); | 40 g_browser_process->safe_browsing_service()->database_manager(); |
41 } | 41 } |
42 #endif | 42 #endif |
43 } | 43 } |
44 | 44 |
45 scoped_refptr<SafeBrowsingDatabaseManager> get() { | 45 scoped_refptr<SafeBrowsingDatabaseManager> get() { |
46 return instance_; | 46 return instance_; |
47 } | 47 } |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 } | 343 } |
344 | 344 |
345 void Blacklist::Observe(int type, | 345 void Blacklist::Observe(int type, |
346 const content::NotificationSource& source, | 346 const content::NotificationSource& source, |
347 const content::NotificationDetails& details) { | 347 const content::NotificationDetails& details) { |
348 DCHECK_EQ(chrome::NOTIFICATION_SAFE_BROWSING_UPDATE_COMPLETE, type); | 348 DCHECK_EQ(chrome::NOTIFICATION_SAFE_BROWSING_UPDATE_COMPLETE, type); |
349 FOR_EACH_OBSERVER(Observer, observers_, OnBlacklistUpdated()); | 349 FOR_EACH_OBSERVER(Observer, observers_, OnBlacklistUpdated()); |
350 } | 350 } |
351 | 351 |
352 } // namespace extensions | 352 } // namespace extensions |
OLD | NEW |