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); |