Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(179)

Unified Diff: chrome/browser/extensions/permissions_updater.cc

Issue 396033002: Support "always allow" for runtime script execution (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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,

Powered by Google App Engine
This is Rietveld 408576698