Home | History | Annotate | Download | only in permissions
      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.
      4 
      5 #ifndef EXTENSIONS_COMMON_PERMISSIONS_PERMISSIONS_PROVIDER_H_
      6 #define EXTENSIONS_COMMON_PERMISSIONS_PERMISSIONS_PROVIDER_H_
      7 
      8 #include <vector>
      9 
     10 namespace extensions {
     11 
     12 class APIPermissionInfo;
     13 
     14 // The PermissionsProvider creates the APIPermissions instances. It is only
     15 // needed at startup time.
     16 class PermissionsProvider {
     17  public:
     18   // An alias for a given permission |name|.
     19   struct AliasInfo {
     20     const char* name;
     21     const char* alias;
     22 
     23     AliasInfo(const char* name, const char* alias)
     24         : name(name), alias(alias) {
     25     }
     26   };
     27   // Returns all the known permissions. The caller, PermissionsInfo,
     28   // takes ownership of the APIPermissionInfos.
     29   virtual std::vector<APIPermissionInfo*> GetAllPermissions() const = 0;
     30 
     31   // Returns all the known permission aliases.
     32   virtual std::vector<AliasInfo> GetAllAliases() const = 0;
     33 };
     34 
     35 }  // namespace extensions
     36 
     37 #endif  // EXTENSIONS_COMMON_PERMISSIONS_PERMISSIONS_PROVIDER_H_
     38