Index: chrome/common/extensions/extension.cc |
diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc |
index df59fa14daba87c545febdd898a1258a8318bd7f..2566d41f2219c8678b893afd7dc52b2d55b8576f 100644 |
--- a/chrome/common/extensions/extension.cc |
+++ b/chrome/common/extensions/extension.cc |
@@ -982,6 +982,10 @@ bool Extension::InitFromValue(const DictionaryValue& source, bool require_id, |
return false; |
} |
+ // The path component is not used for host permissions, so we force it to |
Erik does not do reviews
2009/09/10 18:23:21
I guess this means we can wind up with multiple du
Aaron Boodman
2009/09/10 18:55:31
Actually the permissions are kept in a vector now,
|
+ // match all paths. |
+ pattern.set_path("/*"); |
+ |
host_permissions_.push_back(pattern); |
} |
} |
@@ -1087,6 +1091,16 @@ FilePath Extension::GetIconPath(Icons icon) { |
return GetResourcePath(iter->second); |
} |
+bool Extension::CanAccessHost(const GURL& url) const { |
+ for (HostPermissions::const_iterator host = host_permissions_.begin(); |
+ host != host_permissions_.end(); ++host) { |
+ if (host->MatchesUrl(url)) |
+ return true; |
+ } |
+ |
+ return false; |
+} |
+ |
const std::set<std::string> Extension::GetEffectiveHostPermissions() const { |
std::set<std::string> effective_hosts; |