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_TEST_TEST_EXTENSIONS_CLIENT_H_
6 #define EXTENSIONS_TEST_TEST_EXTENSIONS_CLIENT_H_
8 #include "base/macros.h"
9 #include "extensions/common/extensions_client.h"
11 namespace extensions
{
13 class TestExtensionsClient
: public ExtensionsClient
{
15 TestExtensionsClient();
16 virtual ~TestExtensionsClient();
19 virtual void Initialize() OVERRIDE
;
20 virtual const PermissionMessageProvider
& GetPermissionMessageProvider() const
22 virtual const std::string
GetProductName() OVERRIDE
;
23 virtual scoped_ptr
<FeatureProvider
> CreateFeatureProvider(
24 const std::string
& name
) const OVERRIDE
;
25 virtual scoped_ptr
<JSONFeatureProviderSource
> CreateFeatureProviderSource(
26 const std::string
& name
) const OVERRIDE
;
27 virtual void FilterHostPermissions(
28 const URLPatternSet
& hosts
,
29 URLPatternSet
* new_hosts
,
30 std::set
<PermissionMessage
>* messages
) const OVERRIDE
;
31 virtual void SetScriptingWhitelist(
32 const ScriptingWhitelist
& whitelist
) OVERRIDE
;
33 virtual const ScriptingWhitelist
& GetScriptingWhitelist() const OVERRIDE
;
34 virtual URLPatternSet
GetPermittedChromeSchemeHosts(
35 const Extension
* extension
,
36 const APIPermissionSet
& api_permissions
) const OVERRIDE
;
37 virtual bool IsScriptableURL(const GURL
& url
,
38 std::string
* error
) const OVERRIDE
;
39 virtual bool IsAPISchemaGenerated(const std::string
& name
) const OVERRIDE
;
40 virtual base::StringPiece
GetAPISchema(
41 const std::string
& name
) const OVERRIDE
;
42 virtual void RegisterAPISchemaResources(ExtensionAPI
* api
) const OVERRIDE
;
43 virtual bool ShouldSuppressFatalErrors() const OVERRIDE
;
45 // A whitelist of extensions that can script anywhere. Do not add to this
46 // list (except in tests) without consulting the Extensions team first.
47 // Note: Component extensions have this right implicitly and do not need to be
48 // added to this list.
49 ScriptingWhitelist scripting_whitelist_
;
51 DISALLOW_COPY_AND_ASSIGN(TestExtensionsClient
);
54 } // namespace extensions
56 #endif // EXTENSIONS_TEST_TEST_EXTENSIONS_CLIENT_H_