OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef EXTENSIONS_TEST_TEST_EXTENSIONS_CLIENT_H_ | 5 #ifndef EXTENSIONS_SHELL_COMMON_SHELL_EXTENSIONS_CLIENT_H_ |
6 #define EXTENSIONS_TEST_TEST_EXTENSIONS_CLIENT_H_ | 6 #define EXTENSIONS_SHELL_COMMON_SHELL_EXTENSIONS_CLIENT_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" |
9 #include "extensions/common/extensions_client.h" | 10 #include "extensions/common/extensions_client.h" |
| 11 #include "extensions/common/permissions/extensions_api_permissions.h" |
10 | 12 |
11 namespace extensions { | 13 namespace extensions { |
12 | 14 |
13 class TestExtensionsClient : public ExtensionsClient { | 15 // The app_shell implementation of ExtensionsClient. |
| 16 class ShellExtensionsClient : public ExtensionsClient { |
14 public: | 17 public: |
15 TestExtensionsClient(); | 18 ShellExtensionsClient(); |
16 virtual ~TestExtensionsClient(); | 19 virtual ~ShellExtensionsClient(); |
17 | 20 |
18 private: | 21 // ExtensionsClient overrides: |
19 virtual void Initialize() OVERRIDE; | 22 virtual void Initialize() OVERRIDE; |
20 virtual const PermissionMessageProvider& GetPermissionMessageProvider() const | 23 virtual const PermissionMessageProvider& GetPermissionMessageProvider() |
21 OVERRIDE; | 24 const OVERRIDE; |
22 virtual scoped_ptr<FeatureProvider> CreateFeatureProvider( | 25 virtual scoped_ptr<FeatureProvider> CreateFeatureProvider( |
23 const std::string& name) const OVERRIDE; | 26 const std::string& name) const OVERRIDE; |
24 virtual scoped_ptr<JSONFeatureProviderSource> CreateFeatureProviderSource( | 27 virtual scoped_ptr<JSONFeatureProviderSource> CreateFeatureProviderSource( |
25 const std::string& name) const OVERRIDE; | 28 const std::string& name) const OVERRIDE; |
26 virtual void FilterHostPermissions( | 29 virtual void FilterHostPermissions( |
27 const URLPatternSet& hosts, | 30 const URLPatternSet& hosts, |
28 URLPatternSet* new_hosts, | 31 URLPatternSet* new_hosts, |
29 std::set<PermissionMessage>* messages) const OVERRIDE; | 32 std::set<PermissionMessage>* messages) const OVERRIDE; |
30 virtual void SetScriptingWhitelist( | 33 virtual void SetScriptingWhitelist( |
31 const ScriptingWhitelist& whitelist) OVERRIDE; | 34 const ScriptingWhitelist& whitelist) OVERRIDE; |
32 virtual const ScriptingWhitelist& GetScriptingWhitelist() const OVERRIDE; | 35 virtual const ScriptingWhitelist& GetScriptingWhitelist() const OVERRIDE; |
33 virtual URLPatternSet GetPermittedChromeSchemeHosts( | 36 virtual URLPatternSet GetPermittedChromeSchemeHosts( |
34 const Extension* extension, | 37 const Extension* extension, |
35 const APIPermissionSet& api_permissions) const OVERRIDE; | 38 const APIPermissionSet& api_permissions) const OVERRIDE; |
36 virtual bool IsScriptableURL(const GURL& url, | 39 virtual bool IsScriptableURL(const GURL& url, |
37 std::string* error) const OVERRIDE; | 40 std::string* error) const OVERRIDE; |
38 virtual bool IsAPISchemaGenerated(const std::string& name) const OVERRIDE; | 41 virtual bool IsAPISchemaGenerated(const std::string& name) const OVERRIDE; |
39 virtual base::StringPiece GetAPISchema( | 42 virtual base::StringPiece GetAPISchema( |
40 const std::string& name) const OVERRIDE; | 43 const std::string& name) const OVERRIDE; |
41 virtual void RegisterAPISchemaResources(ExtensionAPI* api) const OVERRIDE; | 44 virtual void RegisterAPISchemaResources(ExtensionAPI* api) const OVERRIDE; |
42 virtual bool ShouldSuppressFatalErrors() const OVERRIDE; | 45 virtual bool ShouldSuppressFatalErrors() const OVERRIDE; |
43 | 46 |
44 // A whitelist of extensions that can script anywhere. Do not add to this | 47 private: |
45 // list (except in tests) without consulting the Extensions team first. | 48 const ExtensionsAPIPermissions extensions_api_permissions_; |
46 // Note: Component extensions have this right implicitly and do not need to be | 49 |
47 // added to this list. | |
48 ScriptingWhitelist scripting_whitelist_; | 50 ScriptingWhitelist scripting_whitelist_; |
49 | 51 |
50 DISALLOW_COPY_AND_ASSIGN(TestExtensionsClient); | 52 DISALLOW_COPY_AND_ASSIGN(ShellExtensionsClient); |
51 }; | 53 }; |
52 | 54 |
53 } // namespace extensions | 55 } // namespace extensions |
54 | 56 |
55 #endif // EXTENSIONS_TEST_TEST_EXTENSIONS_CLIENT_H_ | 57 #endif // EXTENSIONS_SHELL_COMMON_SHELL_EXTENSIONS_CLIENT_H_ |
OLD | NEW |