1 // Copyright 2014 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_SHELL_COMMON_SHELL_EXTENSIONS_CLIENT_H_ 6 #define EXTENSIONS_SHELL_COMMON_SHELL_EXTENSIONS_CLIENT_H_ 7 8 #include "base/basictypes.h" 9 #include "base/compiler_specific.h" 10 #include "extensions/common/extensions_client.h" 11 #include "extensions/common/permissions/extensions_api_permissions.h" 12 13 namespace extensions { 14 15 // The app_shell implementation of ExtensionsClient. 16 class ShellExtensionsClient : public ExtensionsClient { 17 public: 18 ShellExtensionsClient(); 19 virtual ~ShellExtensionsClient(); 20 21 // ExtensionsClient overrides: 22 virtual void Initialize() OVERRIDE; 23 virtual const PermissionMessageProvider& GetPermissionMessageProvider() 24 const OVERRIDE; 25 virtual const std::string GetProductName() OVERRIDE; 26 virtual scoped_ptr<FeatureProvider> CreateFeatureProvider( 27 const std::string& name) const OVERRIDE; 28 virtual scoped_ptr<JSONFeatureProviderSource> CreateFeatureProviderSource( 29 const std::string& name) const OVERRIDE; 30 virtual void FilterHostPermissions( 31 const URLPatternSet& hosts, 32 URLPatternSet* new_hosts, 33 std::set<PermissionMessage>* messages) const OVERRIDE; 34 virtual void SetScriptingWhitelist( 35 const ScriptingWhitelist& whitelist) OVERRIDE; 36 virtual const ScriptingWhitelist& GetScriptingWhitelist() const OVERRIDE; 37 virtual URLPatternSet GetPermittedChromeSchemeHosts( 38 const Extension* extension, 39 const APIPermissionSet& api_permissions) const OVERRIDE; 40 virtual bool IsScriptableURL(const GURL& url, 41 std::string* error) const OVERRIDE; 42 virtual bool IsAPISchemaGenerated(const std::string& name) const OVERRIDE; 43 virtual base::StringPiece GetAPISchema( 44 const std::string& name) const OVERRIDE; 45 virtual void RegisterAPISchemaResources(ExtensionAPI* api) const OVERRIDE; 46 virtual bool ShouldSuppressFatalErrors() const OVERRIDE; 47 virtual std::string GetWebstoreBaseURL() const OVERRIDE; 48 virtual std::string GetWebstoreUpdateURL() const OVERRIDE; 49 virtual bool IsBlacklistUpdateURL(const GURL& url) const OVERRIDE; 50 51 private: 52 const ExtensionsAPIPermissions extensions_api_permissions_; 53 54 ScriptingWhitelist scripting_whitelist_; 55 56 DISALLOW_COPY_AND_ASSIGN(ShellExtensionsClient); 57 }; 58 59 } // namespace extensions 60 61 #endif // EXTENSIONS_SHELL_COMMON_SHELL_EXTENSIONS_CLIENT_H_ 62