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 // Patterns used in content setting rules. | 5 // Patterns used in content setting rules. |
6 | 6 |
7 #ifndef COMPONENTS_CONTENT_SETTINGS_CORE_COMMON_CONTENT_SETTINGS_PATTERN_H_ | 7 #ifndef COMPONENTS_CONTENT_SETTINGS_CORE_COMMON_CONTENT_SETTINGS_PATTERN_H_ |
8 #define COMPONENTS_CONTENT_SETTINGS_CORE_COMMON_CONTENT_SETTINGS_PATTERN_H_ | 8 #define COMPONENTS_CONTENT_SETTINGS_CORE_COMMON_CONTENT_SETTINGS_PATTERN_H_ |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 | 187 |
188 // True if this pattern matches all hosts (i.e. it has a host wildcard). | 188 // True if this pattern matches all hosts (i.e. it has a host wildcard). |
189 bool MatchesAllHosts() const; | 189 bool MatchesAllHosts() const; |
190 | 190 |
191 // Returns a std::string representation of this pattern. | 191 // Returns a std::string representation of this pattern. |
192 std::string ToString() const; | 192 std::string ToString() const; |
193 | 193 |
194 // Returns scheme type of pattern. | 194 // Returns scheme type of pattern. |
195 ContentSettingsPattern::SchemeType GetScheme() const; | 195 ContentSettingsPattern::SchemeType GetScheme() const; |
196 | 196 |
| 197 // True if this pattern has a non-empty path. Can only be used for patterns |
| 198 // with file: schemes. |
| 199 bool HasPath() const; |
| 200 |
197 // Compares the pattern with a given |other| pattern and returns the | 201 // Compares the pattern with a given |other| pattern and returns the |
198 // |Relation| of the two patterns. | 202 // |Relation| of the two patterns. |
199 Relation Compare(const ContentSettingsPattern& other) const; | 203 Relation Compare(const ContentSettingsPattern& other) const; |
200 | 204 |
201 // Returns true if the pattern and the |other| pattern are identical. | 205 // Returns true if the pattern and the |other| pattern are identical. |
202 bool operator==(const ContentSettingsPattern& other) const; | 206 bool operator==(const ContentSettingsPattern& other) const; |
203 | 207 |
204 // Returns true if the pattern and the |other| pattern are not identical. | 208 // Returns true if the pattern and the |other| pattern are not identical. |
205 bool operator!=(const ContentSettingsPattern& other) const; | 209 bool operator!=(const ContentSettingsPattern& other) const; |
206 | 210 |
(...skipping 27 matching lines...) Expand all Loading... |
234 const ContentSettingsPattern::PatternParts& other_parts); | 238 const ContentSettingsPattern::PatternParts& other_parts); |
235 | 239 |
236 ContentSettingsPattern(const PatternParts& parts, bool valid); | 240 ContentSettingsPattern(const PatternParts& parts, bool valid); |
237 | 241 |
238 PatternParts parts_; | 242 PatternParts parts_; |
239 | 243 |
240 bool is_valid_; | 244 bool is_valid_; |
241 }; | 245 }; |
242 | 246 |
243 #endif // COMPONENTS_CONTENT_SETTINGS_CORE_COMMON_CONTENT_SETTINGS_PATTERN_H_ | 247 #endif // COMPONENTS_CONTENT_SETTINGS_CORE_COMMON_CONTENT_SETTINGS_PATTERN_H_ |
OLD | NEW |