Chromium Code Reviews| Index: chrome/browser/extensions/permissions_updater.cc |
| diff --git a/chrome/browser/extensions/permissions_updater.cc b/chrome/browser/extensions/permissions_updater.cc |
| index d95f812f68813406144a27be1f73a34871335c27..a78f2c56cd7fc88e769a673bd6b3c92891446153 100644 |
| --- a/chrome/browser/extensions/permissions_updater.cc |
| +++ b/chrome/browser/extensions/permissions_updater.cc |
| @@ -144,9 +144,9 @@ void PermissionsUpdater::GrantActivePermissions(const Extension* extension) { |
| } |
| void PermissionsUpdater::InitializePermissions(const Extension* extension) { |
| + ExtensionPrefs* prefs = ExtensionPrefs::Get(browser_context_); |
| scoped_refptr<const PermissionSet> bounded_active = |
| - GetBoundedActivePermissions(extension, |
| - ExtensionPrefs::Get(browser_context_)); |
| + GetBoundedActivePermissions(extension, prefs); |
| // We withhold permissions iff the switch to do so is enabled, the extension |
| // shows up in chrome:extensions (so the user can grant withheld permissions), |
| @@ -175,6 +175,16 @@ void PermissionsUpdater::InitializePermissions(const Extension* extension) { |
| &granted_scriptable_hosts, |
| &withheld_scriptable_hosts); |
| + // Add in persisted permissions from "Allow All" |
| + URLPatternSet persisted; |
| + prefs->GetPersistedPermissions(extension->id(), &persisted); |
| + for (URLPatternSet::const_iterator iter = persisted.begin(); |
| + iter != persisted.end(); |
| + ++iter) { |
| + granted_scriptable_hosts.AddPattern(*iter); |
| + LOG(WARNING) << "ADDING PATTERN: " << iter->GetAsString(); |
| + } |
|
gpdavis
2014/07/15 21:56:38
Here we retrieve any persisted permissions and add
|
| + |
| bounded_active = new PermissionSet(bounded_active->apis(), |
| bounded_active->manifest_permissions(), |
| granted_explicit_hosts, |