Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(412)

Side by Side Diff: chrome/browser/extensions/blacklist.h

Issue 119963004: Manage all the testing classes for Blacklist in TestBlacklist. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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();
not at google - send to devlin 2013/12/21 00:34:24 return a scoped_ptr<BlacklistStateFetcher> here.
Oleg Eterevsky 2014/01/09 13:54:01 Done.
Oleg Eterevsky 2014/01/09 17:58:10 It turns out, after the holidays I forgot, that it
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
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_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/blacklist.cc » ('j') | chrome/browser/extensions/test_blacklist.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698