| 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 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 SetDatabaseManager(database_manager); | 135 SetDatabaseManager(database_manager); |
| 136 } | 136 } |
| 137 | 137 |
| 138 Blacklist::ScopedDatabaseManagerForTest::~ScopedDatabaseManagerForTest() { | 138 Blacklist::ScopedDatabaseManagerForTest::~ScopedDatabaseManagerForTest() { |
| 139 SetDatabaseManager(original_); | 139 SetDatabaseManager(original_); |
| 140 } | 140 } |
| 141 | 141 |
| 142 Blacklist::Blacklist(ExtensionPrefs* prefs) : prefs_(prefs) { | 142 Blacklist::Blacklist(ExtensionPrefs* prefs) : prefs_(prefs) { |
| 143 scoped_refptr<SafeBrowsingDatabaseManager> database_manager = | 143 scoped_refptr<SafeBrowsingDatabaseManager> database_manager = |
| 144 g_database_manager.Get().get(); | 144 g_database_manager.Get().get(); |
| 145 if (database_manager) { | 145 if (database_manager.get()) { |
| 146 registrar_.Add(this, | 146 registrar_.Add( |
| 147 chrome::NOTIFICATION_SAFE_BROWSING_UPDATE_COMPLETE, | 147 this, |
| 148 content::Source<SafeBrowsingDatabaseManager>( | 148 chrome::NOTIFICATION_SAFE_BROWSING_UPDATE_COMPLETE, |
| 149 database_manager)); | 149 content::Source<SafeBrowsingDatabaseManager>(database_manager.get())); |
| 150 } | 150 } |
| 151 | 151 |
| 152 // TODO(kalman): Delete anything from the pref blacklist that is in the | 152 // TODO(kalman): Delete anything from the pref blacklist that is in the |
| 153 // safebrowsing blacklist (of course, only entries for which the extension | 153 // safebrowsing blacklist (of course, only entries for which the extension |
| 154 // hasn't been installed). | 154 // hasn't been installed). |
| 155 // | 155 // |
| 156 // Or maybe just wait until we're able to delete the pref blacklist | 156 // Or maybe just wait until we're able to delete the pref blacklist |
| 157 // altogether (when we're sure it's a strict subset of the safebrowsing one). | 157 // altogether (when we're sure it's a strict subset of the safebrowsing one). |
| 158 } | 158 } |
| 159 | 159 |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 } | 279 } |
| 280 | 280 |
| 281 void Blacklist::Observe(int type, | 281 void Blacklist::Observe(int type, |
| 282 const content::NotificationSource& source, | 282 const content::NotificationSource& source, |
| 283 const content::NotificationDetails& details) { | 283 const content::NotificationDetails& details) { |
| 284 DCHECK_EQ(chrome::NOTIFICATION_SAFE_BROWSING_UPDATE_COMPLETE, type); | 284 DCHECK_EQ(chrome::NOTIFICATION_SAFE_BROWSING_UPDATE_COMPLETE, type); |
| 285 FOR_EACH_OBSERVER(Observer, observers_, OnBlacklistUpdated()); | 285 FOR_EACH_OBSERVER(Observer, observers_, OnBlacklistUpdated()); |
| 286 } | 286 } |
| 287 | 287 |
| 288 } // namespace extensions | 288 } // namespace extensions |
| OLD | NEW |