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

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

Issue 6966015: Merge 86164 (Closed) Base URL: svn://svn.chromium.org/chrome/branches/742/src/
Patch Set: Created 9 years, 7 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 | « no previous file | chrome/common/extensions/extension_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/extension.cc
===================================================================
--- chrome/common/extensions/extension.cc (revision 86314)
+++ chrome/common/extensions/extension.cc (working copy)
@@ -2709,6 +2709,13 @@
bool Extension::HasHostPermission(const GURL& url) const {
for (URLPatternList::const_iterator host = host_permissions().begin();
host != host_permissions().end(); ++host) {
+ // Non-component extensions can only access chrome://favicon and no other
+ // chrome:// scheme urls.
+ if (url.SchemeIs(chrome::kChromeUIScheme) &&
+ url.host() != chrome::kChromeUIFaviconHost &&
+ location() != Extension::COMPONENT)
+ return false;
+
if (host->MatchesUrl(url))
return true;
}
@@ -2785,6 +2792,10 @@
return false;
}
+ if (page_url.SchemeIs(chrome::kChromeUIScheme) &&
+ !CanExecuteScriptEverywhere())
+ return false;
+
// If a script is specified, use its matches.
if (script)
return script->MatchesUrl(page_url);
« no previous file with comments | « no previous file | chrome/common/extensions/extension_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698