diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-25 08:31:43 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-25 08:31:43 +0000 |
commit | 3b76103e0186e3ac2b67373b6f35f81a44d986c8 (patch) | |
tree | c03154bfa6d381f1279d46282009fdd37ac6e4ef /chrome/common/extensions/extension_extent.cc | |
parent | 75709691d97122dbefd7d73ce0cfade557e498b5 (diff) | |
download | chromium_src-3b76103e0186e3ac2b67373b6f35f81a44d986c8.zip chromium_src-3b76103e0186e3ac2b67373b6f35f81a44d986c8.tar.gz chromium_src-3b76103e0186e3ac2b67373b6f35f81a44d986c8.tar.bz2 |
Revert r50834
TBR=tony@chromium.org
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50835 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/extensions/extension_extent.cc')
-rw-r--r-- | chrome/common/extensions/extension_extent.cc | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/chrome/common/extensions/extension_extent.cc b/chrome/common/extensions/extension_extent.cc index b479c5b..f716291 100644 --- a/chrome/common/extensions/extension_extent.cc +++ b/chrome/common/extensions/extension_extent.cc @@ -4,11 +4,24 @@ #include "chrome/common/extensions/extension_extent.h" +#include "base/string_util.h" + bool ExtensionExtent::ContainsURL(const GURL& url) const { - for (PatternList::const_iterator pattern = patterns_.begin(); - pattern != patterns_.end(); ++pattern) { - if (pattern->MatchesUrl(url)) + if (origin_.is_empty() || !url.is_valid()) + return false; + + if (url.GetOrigin() != origin_) + return false; + + if (paths_.empty()) + return true; + + for (size_t i = 0; i < paths_.size(); ++i) { + if (StartsWithASCII(url.path(), + std::string("/") + paths_[i], + false)) { // not case sensitive return true; + } } return false; |