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; |
+} |