| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef CHROME_BROWSER_EXTENSIONS_BLACKLIST_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_BLACKLIST_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_BLACKLIST_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_BLACKLIST_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 // marked in the blacklist as BLACKLISTED_MALWARE and asynchronously pass | 86 // marked in the blacklist as BLACKLISTED_MALWARE and asynchronously pass |
| 87 // to |callback|. Basically, will call GetBlacklistedIDs and filter its | 87 // to |callback|. Basically, will call GetBlacklistedIDs and filter its |
| 88 // results. | 88 // results. |
| 89 void GetMalwareIDs(const std::set<std::string>& ids, | 89 void GetMalwareIDs(const std::set<std::string>& ids, |
| 90 const GetMalwareIDsCallback& callback); | 90 const GetMalwareIDsCallback& callback); |
| 91 | 91 |
| 92 // More convenient form of GetBlacklistedIDs for checking a single extension. | 92 // More convenient form of GetBlacklistedIDs for checking a single extension. |
| 93 void IsBlacklisted(const std::string& extension_id, | 93 void IsBlacklisted(const std::string& extension_id, |
| 94 const IsBlacklistedCallback& callback); | 94 const IsBlacklistedCallback& callback); |
| 95 | 95 |
| 96 // Used to mock BlacklistStateFetcher in unit tests. | 96 // Used to mock BlacklistStateFetcher in unit tests. Blacklist owns the |
| 97 // |fetcher|. |
| 97 void SetBlacklistStateFetcherForTest(BlacklistStateFetcher* fetcher); | 98 void SetBlacklistStateFetcherForTest(BlacklistStateFetcher* fetcher); |
| 98 | 99 |
| 100 // Reset the owned BlacklistStateFetcher to null and return the current |
| 101 // BlacklistStateFetcher. |
| 102 BlacklistStateFetcher* ResetBlacklistStateFetcherForTest(); |
| 103 |
| 99 // Adds/removes an observer to the blacklist. | 104 // Adds/removes an observer to the blacklist. |
| 100 void AddObserver(Observer* observer); | 105 void AddObserver(Observer* observer); |
| 101 void RemoveObserver(Observer* observer); | 106 void RemoveObserver(Observer* observer); |
| 102 | 107 |
| 103 private: | 108 private: |
| 104 // Use via ScopedDatabaseManagerForTest. | 109 // Use via ScopedDatabaseManagerForTest. |
| 105 static void SetDatabaseManager( | 110 static void SetDatabaseManager( |
| 106 scoped_refptr<SafeBrowsingDatabaseManager> database_manager); | 111 scoped_refptr<SafeBrowsingDatabaseManager> database_manager); |
| 107 static scoped_refptr<SafeBrowsingDatabaseManager> GetDatabaseManager(); | 112 static scoped_refptr<SafeBrowsingDatabaseManager> GetDatabaseManager(); |
| 108 | 113 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 // GetBlacklistedIDs and deleted when the callback is called from | 145 // GetBlacklistedIDs and deleted when the callback is called from |
| 141 // OnBlacklistStateReceived. | 146 // OnBlacklistStateReceived. |
| 142 StateRequestsList state_requests_; | 147 StateRequestsList state_requests_; |
| 143 | 148 |
| 144 DISALLOW_COPY_AND_ASSIGN(Blacklist); | 149 DISALLOW_COPY_AND_ASSIGN(Blacklist); |
| 145 }; | 150 }; |
| 146 | 151 |
| 147 } // namespace extensions | 152 } // namespace extensions |
| 148 | 153 |
| 149 #endif // CHROME_BROWSER_EXTENSIONS_BLACKLIST_H_ | 154 #endif // CHROME_BROWSER_EXTENSIONS_BLACKLIST_H_ |
| OLD | NEW |