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

Side by Side Diff: extensions/common/permissions/permissions_provider.h

Issue 2379763003: Extract permission alias info from PermissionsProvider (Closed)
Patch Set: . Created 4 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef EXTENSIONS_COMMON_PERMISSIONS_PERMISSIONS_PROVIDER_H_ 5 #ifndef EXTENSIONS_COMMON_PERMISSIONS_PERMISSIONS_PROVIDER_H_
6 #define EXTENSIONS_COMMON_PERMISSIONS_PERMISSIONS_PROVIDER_H_ 6 #define EXTENSIONS_COMMON_PERMISSIONS_PERMISSIONS_PROVIDER_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <vector> 9 #include <vector>
10 10
11 namespace extensions { 11 namespace extensions {
12 12
13 class APIPermissionInfo; 13 class APIPermissionInfo;
14 14
15 // The PermissionsProvider creates APIPermissions instances. It is only 15 // The PermissionsProvider creates APIPermissions instances. It is only
16 // needed at startup time. Typically, ExtensionsClient will register 16 // needed at startup time. Typically, ExtensionsClient will register
17 // its PermissionsProviders with the global PermissionsInfo at startup. 17 // its PermissionsProviders with the global PermissionsInfo at startup.
18 // TODO(sashab): Remove all permission messages from this class, moving the 18 // TODO(sashab): Remove all permission messages from this class, moving the
19 // permission message rules into ChromePermissionMessageProvider. 19 // permission message rules into ChromePermissionMessageProvider.
20 class PermissionsProvider { 20 class PermissionsProvider {
21 public: 21 public:
22 // An alias for a given permission |name|.
23 struct AliasInfo {
24 const char* name;
25 const char* alias;
26
27 AliasInfo(const char* name, const char* alias)
28 : name(name), alias(alias) {
29 }
30 };
31 // Returns all the known permissions. 22 // Returns all the known permissions.
32 virtual std::vector<std::unique_ptr<APIPermissionInfo>> GetAllPermissions() 23 virtual std::vector<std::unique_ptr<APIPermissionInfo>> GetAllPermissions()
33 const = 0; 24 const = 0;
34
35 // Returns all the known permission aliases.
36 virtual std::vector<AliasInfo> GetAllAliases() const = 0;
37 }; 25 };
38 26
39 } // namespace extensions 27 } // namespace extensions
40 28
41 #endif // EXTENSIONS_COMMON_PERMISSIONS_PERMISSIONS_PROVIDER_H_ 29 #endif // EXTENSIONS_COMMON_PERMISSIONS_PERMISSIONS_PROVIDER_H_
OLDNEW
« no previous file with comments | « extensions/common/permissions/permissions_info.cc ('k') | extensions/shell/common/shell_extensions_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698