OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_POLICY_CORE_BROWSER_URL_BLACKLIST_MANAGER_H_ | 5 #ifndef COMPONENTS_POLICY_CORE_BROWSER_URL_BLACKLIST_MANAGER_H_ |
6 #define COMPONENTS_POLICY_CORE_BROWSER_URL_BLACKLIST_MANAGER_H_ | 6 #define COMPONENTS_POLICY_CORE_BROWSER_URL_BLACKLIST_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 namespace user_prefs { | 30 namespace user_prefs { |
31 class PrefRegistrySyncable; | 31 class PrefRegistrySyncable; |
32 } | 32 } |
33 | 33 |
34 namespace policy { | 34 namespace policy { |
35 | 35 |
36 // Contains a set of filters to block and allow certain URLs, and matches GURLs | 36 // Contains a set of filters to block and allow certain URLs, and matches GURLs |
37 // against this set. The filters are currently kept in memory. | 37 // against this set. The filters are currently kept in memory. |
38 class POLICY_EXPORT URLBlacklist { | 38 class POLICY_EXPORT URLBlacklist { |
39 public: | 39 public: |
40 // This is meant to be bound to url_fixer::SegmentURL. See that function | 40 // This is meant to be bound to url_formatter::SegmentURL. See that function |
41 // for documentation on the parameters and return value. | 41 // for documentation on the parameters and return value. |
42 typedef std::string (*SegmentURLCallback)(const std::string&, url::Parsed*); | 42 typedef std::string (*SegmentURLCallback)(const std::string&, url::Parsed*); |
43 | 43 |
44 explicit URLBlacklist(SegmentURLCallback segment_url); | 44 explicit URLBlacklist(SegmentURLCallback segment_url); |
45 virtual ~URLBlacklist(); | 45 virtual ~URLBlacklist(); |
46 | 46 |
47 // Allows or blocks URLs matching one of the filters, depending on |allow|. | 47 // Allows or blocks URLs matching one of the filters, depending on |allow|. |
48 void AddFilters(bool allow, const base::ListValue* filters); | 48 void AddFilters(bool allow, const base::ListValue* filters); |
49 | 49 |
50 // URLs matching one of the |filters| will be blocked. The filter format is | 50 // URLs matching one of the |filters| will be blocked. The filter format is |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 | 226 |
227 // Used to get |weak_ptr_| to self on the IO thread. | 227 // Used to get |weak_ptr_| to self on the IO thread. |
228 base::WeakPtrFactory<URLBlacklistManager> io_weak_ptr_factory_; | 228 base::WeakPtrFactory<URLBlacklistManager> io_weak_ptr_factory_; |
229 | 229 |
230 DISALLOW_COPY_AND_ASSIGN(URLBlacklistManager); | 230 DISALLOW_COPY_AND_ASSIGN(URLBlacklistManager); |
231 }; | 231 }; |
232 | 232 |
233 } // namespace policy | 233 } // namespace policy |
234 | 234 |
235 #endif // COMPONENTS_POLICY_CORE_BROWSER_URL_BLACKLIST_MANAGER_H_ | 235 #endif // COMPONENTS_POLICY_CORE_BROWSER_URL_BLACKLIST_MANAGER_H_ |
OLD | NEW |