OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 14 matching lines...) Expand all Loading... |
25 | 25 |
26 // Contains a set of filters to block and allow certain URLs, and matches GURLs | 26 // Contains a set of filters to block and allow certain URLs, and matches GURLs |
27 // against this set. The filters are currently kept in memory. | 27 // against this set. The filters are currently kept in memory. |
28 class URLBlacklist { | 28 class URLBlacklist { |
29 public: | 29 public: |
30 // A constant mapped to a scheme that can be filtered. | 30 // A constant mapped to a scheme that can be filtered. |
31 enum SchemeFlag { | 31 enum SchemeFlag { |
32 SCHEME_HTTP = 1 << 0, | 32 SCHEME_HTTP = 1 << 0, |
33 SCHEME_HTTPS = 1 << 1, | 33 SCHEME_HTTPS = 1 << 1, |
34 SCHEME_FTP = 1 << 2, | 34 SCHEME_FTP = 1 << 2, |
| 35 SCHEME_WS = 1 << 3, |
| 36 SCHEME_WSS = 1 << 4, |
35 | 37 |
36 SCHEME_ALL = (1 << 3) - 1, | 38 SCHEME_ALL = (1 << 5) - 1, |
37 }; | 39 }; |
38 | 40 |
39 URLBlacklist(); | 41 URLBlacklist(); |
40 virtual ~URLBlacklist(); | 42 virtual ~URLBlacklist(); |
41 | 43 |
42 // URLs matching |filter| will be blocked. The filter format is documented | 44 // URLs matching |filter| will be blocked. The filter format is documented |
43 // at http://www.chromium.org/administrators/url-blacklist-filter-format | 45 // at http://www.chromium.org/administrators/url-blacklist-filter-format |
44 void Block(const std::string& filter); | 46 void Block(const std::string& filter); |
45 | 47 |
46 // URLs matching |filter| will be allowed. If |filter| is both Blocked and | 48 // URLs matching |filter| will be allowed. If |filter| is both Blocked and |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 | 156 |
155 // The current blacklist. | 157 // The current blacklist. |
156 scoped_ptr<URLBlacklist> blacklist_; | 158 scoped_ptr<URLBlacklist> blacklist_; |
157 | 159 |
158 DISALLOW_COPY_AND_ASSIGN(URLBlacklistManager); | 160 DISALLOW_COPY_AND_ASSIGN(URLBlacklistManager); |
159 }; | 161 }; |
160 | 162 |
161 } // namespace policy | 163 } // namespace policy |
162 | 164 |
163 #endif // CHROME_BROWSER_POLICY_URL_BLACKLIST_MANAGER_H_ | 165 #endif // CHROME_BROWSER_POLICY_URL_BLACKLIST_MANAGER_H_ |
OLD | NEW |