Home | History | Annotate | Download | only in shell
      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 APPS_SHELL_SHELL_EXTENSIONS_CLIENT_H_
      6 #define APPS_SHELL_SHELL_EXTENSIONS_CLIENT_H_
      7 
      8 #include "base/basictypes.h"
      9 #include "base/compiler_specific.h"
     10 #include "extensions/common/extensions_client.h"
     11 
     12 namespace apps {
     13 
     14 // The app_shell implementation of ExtensionsClient.
     15 class ShellExtensionsClient : public extensions::ExtensionsClient {
     16  public:
     17   ShellExtensionsClient();
     18   virtual ~ShellExtensionsClient();
     19 
     20   // extensions::ExtensionsClient overrides:
     21   virtual void Initialize() OVERRIDE;
     22   virtual const extensions::PermissionsProvider& GetPermissionsProvider() const
     23       OVERRIDE;
     24   virtual const extensions::PermissionMessageProvider&
     25       GetPermissionMessageProvider() const OVERRIDE;
     26   virtual extensions::FeatureProvider* GetFeatureProviderByName(
     27       const std::string& name) const OVERRIDE;
     28   virtual void FilterHostPermissions(
     29       const extensions::URLPatternSet& hosts,
     30       extensions::URLPatternSet* new_hosts,
     31       std::set<extensions::PermissionMessage>* messages) const OVERRIDE;
     32   virtual void SetScriptingWhitelist(const ScriptingWhitelist& whitelist)
     33       OVERRIDE;
     34   virtual const ScriptingWhitelist& GetScriptingWhitelist() const OVERRIDE;
     35   virtual extensions::URLPatternSet GetPermittedChromeSchemeHosts(
     36       const extensions::Extension* extension,
     37       const extensions::APIPermissionSet& api_permissions) const OVERRIDE;
     38   virtual bool IsScriptableURL(const GURL& url, std::string* error) const
     39       OVERRIDE;
     40 
     41  private:
     42   ScriptingWhitelist scripting_whitelist_;
     43 
     44   DISALLOW_COPY_AND_ASSIGN(ShellExtensionsClient);
     45 };
     46 
     47 }  // namespace apps
     48 
     49 #endif  // APPS_SHELL_SHELL_EXTENSIONS_CLIENT_H_
     50