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

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

Issue 10630021: Modify experimental identity flow to display scope descriptions and details. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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/extension_prefs.cc
diff --git a/chrome/browser/extensions/extension_prefs.cc b/chrome/browser/extensions/extension_prefs.cc
index 93378302def373cecd331cdd8b81de8a2f99dba4..fa33df4b7d52cc4c27fc8a20eb99efa055c018b9 100644
--- a/chrome/browser/extensions/extension_prefs.cc
+++ b/chrome/browser/extensions/extension_prefs.cc
@@ -925,6 +925,24 @@ void ExtensionPrefs::AddGrantedPermissions(
extension_id, kPrefGrantedPermissions, new_perms.get());
}
+void ExtensionPrefs::RemoveGrantedPermissions(
+ const std::string& extension_id,
+ const ExtensionPermissionSet* permissions) {
+ CHECK(Extension::IdIsValid(extension_id));
+
+ scoped_refptr<ExtensionPermissionSet> granted_permissions(
+ GetGrantedPermissions(extension_id));
+
+ // The new granted permissions are the difference of the already granted
+ // permissions and the newly ungranted permissions.
+ scoped_refptr<ExtensionPermissionSet> new_perms(
+ ExtensionPermissionSet::CreateDifference(
+ granted_permissions.get(), permissions));
+
+ SetExtensionPrefPermissionSet(
+ extension_id, kPrefGrantedPermissions, new_perms.get());
+}
+
ExtensionPermissionSet* ExtensionPrefs::GetActivePermissions(
const std::string& extension_id) {
CHECK(Extension::IdIsValid(extension_id));

Powered by Google App Engine
This is Rietveld 408576698