Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(148)

Side by Side Diff: components/content_settings/core/common/content_settings_pattern.h

Issue 1767423002: [Do not commit] Track revocations in content_settings::Observer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 160
161 // True if this is a valid pattern. 161 // True if this is a valid pattern.
162 bool IsValid() const { return is_valid_; } 162 bool IsValid() const { return is_valid_; }
163 163
164 // True if |url| matches this pattern. 164 // True if |url| matches this pattern.
165 bool Matches(const GURL& url) const; 165 bool Matches(const GURL& url) const;
166 166
167 // True if this pattern matches all hosts (i.e. it has a host wildcard). 167 // True if this pattern matches all hosts (i.e. it has a host wildcard).
168 bool MatchesAllHosts() const; 168 bool MatchesAllHosts() const;
169 169
170 // True if this pattern has no wildcards (and therefore matches exactly one
171 // host).
172 bool HasNoWildcard() const;
173
170 // Returns a std::string representation of this pattern. 174 // Returns a std::string representation of this pattern.
171 std::string ToString() const; 175 std::string ToString() const;
172 176
173 // Compares the pattern with a given |other| pattern and returns the 177 // Compares the pattern with a given |other| pattern and returns the
174 // |Relation| of the two patterns. 178 // |Relation| of the two patterns.
175 Relation Compare(const ContentSettingsPattern& other) const; 179 Relation Compare(const ContentSettingsPattern& other) const;
176 180
177 // Returns true if the pattern and the |other| pattern are identical. 181 // Returns true if the pattern and the |other| pattern are identical.
178 bool operator==(const ContentSettingsPattern& other) const; 182 bool operator==(const ContentSettingsPattern& other) const;
179 183
(...skipping 30 matching lines...) Expand all
210 const ContentSettingsPattern::PatternParts& other_parts); 214 const ContentSettingsPattern::PatternParts& other_parts);
211 215
212 ContentSettingsPattern(const PatternParts& parts, bool valid); 216 ContentSettingsPattern(const PatternParts& parts, bool valid);
213 217
214 PatternParts parts_; 218 PatternParts parts_;
215 219
216 bool is_valid_; 220 bool is_valid_;
217 }; 221 };
218 222
219 #endif // COMPONENTS_CONTENT_SETTINGS_CORE_COMMON_CONTENT_SETTINGS_PATTERN_H_ 223 #endif // COMPONENTS_CONTENT_SETTINGS_CORE_COMMON_CONTENT_SETTINGS_PATTERN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698