Index: chrome/browser/extensions/permissions_updater.cc |
diff --git a/chrome/browser/extensions/permissions_updater.cc b/chrome/browser/extensions/permissions_updater.cc |
index 385d5e9b95e7f2518a93e6dd8da62308792ad452..d4d42b5d91fc2ddaeeaba0571a55c6f04aa68b13 100644 |
--- a/chrome/browser/extensions/permissions_updater.cc |
+++ b/chrome/browser/extensions/permissions_updater.cc |
@@ -164,11 +164,23 @@ void PermissionsUpdater::GrantActivePermissions(const Extension* extension) { |
} |
void PermissionsUpdater::InitializePermissions(const Extension* extension) { |
- scoped_refptr<const PermissionSet> active_permissions = |
- ExtensionPrefs::Get(browser_context_) |
- ->GetActivePermissions(extension->id()); |
- scoped_refptr<const PermissionSet> bounded_active = |
- GetBoundedActivePermissions(extension, active_permissions); |
+ InitializePermissions(extension, INIT_FLAG_NONE); |
+} |
+ |
+void PermissionsUpdater::InitializePermissions(const Extension* extension, |
+ InitFlag init_flag) { |
+ scoped_refptr<const PermissionSet> active_permissions(NULL); |
+ scoped_refptr<const PermissionSet> bounded_active(NULL); |
+ // If |extension| is a transient dummy extension, we do not want to look for |
+ // it in preferences. |
+ if (init_flag & INIT_FLAG_TRANSIENT) { |
+ bounded_active = active_permissions = |
+ extension->permissions_data()->active_permissions(); |
+ } else { |
+ active_permissions = ExtensionPrefs::Get(browser_context_) |
+ ->GetActivePermissions(extension->id()); |
+ bounded_active = GetBoundedActivePermissions(extension, active_permissions); |
+ } |
// Withhold permissions only if the switch applies to this extension and the |
// extension doesn't have the preference to allow scripting on all urls. |