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

Unified Diff: extensions/common/permissions/permissions_data.cc

Issue 2821123002: Differentiate new permissions from old in extension permission update bubble (Closed)
Patch Set: Git rebase master Created 3 years, 8 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
« no previous file with comments | « extensions/common/permissions/permissions_data.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/permissions/permissions_data.cc
diff --git a/extensions/common/permissions/permissions_data.cc b/extensions/common/permissions/permissions_data.cc
index fb9cecb1cbca59ccb2fa73487ad004ce8018f44d..2002b2946108b2c9e4ef0f28854a53e3cbf7abe9 100644
--- a/extensions/common/permissions/permissions_data.cc
+++ b/extensions/common/permissions/permissions_data.cc
@@ -297,6 +297,19 @@ PermissionMessages PermissionsData::GetPermissionMessages() const {
*active_permissions_unsafe_, manifest_type_));
}
+PermissionMessages PermissionsData::GetNewPermissionMessages(
+ const PermissionSet& granted_permissions) const {
+ base::AutoLock auto_lock(runtime_lock_);
+
+ std::unique_ptr<const PermissionSet> new_permissions =
+ PermissionSet::CreateDifference(*active_permissions_unsafe_,
+ granted_permissions);
+
+ return PermissionMessageProvider::Get()->GetPermissionMessages(
+ PermissionMessageProvider::Get()->GetAllPermissionIDs(*new_permissions,
+ manifest_type_));
+}
+
bool PermissionsData::HasWithheldImpliedAllHosts() const {
base::AutoLock auto_lock(runtime_lock_);
// Since we currently only withhold all_hosts, it's sufficient to check
« no previous file with comments | « extensions/common/permissions/permissions_data.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698