Add testing/scripts/OWNERS
[chromium-blink-merge.git] / extensions / test / test_extensions_client.h
blob8000550116ece19fc22e0fa3ffa6a3fa55b3e4ec
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 {
14 public:
15 TestExtensionsClient();
16 ~TestExtensionsClient() override;
18 private:
19 void Initialize() override;
20 const PermissionMessageProvider& GetPermissionMessageProvider()
21 const override;
22 const std::string GetProductName() override;
23 scoped_ptr<FeatureProvider> CreateFeatureProvider(
24 const std::string& name) const override;
25 scoped_ptr<JSONFeatureProviderSource> CreateFeatureProviderSource(
26 const std::string& name) const override;
27 void FilterHostPermissions(
28 const URLPatternSet& hosts,
29 URLPatternSet* new_hosts,
30 std::set<PermissionMessage>* messages) const override;
31 void SetScriptingWhitelist(const ScriptingWhitelist& whitelist) override;
32 const ScriptingWhitelist& GetScriptingWhitelist() const override;
33 URLPatternSet GetPermittedChromeSchemeHosts(
34 const Extension* extension,
35 const APIPermissionSet& api_permissions) const override;
36 bool IsScriptableURL(const GURL& url, std::string* error) const override;
37 bool IsAPISchemaGenerated(const std::string& name) const override;
38 base::StringPiece GetAPISchema(const std::string& name) const override;
39 void RegisterAPISchemaResources(ExtensionAPI* api) const override;
40 bool ShouldSuppressFatalErrors() const override;
41 std::string GetWebstoreBaseURL() const override;
42 std::string GetWebstoreUpdateURL() const override;
43 bool IsBlacklistUpdateURL(const GURL& url) 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_