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

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: Removed unnecessary constructor and added tests for API permissions 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 924412b01af6589ca172cb9745578aba9a6874ff..c0f88e3eaa740d77312498fddb5241300b1dffc4 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;
@@ -215,13 +216,18 @@ class APIPermission {
kHostReadWrite,
kHostsAll,
kHostsAllReadOnly,
+ kMediaGalleriesAllGalleriesCopyTo,
+ kMediaGalleriesAllGalleriesDelete,
+ kMediaGalleriesAllGalleriesRead,
+ kNetworkState,
kOverrideBookmarksUI,
+ kShouldWarnAllHosts,
kSocketAnyHost,
- kSocketDomainHostsSingular,
- kSocketDomainHostsPlural,
- kSocketSpecificHostsSingular,
- kSocketSpecificHostsPlural,
- kNetworkState,
+ kSocketDomainHosts,
+ kSocketSpecificHosts,
+ kUsbDeviceList,
+ kUsbDeviceUnknownProduct,
+ kUsbDeviceUnknownVendor,
kEnumBoundary
};
@@ -244,10 +250,17 @@ class APIPermission {
return info_;
}
+ // The set of permissions this API permission has. These permissions are used
Yoyo Zhou 2014/12/11 00:54:11 I would appreciate more explanation here to clarif
sashab 2014/12/11 04:15:36 Good point, and the main thing to get across here
+ // by PermissionMessageProvider to generate meaningful permission messages
+ // for the app.
+ 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.

Powered by Google App Engine
This is Rietveld 408576698