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

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

Issue 5626004: Update valid URLPattern schemes in ExtensionPrefs::GetGrantedPermissions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove kValidWebExtentSchemes from GetGrantedPermissions Created 10 years 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.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/extension.cc
diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc
index c3b44198ef633361ddf2faaa8486f1611e273f3c..f83202c91479d6ff02ee665eecbd99c2d37f95cf 100644
--- a/chrome/common/extensions/extension.cc
+++ b/chrome/common/extensions/extension.cc
@@ -250,6 +250,10 @@ const char Extension::kOldUnlimitedStoragePermission[] = "unlimited_storage";
const int Extension::kValidWebExtentSchemes =
URLPattern::SCHEME_HTTP | URLPattern::SCHEME_HTTPS;
+const int Extension::kValidHostPermissionSchemes =
+ (UserScript::kValidUserScriptSchemes |
+ URLPattern::SCHEME_CHROMEUI) & ~URLPattern::SCHEME_FILE;
+
//
// Extension
//
@@ -1741,9 +1745,8 @@ bool Extension::InitFromValue(const DictionaryValue& source, bool require_key,
// Check if it's a host pattern permission.
URLPattern pattern = URLPattern(CanExecuteScriptEverywhere() ?
- URLPattern::SCHEME_ALL :
- (UserScript::kValidUserScriptSchemes |
- URLPattern::SCHEME_CHROMEUI) & ~URLPattern::SCHEME_FILE);
+ URLPattern::SCHEME_ALL : kValidHostPermissionSchemes);
+
if (URLPattern::PARSE_SUCCESS == pattern.Parse(permission_str)) {
if (!CanSpecifyHostPermission(pattern)) {
« no previous file with comments | « chrome/common/extensions/extension.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698