Home | History | Annotate | Download | only in common
      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_EXTENSIONS_CLIENT_H_
      6 #define EXTENSIONS_COMMON_EXTENSIONS_CLIENT_H_
      7 
      8 #include <string>
      9 
     10 namespace extensions {
     11 
     12 class FeatureProvider;
     13 class PermissionsProvider;
     14 
     15 // Sets up global state for the extensions system. Should be Set() once in each
     16 // process. This should be implemented by the client of the extensions system.
     17 class ExtensionsClient {
     18  public:
     19   // Returns a PermissionsProvider to initialize the permissions system.
     20   virtual const PermissionsProvider& GetPermissionsProvider() const = 0;
     21 
     22   // Gets a feature provider for a specific feature type.
     23   virtual FeatureProvider* GetFeatureProviderByName(const std::string& name)
     24       const = 0;
     25 
     26   // Called at startup. Registers the handlers for parsing manifests.
     27   virtual void RegisterManifestHandlers() const = 0;
     28 
     29   // Return the extensions client.
     30   static ExtensionsClient* Get();
     31 
     32   // Initialize the extensions system with this extensions client.
     33   static void Set(ExtensionsClient* client);
     34 };
     35 
     36 }  // namespace extensions
     37 
     38 #endif  // EXTENSIONS_COMMON_EXTENSIONS_CLIENT_H_
     39