| 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..816311244f05d5ba5d90ca84f596d2b41ea073ad 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 persisted permissions to granted_scriptable_hosts.
|
| + URLPatternSet persisted;
|
| + if (prefs->GetPersistedPermissions(extension->id(), &persisted)) {
|
| + for (URLPatternSet::const_iterator iter = persisted.begin();
|
| + iter != persisted.end();
|
| + ++iter) {
|
| + granted_scriptable_hosts.AddPattern(*iter);
|
| + }
|
| + }
|
| +
|
| bounded_active = new PermissionSet(bounded_active->apis(),
|
| bounded_active->manifest_permissions(),
|
| granted_explicit_hosts,
|
|
|