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

Unified Diff: extensions/browser/extension_prefs.cc

Issue 1025613003: Fix for ERROR:url_pattern_set.cc(240)] Invalid url pattern: chrome://print/* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes as per review comments. Created 5 years, 9 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/extension_prefs.cc
diff --git a/extensions/browser/extension_prefs.cc b/extensions/browser/extension_prefs.cc
index 87ea7bcffdb2f02ea9e7533792d6e17ea644af20..e503a8583f6dd11a41b5986919faf8c2af6aa4ea 100644
--- a/extensions/browser/extension_prefs.cc
+++ b/extensions/browser/extension_prefs.cc
@@ -563,7 +563,8 @@ bool ExtensionPrefs::ReadPrefAsBooleanAndReturn(
PermissionSet* ExtensionPrefs::ReadPrefAsPermissionSet(
const std::string& extension_id,
const std::string& pref_key) {
- if (!GetExtensionPref(extension_id))
+ const base::DictionaryValue* extensions = GetExtensionPref(extension_id);
not at google - send to devlin 2015/03/30 19:54:09 Hm, would be nice to call GetInstalledExtensionInf
Deepak 2015/04/07 14:25:41 On 2015/03/30 19:54:09, kalman wrote: Done.
+ if (!extensions)
return NULL;
// Retrieve the API permissions. Please refer SetExtensionPrefPermissionSet()
@@ -597,9 +598,17 @@ PermissionSet* ExtensionPrefs::ReadPrefAsPermissionSet(
// Retrieve the scriptable host permissions.
URLPatternSet scriptable_hosts;
- ReadPrefAsURLPatternSet(
- extension_id, JoinPrefs(pref_key, kPrefScriptableHosts),
- &scriptable_hosts, UserScript::ValidUserScriptSchemes());
+ int location_value;
+ int valid_schemes = UserScript::ValidUserScriptSchemes();
+ // Adding CHROMEUI scheme in valid schemes mask if extension is component
+ // extension.
not at google - send to devlin 2015/03/30 19:54:09 This should probably happen in ReadPrefAsURLPatter
Deepak 2015/04/07 14:25:42 On 2015/03/30 19:54:09, kalman wrote: Done.
+ if (extensions->GetInteger(kPrefLocation, &location_value) &&
+ static_cast<Manifest::Location>(location_value) == Manifest::COMPONENT) {
+ valid_schemes |= URLPattern::SCHEME_CHROMEUI;
+ }
+ ReadPrefAsURLPatternSet(extension_id,
+ JoinPrefs(pref_key, kPrefScriptableHosts),
+ &scriptable_hosts, valid_schemes);
return new PermissionSet(
apis, manifest_permissions, explicit_hosts, scriptable_hosts);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698