OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #ifndef CHROME_BROWSER_POLICY_URL_BLACKLIST_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_POLICY_URL_BLACKLIST_MANAGER_H_ |
6 #define CHROME_BROWSER_POLICY_URL_BLACKLIST_MANAGER_H_ | 6 #define CHROME_BROWSER_POLICY_URL_BLACKLIST_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 // or background downloads (e.g. extensions updates, sync, etc) are not | 137 // or background downloads (e.g. extensions updates, sync, etc) are not |
138 // filtered. The sync signin page is also not filtered. | 138 // filtered. The sync signin page is also not filtered. |
139 // Must be called from the IO thread. | 139 // Must be called from the IO thread. |
140 bool IsRequestBlocked(const net::URLRequest& request) const; | 140 bool IsRequestBlocked(const net::URLRequest& request) const; |
141 | 141 |
142 // Replaces the current blacklist. Must be called on the IO thread. | 142 // Replaces the current blacklist. Must be called on the IO thread. |
143 // Virtual for testing. | 143 // Virtual for testing. |
144 virtual void SetBlacklist(scoped_ptr<URLBlacklist> blacklist); | 144 virtual void SetBlacklist(scoped_ptr<URLBlacklist> blacklist); |
145 | 145 |
146 // Registers the preferences related to blacklisting in the given PrefService. | 146 // Registers the preferences related to blacklisting in the given PrefService. |
147 static void RegisterUserPrefs(user_prefs::PrefRegistrySyncable* registry); | 147 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
148 | 148 |
149 protected: | 149 protected: |
150 // Used to delay updating the blacklist while the preferences are | 150 // Used to delay updating the blacklist while the preferences are |
151 // changing, and execute only one update per simultaneous prefs changes. | 151 // changing, and execute only one update per simultaneous prefs changes. |
152 void ScheduleUpdate(); | 152 void ScheduleUpdate(); |
153 | 153 |
154 // Updates the blacklist using the current preference values. | 154 // Updates the blacklist using the current preference values. |
155 // Virtual for testing. | 155 // Virtual for testing. |
156 virtual void Update(); | 156 virtual void Update(); |
157 | 157 |
(...skipping 23 matching lines...) Expand all Loading... |
181 | 181 |
182 // The current blacklist. | 182 // The current blacklist. |
183 scoped_ptr<URLBlacklist> blacklist_; | 183 scoped_ptr<URLBlacklist> blacklist_; |
184 | 184 |
185 DISALLOW_COPY_AND_ASSIGN(URLBlacklistManager); | 185 DISALLOW_COPY_AND_ASSIGN(URLBlacklistManager); |
186 }; | 186 }; |
187 | 187 |
188 } // namespace policy | 188 } // namespace policy |
189 | 189 |
190 #endif // CHROME_BROWSER_POLICY_URL_BLACKLIST_MANAGER_H_ | 190 #endif // CHROME_BROWSER_POLICY_URL_BLACKLIST_MANAGER_H_ |
OLD | NEW |