| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 URLPatternSet(); | 43 URLPatternSet(); |
| 44 URLPatternSet(const URLPatternSet& rhs); | 44 URLPatternSet(const URLPatternSet& rhs); |
| 45 explicit URLPatternSet(const std::set<URLPattern>& patterns); | 45 explicit URLPatternSet(const std::set<URLPattern>& patterns); |
| 46 ~URLPatternSet(); | 46 ~URLPatternSet(); |
| 47 | 47 |
| 48 URLPatternSet& operator=(const URLPatternSet& rhs); | 48 URLPatternSet& operator=(const URLPatternSet& rhs); |
| 49 bool operator==(const URLPatternSet& rhs) const; | 49 bool operator==(const URLPatternSet& rhs) const; |
| 50 | 50 |
| 51 bool is_empty() const; | 51 bool is_empty() const; |
| 52 size_t size() const; |
| 52 const std::set<URLPattern>& patterns() const { return patterns_; } | 53 const std::set<URLPattern>& patterns() const { return patterns_; } |
| 53 const_iterator begin() const { return patterns_.begin(); } | 54 const_iterator begin() const { return patterns_.begin(); } |
| 54 const_iterator end() const { return patterns_.end(); } | 55 const_iterator end() const { return patterns_.end(); } |
| 55 | 56 |
| 56 void AddPattern(const URLPattern& pattern); | 57 void AddPattern(const URLPattern& pattern); |
| 57 void ClearPatterns(); | 58 void ClearPatterns(); |
| 58 | 59 |
| 59 // Returns true if the permission |set| is a subset of this. | 60 // Returns true if the permission |set| is a subset of this. |
| 60 bool Contains(const URLPatternSet& set) const; | 61 bool Contains(const URLPatternSet& set) const; |
| 61 | 62 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 73 int valid_schemes, | 74 int valid_schemes, |
| 74 bool allow_file_access, | 75 bool allow_file_access, |
| 75 std::string* error); | 76 std::string* error); |
| 76 | 77 |
| 77 private: | 78 private: |
| 78 // The list of URL patterns that comprise the extent. | 79 // The list of URL patterns that comprise the extent. |
| 79 std::set<URLPattern> patterns_; | 80 std::set<URLPattern> patterns_; |
| 80 }; | 81 }; |
| 81 | 82 |
| 82 #endif // CHROME_COMMON_EXTENSIONS_URL_PATTERN_SET_H_ | 83 #endif // CHROME_COMMON_EXTENSIONS_URL_PATTERN_SET_H_ |
| OLD | NEW |