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

Unified Diff: chrome/common/extensions/extension_extent.cc

Issue 2876009: Re-implement app overlap detection with new extent syntax. (Closed) Base URL: git://codf21.jail/chromium.git
Patch Set: donk Created 10 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/extensions/extension_extent.h ('k') | chrome/common/extensions/extension_extent_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/extension_extent.cc
diff --git a/chrome/common/extensions/extension_extent.cc b/chrome/common/extensions/extension_extent.cc
index b479c5b1c3f3aee4cf1e5e59aeec90490891d943..fe670b69fef3d8e70b71aa15fdccfb5d089bafe9 100644
--- a/chrome/common/extensions/extension_extent.cc
+++ b/chrome/common/extensions/extension_extent.cc
@@ -13,3 +13,18 @@ bool ExtensionExtent::ContainsURL(const GURL& url) const {
return false;
}
+
+bool ExtensionExtent::OverlapsWith(const ExtensionExtent& other) const {
+ // Two extension extents overlap if there is any one URL that would match at
+ // least one pattern in each of the extents.
+ for (PatternList::const_iterator i = patterns_.begin();
+ i != patterns_.end(); ++i) {
+ for (PatternList::const_iterator j = other.patterns().begin();
+ j != other.patterns().end(); ++j) {
+ if (i->OverlapsWith(*j))
+ return true;
+ }
+ }
+
+ return false;
+}
« no previous file with comments | « chrome/common/extensions/extension_extent.h ('k') | chrome/common/extensions/extension_extent_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698