Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / extensions / test / test_extensions_client.h
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_TEST_TEST_EXTENSIONS_CLIENT_H_
6 #define EXTENSIONS_TEST_TEST_EXTENSIONS_CLIENT_H_
7
8 #include "base/macros.h"
9 #include "extensions/common/extensions_client.h"
10
11 namespace extensions {
12
13 class TestExtensionsClient : public ExtensionsClient {
14  public:
15   TestExtensionsClient();
16   ~TestExtensionsClient() override;
17
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;
44
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_;
50
51   DISALLOW_COPY_AND_ASSIGN(TestExtensionsClient);
52 };
53
54 }  // namespace extensions
55
56 #endif  // EXTENSIONS_TEST_TEST_EXTENSIONS_CLIENT_H_