summaryrefslogtreecommitdiffstats
path: root/chrome/common/extensions/extension_extent.cc
diff options
context:
space:
mode:
authoraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-25 07:50:11 +0000
committeraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-25 07:50:11 +0000
commit75709691d97122dbefd7d73ce0cfade557e498b5 (patch)
treef79b37918e4c345a21036a11d5d7c6520e118ab6 /chrome/common/extensions/extension_extent.cc
parent5ed550d5336a5c159adf5dd319a62d13d01c0eed (diff)
downloadchromium_src-75709691d97122dbefd7d73ce0cfade557e498b5.zip
chromium_src-75709691d97122dbefd7d73ce0cfade557e498b5.tar.gz
chromium_src-75709691d97122dbefd7d73ce0cfade557e498b5.tar.bz2
Allow multiple domains in app.
Subsequent changes will: * Allow URLPatterns to specify * for scheme, so that http/https doesn't need to be repeated for each host. * Fix the overlap detection. Suggested review order: - test files - url_pattern* - extension_extent* - extension* - everything else BUG=46633 Review URL: http://codereview.chromium.org/2876007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50834 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/extensions/extension_extent.cc')
-rw-r--r--chrome/common/extensions/extension_extent.cc19
1 files changed, 3 insertions, 16 deletions
diff --git a/chrome/common/extensions/extension_extent.cc b/chrome/common/extensions/extension_extent.cc
index f716291..b479c5b 100644
--- a/chrome/common/extensions/extension_extent.cc
+++ b/chrome/common/extensions/extension_extent.cc
@@ -4,24 +4,11 @@
#include "chrome/common/extensions/extension_extent.h"
-#include "base/string_util.h"
-
bool ExtensionExtent::ContainsURL(const GURL& url) const {
- 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
+ for (PatternList::const_iterator pattern = patterns_.begin();
+ pattern != patterns_.end(); ++pattern) {
+ if (pattern->MatchesUrl(url))
return true;
- }
}
return false;