| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 // http://www.chromium.org/administrators/url-blacklist-filter-format. | 42 // http://www.chromium.org/administrators/url-blacklist-filter-format. |
| 43 void Block(const base::ListValue* filters); | 43 void Block(const base::ListValue* filters); |
| 44 | 44 |
| 45 // URLs matching one of the |filters| will be allowed. If a URL is both | 45 // URLs matching one of the |filters| will be allowed. If a URL is both |
| 46 // Blocked and Allowed, Allow takes precedence. | 46 // Blocked and Allowed, Allow takes precedence. |
| 47 void Allow(const base::ListValue* filters); | 47 void Allow(const base::ListValue* filters); |
| 48 | 48 |
| 49 // Returns true if the URL is blocked. | 49 // Returns true if the URL is blocked. |
| 50 bool IsURLBlocked(const GURL& url) const; | 50 bool IsURLBlocked(const GURL& url) const; |
| 51 | 51 |
| 52 // Returns the number of items in the list. |
| 53 size_t Size() const; |
| 54 |
| 52 // Returns true if the URL has a standard scheme. Only URLs with standard | 55 // Returns true if the URL has a standard scheme. Only URLs with standard |
| 53 // schemes are filtered. | 56 // schemes are filtered. |
| 54 static bool HasStandardScheme(const GURL& url); | 57 static bool HasStandardScheme(const GURL& url); |
| 55 | 58 |
| 56 // Splits a URL filter into its components. A GURL isn't used because these | 59 // Splits a URL filter into its components. A GURL isn't used because these |
| 57 // can be invalid URLs e.g. "google.com". | 60 // can be invalid URLs e.g. "google.com". |
| 58 // Returns false if the URL couldn't be parsed. | 61 // Returns false if the URL couldn't be parsed. |
| 59 // The |host| is preprocessed so it can be passed to URLMatcher for the | 62 // The |host| is preprocessed so it can be passed to URLMatcher for the |
| 60 // appropriate condition. | 63 // appropriate condition. |
| 61 // The optional username and password are ignored. | 64 // The optional username and password are ignored. |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 | 171 |
| 169 // The current blacklist. | 172 // The current blacklist. |
| 170 scoped_ptr<URLBlacklist> blacklist_; | 173 scoped_ptr<URLBlacklist> blacklist_; |
| 171 | 174 |
| 172 DISALLOW_COPY_AND_ASSIGN(URLBlacklistManager); | 175 DISALLOW_COPY_AND_ASSIGN(URLBlacklistManager); |
| 173 }; | 176 }; |
| 174 | 177 |
| 175 } // namespace policy | 178 } // namespace policy |
| 176 | 179 |
| 177 #endif // CHROME_BROWSER_POLICY_URL_BLACKLIST_MANAGER_H_ | 180 #endif // CHROME_BROWSER_POLICY_URL_BLACKLIST_MANAGER_H_ |
| OLD | NEW |