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

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

Issue 1420053005: Move code in components/safe_browsing_db and chrome/browser/s_b/ under the safe_browsing namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@02_components_move
Patch Set: Remove '// namespace safe_browsing' for a small fwd decl block. Created 5 years, 1 month 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
« no previous file with comments | « chrome/browser/download/download_commands.cc ('k') | chrome/browser/extensions/blacklist.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 protected: 46 protected:
47 virtual ~Observer(); 47 virtual ~Observer();
48 48
49 private: 49 private:
50 Blacklist* blacklist_; 50 Blacklist* blacklist_;
51 }; 51 };
52 52
53 class ScopedDatabaseManagerForTest { 53 class ScopedDatabaseManagerForTest {
54 public: 54 public:
55 explicit ScopedDatabaseManagerForTest( 55 explicit ScopedDatabaseManagerForTest(
56 scoped_refptr<SafeBrowsingDatabaseManager> database_manager); 56 scoped_refptr<safe_browsing::SafeBrowsingDatabaseManager>
57 database_manager);
57 58
58 ~ScopedDatabaseManagerForTest(); 59 ~ScopedDatabaseManagerForTest();
59 60
60 private: 61 private:
61 scoped_refptr<SafeBrowsingDatabaseManager> original_; 62 scoped_refptr<safe_browsing::SafeBrowsingDatabaseManager> original_;
62 63
63 DISALLOW_COPY_AND_ASSIGN(ScopedDatabaseManagerForTest); 64 DISALLOW_COPY_AND_ASSIGN(ScopedDatabaseManagerForTest);
64 }; 65 };
65 66
66 typedef std::map<std::string, BlacklistState> BlacklistStateMap; 67 typedef std::map<std::string, BlacklistState> BlacklistStateMap;
67 68
68 typedef base::Callback<void(const BlacklistStateMap&)> 69 typedef base::Callback<void(const BlacklistStateMap&)>
69 GetBlacklistedIDsCallback; 70 GetBlacklistedIDsCallback;
70 71
71 typedef base::Callback<void(const std::set<std::string>&)> 72 typedef base::Callback<void(const std::set<std::string>&)>
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 // BlacklistStateFetcher. 110 // BlacklistStateFetcher.
110 BlacklistStateFetcher* ResetBlacklistStateFetcherForTest(); 111 BlacklistStateFetcher* ResetBlacklistStateFetcherForTest();
111 112
112 // Adds/removes an observer to the blacklist. 113 // Adds/removes an observer to the blacklist.
113 void AddObserver(Observer* observer); 114 void AddObserver(Observer* observer);
114 void RemoveObserver(Observer* observer); 115 void RemoveObserver(Observer* observer);
115 116
116 private: 117 private:
117 // Use via ScopedDatabaseManagerForTest. 118 // Use via ScopedDatabaseManagerForTest.
118 static void SetDatabaseManager( 119 static void SetDatabaseManager(
119 scoped_refptr<SafeBrowsingDatabaseManager> database_manager); 120 scoped_refptr<safe_browsing::SafeBrowsingDatabaseManager>
120 static scoped_refptr<SafeBrowsingDatabaseManager> GetDatabaseManager(); 121 database_manager);
122 static scoped_refptr<safe_browsing::SafeBrowsingDatabaseManager>
123 GetDatabaseManager();
121 124
122 // content::NotificationObserver 125 // content::NotificationObserver
123 void Observe(int type, 126 void Observe(int type,
124 const content::NotificationSource& source, 127 const content::NotificationSource& source,
125 const content::NotificationDetails& details) override; 128 const content::NotificationDetails& details) override;
126 129
127 void GetBlacklistStateForIDs(const GetBlacklistedIDsCallback& callback, 130 void GetBlacklistStateForIDs(const GetBlacklistedIDsCallback& callback,
128 const std::set<std::string>& blacklisted_ids); 131 const std::set<std::string>& blacklisted_ids);
129 132
130 void RequestExtensionsBlacklistState(const std::set<std::string>& ids, 133 void RequestExtensionsBlacklistState(const std::set<std::string>& ids,
(...skipping 22 matching lines...) Expand all
153 // GetBlacklistedIDs and deleted when the callback is called from 156 // GetBlacklistedIDs and deleted when the callback is called from
154 // OnBlacklistStateReceived. 157 // OnBlacklistStateReceived.
155 StateRequestsList state_requests_; 158 StateRequestsList state_requests_;
156 159
157 DISALLOW_COPY_AND_ASSIGN(Blacklist); 160 DISALLOW_COPY_AND_ASSIGN(Blacklist);
158 }; 161 };
159 162
160 } // namespace extensions 163 } // namespace extensions
161 164
162 #endif // CHROME_BROWSER_EXTENSIONS_BLACKLIST_H_ 165 #endif // CHROME_BROWSER_EXTENSIONS_BLACKLIST_H_
OLDNEW
« no previous file with comments | « chrome/browser/download/download_commands.cc ('k') | chrome/browser/extensions/blacklist.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698