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

Side by Side Diff: chrome/common/extensions/url_pattern_set.h

Issue 8312005: Ignore paths when matching patterns for extensions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 2 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 | Annotate | Revision Log
OLDNEW
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
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 std::string& origin) const;
Aaron Boodman 2011/10/20 06:53:51 Don't forget to add comments before checking this
Aaron Boodman 2011/10/20 06:53:51 GURL& ?
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698