| 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 | 4 |
| 5 #ifndef CHROME_COMMON_EXTENSIONS_URL_PATTERN_SET_H_ | 5 #ifndef CHROME_COMMON_EXTENSIONS_URL_PATTERN_SET_H_ |
| 6 #define CHROME_COMMON_EXTENSIONS_URL_PATTERN_SET_H_ | 6 #define CHROME_COMMON_EXTENSIONS_URL_PATTERN_SET_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 | 49 |
| 50 void AddPattern(const URLPattern& pattern); | 50 void AddPattern(const URLPattern& pattern); |
| 51 void ClearPatterns(); | 51 void ClearPatterns(); |
| 52 | 52 |
| 53 // Returns true if the permission |set| is a subset of this. | 53 // Returns true if the permission |set| is a subset of this. |
| 54 bool Contains(const URLPatternSet& set) const; | 54 bool Contains(const URLPatternSet& set) const; |
| 55 | 55 |
| 56 // Test if the extent contains a URL. | 56 // Test if the extent contains a URL. |
| 57 bool MatchesURL(const GURL& url) const; | 57 bool MatchesURL(const GURL& url) const; |
| 58 | 58 |
| 59 bool MatchesSecurityOrigin(const GURL& origin) const; |
| 60 |
| 59 // Returns true if there is a single URL that would be in two extents. | 61 // Returns true if there is a single URL that would be in two extents. |
| 60 bool OverlapsWith(const URLPatternSet& other) const; | 62 bool OverlapsWith(const URLPatternSet& other) const; |
| 61 | 63 |
| 62 private: | 64 private: |
| 63 // The list of URL patterns that comprise the extent. | 65 // The list of URL patterns that comprise the extent. |
| 64 std::set<URLPattern> patterns_; | 66 std::set<URLPattern> patterns_; |
| 65 }; | 67 }; |
| 66 | 68 |
| 67 #endif // CHROME_COMMON_EXTENSIONS_URL_PATTERN_SET_H_ | 69 #endif // CHROME_COMMON_EXTENSIONS_URL_PATTERN_SET_H_ |
| OLD | NEW |