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 #ifndef CHROME_COMMON_EXTENSIONS_URL_PATTERN_H_ | 4 #ifndef CHROME_COMMON_EXTENSIONS_URL_PATTERN_H_ |
5 #define CHROME_COMMON_EXTENSIONS_URL_PATTERN_H_ | 5 #define CHROME_COMMON_EXTENSIONS_URL_PATTERN_H_ |
6 #pragma once | 6 #pragma once |
7 | 7 |
8 #include <functional> | 8 #include <functional> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 // absolutely need the exact scheme. This is exposed for testing. | 184 // absolutely need the exact scheme. This is exposed for testing. |
185 const std::string& scheme() const { return scheme_; } | 185 const std::string& scheme() const { return scheme_; } |
186 | 186 |
187 // Returns true if the specified scheme can be used in this URL pattern, and | 187 // Returns true if the specified scheme can be used in this URL pattern, and |
188 // false otherwise. Uses valid_schemes_ to determine validity. | 188 // false otherwise. Uses valid_schemes_ to determine validity. |
189 bool IsValidScheme(const std::string& scheme) const; | 189 bool IsValidScheme(const std::string& scheme) const; |
190 | 190 |
191 // Returns true if this instance matches the specified URL. | 191 // Returns true if this instance matches the specified URL. |
192 bool MatchesURL(const GURL& test) const; | 192 bool MatchesURL(const GURL& test) const; |
193 | 193 |
| 194 bool MatchesSecurityOrigin(const GURL& test) const; |
| 195 |
194 // Returns true if |test| matches our scheme. | 196 // Returns true if |test| matches our scheme. |
195 bool MatchesScheme(const std::string& test) const; | 197 bool MatchesScheme(const std::string& test) const; |
196 | 198 |
197 // Returns true if |test| matches our host. | 199 // Returns true if |test| matches our host. |
198 bool MatchesHost(const std::string& test) const; | 200 bool MatchesHost(const std::string& test) const; |
199 bool MatchesHost(const GURL& test) const; | 201 bool MatchesHost(const GURL& test) const; |
200 | 202 |
201 // Returns true if |test| matches our path. | 203 // Returns true if |test| matches our path. |
202 bool MatchesPath(const std::string& test) const; | 204 bool MatchesPath(const std::string& test) const; |
203 | 205 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 // MatchPattern() function. | 280 // MatchPattern() function. |
279 std::string path_escaped_; | 281 std::string path_escaped_; |
280 | 282 |
281 // A string representing this URLPattern. | 283 // A string representing this URLPattern. |
282 mutable std::string spec_; | 284 mutable std::string spec_; |
283 }; | 285 }; |
284 | 286 |
285 typedef std::vector<URLPattern> URLPatternList; | 287 typedef std::vector<URLPattern> URLPatternList; |
286 | 288 |
287 #endif // CHROME_COMMON_EXTENSIONS_URL_PATTERN_H_ | 289 #endif // CHROME_COMMON_EXTENSIONS_URL_PATTERN_H_ |
OLD | NEW |