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

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

Issue 199074: Don't allow updating tabs to javascript URLs without host (Closed)
Patch Set: Remove unchanged file Created 11 years, 3 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
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;

Powered by Google App Engine
This is Rietveld 408576698