Chromium Code Reviews| Index: chrome/browser/extensions/extension_util.cc |
| diff --git a/chrome/browser/extensions/extension_util.cc b/chrome/browser/extensions/extension_util.cc |
| index 6b27885445973a01fb41f875222c267a0e1e99c6..8d3d924f0811411bbbb612622bda9cfe7fdf3efa 100644 |
| --- a/chrome/browser/extensions/extension_util.cc |
| +++ b/chrome/browser/extensions/extension_util.cc |
| @@ -24,6 +24,7 @@ |
| #include "extensions/common/features/simple_feature.h" |
| #include "extensions/common/manifest.h" |
| #include "extensions/common/manifest_handlers/incognito_info.h" |
| +#include "extensions/common/permissions/permissions_data.h" |
| #include "grit/theme_resources.h" |
| #include "ui/base/resource/resource_bundle.h" |
| @@ -183,10 +184,23 @@ bool AllowedScriptingOnAllUrls(const std::string& extension_id, |
| void SetAllowedScriptingOnAllUrls(const std::string& extension_id, |
| content::BrowserContext* context, |
| bool allowed) { |
| + if (allowed == AllowedScriptingOnAllUrls(extension_id, context)) |
| + return; // Nothing to do here. |
| + |
| ExtensionPrefs::Get(context)->UpdateExtensionPref( |
| extension_id, |
| kExtensionAllowedOnAllUrlsPrefName, |
| allowed ? new base::FundamentalValue(true) : NULL); |
| + |
| + const Extension* extension = |
| + ExtensionRegistry::Get(context)->enabled_extensions().GetByID( |
| + extension_id); |
| + if (extension) { |
| + if (allowed) |
| + extension->permissions_data()->GrantWithheldAllHosts(); |
|
not at google - send to devlin
2014/06/30 14:37:03
- what about on browser startup (I can't see an ob
Devlin
2014/06/30 17:06:10
Whoops. Had that in there at some point, but it m
|
| + else |
| + extension->permissions_data()->WithholdAllHosts(); |
| + } |
| } |
| bool IsAppLaunchable(const std::string& extension_id, |