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

Unified Diff: extensions/common/permissions/api_permission.h

Issue 795543002: Added PermissionIDSet to APIPermissions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@permissions_patch_1_static_initializer_fix
Patch Set: Rebase Created 6 years 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: extensions/common/permissions/api_permission.h
diff --git a/extensions/common/permissions/api_permission.h b/extensions/common/permissions/api_permission.h
index 041cfbe9dc0fc58e51ec25d3faef74afb402d1fd..3f4a9fc9405c574a3fd9aad78add0269bf635673 100644
--- a/extensions/common/permissions/api_permission.h
+++ b/extensions/common/permissions/api_permission.h
@@ -21,6 +21,7 @@ class Message;
namespace extensions {
+class PermissionIDSet;
class APIPermissionInfo;
class ChromeAPIPermissions;
@@ -214,13 +215,18 @@ class APIPermission {
kHostReadWrite,
kHostsAll,
kHostsAllReadOnly,
+ kMediaGalleriesAllGalleriesCopyTo,
+ kMediaGalleriesAllGalleriesDelete,
+ kMediaGalleriesAllGalleriesRead,
+ kNetworkState,
kOverrideBookmarksUI,
+ kShouldWarnAllHosts,
kSocketAnyHost,
- kSocketDomainHostsSingular,
- kSocketDomainHostsPlural,
- kSocketSpecificHostsSingular,
- kSocketSpecificHostsPlural,
- kNetworkState,
+ kSocketDomainHosts,
+ kSocketSpecificHosts,
+ kUsbDeviceList,
+ kUsbDeviceUnknownProduct,
+ kUsbDeviceUnknownVendor,
kEnumBoundary
};
@@ -243,10 +249,33 @@ class APIPermission {
return info_;
}
+ // The set of permissions an app/extension with this API permission has. These
+ // permissions are used by PermissionMessageProvider to generate meaningful
+ // permission messages for the app/extension.
+ //
+ // For simple API permissions, this will return a set containing only the ID
+ // of the permission. More complex permissions might have multiple IDs, one
+ // for each of the capabilities the API permission has (e.g. read, write and
+ // copy, in the case of the media gallery permission). Permissions that
+ // require parameters may also contain a parameter string (along with the
+ // permission's ID) which can be substituted into the permission message if a
+ // rule is defined to do so.
+ //
+ // Permissions with multiple values, such as host permissions, are represented
+ // by multiple entries in this set. Each permission in the subset has the same
+ // ID (e.g. kHostReadOnly) but a different parameter (e.g. google.com). These
+ // are grouped to form different kinds of permission messages (e.g. 'Access to
+ // 2 hosts') depending on the number that are in the set. The rules that
+ // define the grouping of related permissions with the same ID is defined in
+ // ChromePermissionMessageProvider.
+ virtual PermissionIDSet GetPermissions() const = 0;
+
// Returns true if this permission has any PermissionMessages.
+ // TODO(sashab): Deprecate this in favor of GetPermissions() above.
virtual bool HasMessages() const = 0;
// Returns the localized permission messages of this permission.
+ // TODO(sashab): Deprecate this in favor of GetPermissions() above.
virtual PermissionMessages GetMessages() const = 0;
// Returns true if the given permission is allowed.
« no previous file with comments | « extensions/common/api/sockets/sockets_manifest_permission.cc ('k') | extensions/common/permissions/api_permission.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698