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.
5 #ifndef EXTENSIONS_SHELL_COMMON_SHELL_EXTENSIONS_CLIENT_H_
6 #define EXTENSIONS_SHELL_COMMON_SHELL_EXTENSIONS_CLIENT_H_
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"
13 namespace extensions
{
15 // The app_shell implementation of ExtensionsClient.
16 class ShellExtensionsClient
: public ExtensionsClient
{
18 ShellExtensionsClient();
19 virtual ~ShellExtensionsClient();
21 // ExtensionsClient overrides:
22 virtual void Initialize() OVERRIDE
;
23 virtual const PermissionMessageProvider
& GetPermissionMessageProvider()
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
;
49 const ExtensionsAPIPermissions extensions_api_permissions_
;
51 ScriptingWhitelist scripting_whitelist_
;
53 DISALLOW_COPY_AND_ASSIGN(ShellExtensionsClient
);
56 } // namespace extensions
58 #endif // EXTENSIONS_SHELL_COMMON_SHELL_EXTENSIONS_CLIENT_H_