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 ~ShellExtensionsClient() override
;
21 // ExtensionsClient overrides:
22 void Initialize() override
;
23 const PermissionMessageProvider
& GetPermissionMessageProvider()
25 const std::string
GetProductName() override
;
26 scoped_ptr
<FeatureProvider
> CreateFeatureProvider(
27 const std::string
& name
) const override
;
28 scoped_ptr
<JSONFeatureProviderSource
> CreateFeatureProviderSource(
29 const std::string
& name
) const override
;
30 void FilterHostPermissions(
31 const URLPatternSet
& hosts
,
32 URLPatternSet
* new_hosts
,
33 std::set
<PermissionMessage
>* messages
) const override
;
34 void FilterHostPermissions(const URLPatternSet
& hosts
,
35 URLPatternSet
* new_hosts
,
36 PermissionIDSet
* permissions
) const override
;
37 void SetScriptingWhitelist(const ScriptingWhitelist
& whitelist
) override
;
38 const ScriptingWhitelist
& GetScriptingWhitelist() const override
;
39 URLPatternSet
GetPermittedChromeSchemeHosts(
40 const Extension
* extension
,
41 const APIPermissionSet
& api_permissions
) const override
;
42 bool IsScriptableURL(const GURL
& url
, std::string
* error
) const override
;
43 bool IsAPISchemaGenerated(const std::string
& name
) const override
;
44 base::StringPiece
GetAPISchema(const std::string
& name
) const override
;
45 void RegisterAPISchemaResources(ExtensionAPI
* api
) const override
;
46 bool ShouldSuppressFatalErrors() const override
;
47 void RecordDidSuppressFatalError() override
;
48 std::string
GetWebstoreBaseURL() const override
;
49 std::string
GetWebstoreUpdateURL() const override
;
50 bool IsBlacklistUpdateURL(const GURL
& url
) const override
;
53 const ExtensionsAPIPermissions extensions_api_permissions_
;
55 ScriptingWhitelist scripting_whitelist_
;
57 DISALLOW_COPY_AND_ASSIGN(ShellExtensionsClient
);
60 } // namespace extensions
62 #endif // EXTENSIONS_SHELL_COMMON_SHELL_EXTENSIONS_CLIENT_H_