Adding Peter Thatcher to the owners file.
[chromium-blink-merge.git] / extensions / common / permissions / permissions_provider.h
blob5d7046d0db48377160a6e35b0e65d33e4e7b000e
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
3 // found in the LICENSE file.
5 #ifndef EXTENSIONS_COMMON_PERMISSIONS_PERMISSIONS_PROVIDER_H_
6 #define EXTENSIONS_COMMON_PERMISSIONS_PERMISSIONS_PROVIDER_H_
8 #include <vector>
10 namespace extensions {
12 class APIPermissionInfo;
14 // The PermissionsProvider creates APIPermissions instances. It is only
15 // needed at startup time. Typically, ExtensionsClient will register
16 // its PermissionsProviders with the global PermissionsInfo at startup.
17 // TODO(sashab): Remove all permission messages from this class, moving the
18 // permission message rules into ChromePermissionMessageProvider.
19 class PermissionsProvider {
20 public:
21 // An alias for a given permission |name|.
22 struct AliasInfo {
23 const char* name;
24 const char* alias;
26 AliasInfo(const char* name, const char* alias)
27 : name(name), alias(alias) {
30 // Returns all the known permissions. The caller, PermissionsInfo,
31 // takes ownership of the APIPermissionInfos.
32 virtual std::vector<APIPermissionInfo*> GetAllPermissions() const = 0;
34 // Returns all the known permission aliases.
35 virtual std::vector<AliasInfo> GetAllAliases() const = 0;
38 } // namespace extensions
40 #endif // EXTENSIONS_COMMON_PERMISSIONS_PERMISSIONS_PROVIDER_H_