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

Unified Diff: chrome/common/extensions/permissions/permission_set.h

Issue 18399007: Don't count host permission changes for v2 apps as a permission increase. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 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/common/extensions/permissions/permission_set.h
diff --git a/chrome/common/extensions/permissions/permission_set.h b/chrome/common/extensions/permissions/permission_set.h
index 3de9287e8cafdf69a2b2bd0dd12ccd64b9f562be..efecbf48df68bc75dcb09fdacfc625239482475f 100644
--- a/chrome/common/extensions/permissions/permission_set.h
+++ b/chrome/common/extensions/permissions/permission_set.h
@@ -126,7 +126,9 @@ class PermissionSet
// Returns true if |permissions| has a greater privilege level than this
// permission set (e.g., this permission set has less permissions).
- bool HasLessPrivilegesThan(const PermissionSet* permissions) const;
+ // Whether certain permissions are considered varies by extension type.
+ bool HasLessPrivilegesThan(const PermissionSet* permissions,
+ Manifest::Type extension_type) const;
const APIPermissionSet& apis() const { return apis_; }
@@ -166,17 +168,20 @@ class PermissionSet
void InitEffectiveHosts();
// Gets the permission messages for the API permissions.
- std::set<PermissionMessage> GetSimplePermissionMessages() const;
+ std::set<PermissionMessage> GetAPIPermissionMessages() const;
+
+ // Gets the permission messages for the host permissions.
+ std::set<PermissionMessage> GetHostPermissionMessages(
+ Manifest::Type extension_type) const;
// Returns true if |permissions| has an elevated API privilege level than
// this set.
- bool HasLessAPIPrivilegesThan(
- const PermissionSet* permissions) const;
+ bool HasLessAPIPrivilegesThan(const PermissionSet* permissions) const;
// Returns true if |permissions| has more host permissions compared to this
// set.
- bool HasLessHostPrivilegesThan(
- const PermissionSet* permissions) const;
+ bool HasLessHostPrivilegesThan(const PermissionSet* permissions,
+ Manifest::Type extension_type) const;
// Gets a list of the distinct hosts for displaying to the user.
// NOTE: do not use this for comparing permissions, since this disgards some
« no previous file with comments | « chrome/browser/extensions/extension_service.cc ('k') | chrome/common/extensions/permissions/permission_set.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698