diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-25 10:01:05 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-25 10:01:05 +0000 |
commit | 9f72aa09129fbd19a5ae253371019752a0624997 (patch) | |
tree | 6c54d2280ebdf31fe31f46fd3d882977324e4f3d /chrome/common/extensions/extension_extent.h | |
parent | 0a73a37731cf87370cb7c4f8dcb4801277c1d858 (diff) | |
download | chromium_src-9f72aa09129fbd19a5ae253371019752a0624997.zip chromium_src-9f72aa09129fbd19a5ae253371019752a0624997.tar.gz chromium_src-9f72aa09129fbd19a5ae253371019752a0624997.tar.bz2 |
Reland r50834
TBR=tony@chromium.org
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50837 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/extensions/extension_extent.h')
-rw-r--r-- | chrome/common/extensions/extension_extent.h | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/chrome/common/extensions/extension_extent.h b/chrome/common/extensions/extension_extent.h index 187303d..df8d02d 100644 --- a/chrome/common/extensions/extension_extent.h +++ b/chrome/common/extensions/extension_extent.h @@ -8,27 +8,25 @@ #include <string> #include <vector> +#include "chrome/common/extensions/url_pattern.h" #include "googleurl/src/gurl.h" // Represents the set of URLs an extension uses for web content. class ExtensionExtent { public: - const std::vector<std::string>& paths() const { return paths_; } - void add_path(const std::string& val) { paths_.push_back(val); } - void clear_paths() { paths_.clear(); } + typedef std::vector<URLPattern> PatternList; - const GURL& origin() const { return origin_; } - void set_origin(const GURL& val) { origin_ = val; } + bool is_empty() const { return patterns_.empty(); } + + const PatternList& patterns() const { return patterns_; } + void AddPattern(const URLPattern& pattern) { patterns_.push_back(pattern); } + void ClearPaths() { patterns_.clear(); } bool ContainsURL(const GURL& url) const; private: - // The security origin (scheme+host+port) of the extent. - GURL origin_; - - // A set of path prefixes that further restrict the set of valid URLs below - // origin_. This may be empty. - std::vector<std::string> paths_; + // The list of URL patterns that comprise the extent. + PatternList patterns_; }; #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_EXTENT_H_ |