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 <memory> |
10 #include <string> | 11 #include <string> |
11 | 12 |
12 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
13 #include "mojo/public/cpp/bindings/struct_traits.h" | 14 #include "mojo/public/cpp/bindings/struct_traits.h" |
14 | 15 |
15 class GURL; | 16 class GURL; |
16 | 17 |
17 namespace content_settings { | 18 namespace content_settings { |
18 class PatternParser; | 19 class PatternParser; |
19 | 20 |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 | 130 |
130 virtual BuilderInterface* WithPathWildcard() = 0; | 131 virtual BuilderInterface* WithPathWildcard() = 0; |
131 | 132 |
132 virtual BuilderInterface* Invalid() = 0; | 133 virtual BuilderInterface* Invalid() = 0; |
133 | 134 |
134 // Returns a content settings pattern according to the current configuration | 135 // Returns a content settings pattern according to the current configuration |
135 // of the builder. | 136 // of the builder. |
136 virtual ContentSettingsPattern Build() = 0; | 137 virtual ContentSettingsPattern Build() = 0; |
137 }; | 138 }; |
138 | 139 |
139 static BuilderInterface* CreateBuilder(bool use_legacy_validate); | 140 static std::unique_ptr<BuilderInterface> CreateBuilder(); |
140 | 141 |
141 // The version of the pattern format implemented. | 142 // The version of the pattern format implemented. |
142 static const int kContentSettingsPatternVersion; | 143 static const int kContentSettingsPatternVersion; |
143 | 144 |
144 // Returns a wildcard content settings pattern that matches all possible valid | 145 // Returns a wildcard content settings pattern that matches all possible valid |
145 // origins. | 146 // origins. |
146 static ContentSettingsPattern Wildcard(); | 147 static ContentSettingsPattern Wildcard(); |
147 | 148 |
148 // Returns a pattern that matches the scheme and host of this URL, as well as | 149 // Returns a pattern that matches the scheme and host of this URL, as well as |
149 // all subdomains and ports. | 150 // all subdomains and ports. |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 const ContentSettingsPattern::PatternParts& other_parts); | 246 const ContentSettingsPattern::PatternParts& other_parts); |
246 | 247 |
247 ContentSettingsPattern(const PatternParts& parts, bool valid); | 248 ContentSettingsPattern(const PatternParts& parts, bool valid); |
248 | 249 |
249 PatternParts parts_; | 250 PatternParts parts_; |
250 | 251 |
251 bool is_valid_; | 252 bool is_valid_; |
252 }; | 253 }; |
253 | 254 |
254 #endif // COMPONENTS_CONTENT_SETTINGS_CORE_COMMON_CONTENT_SETTINGS_PATTERN_H_ | 255 #endif // COMPONENTS_CONTENT_SETTINGS_CORE_COMMON_CONTENT_SETTINGS_PATTERN_H_ |
OLD | NEW |