Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / extensions / common / permissions / permissions_provider.h
blob44179952788dc25444a08311f23c2756fc6d9e27
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 class PermissionsProvider {
18 public:
19 // An alias for a given permission |name|.
20 struct AliasInfo {
21 const char* name;
22 const char* alias;
24 AliasInfo(const char* name, const char* alias)
25 : name(name), alias(alias) {
28 // Returns all the known permissions. The caller, PermissionsInfo,
29 // takes ownership of the APIPermissionInfos.
30 virtual std::vector<APIPermissionInfo*> GetAllPermissions() const = 0;
32 // Returns all the known permission aliases.
33 virtual std::vector<AliasInfo> GetAllAliases() const = 0;
36 } // namespace extensions
38 #endif // EXTENSIONS_COMMON_PERMISSIONS_PERMISSIONS_PROVIDER_H_