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 #include "extensions/test/test_extensions_client.h"
7 #include "extensions/common/common_manifest_handlers.h"
8 #include "extensions/common/features/feature_provider.h"
9 #include "extensions/common/features/json_feature_provider_source.h"
10 #include "extensions/common/manifest_handler.h"
11 #include "extensions/common/url_pattern_set.h"
12 #include "extensions/test/test_permission_message_provider.h"
14 namespace extensions
{
16 TestExtensionsClient::TestExtensionsClient() {
19 TestExtensionsClient::~TestExtensionsClient() {
22 void TestExtensionsClient::Initialize() {
23 // Registration could already be finalized in unit tests, where the utility
24 // thread runs in-process.
25 if (!ManifestHandler::IsRegistrationFinalized()) {
26 RegisterCommonManifestHandlers();
27 ManifestHandler::FinalizeRegistration();
31 const PermissionMessageProvider
&
32 TestExtensionsClient::GetPermissionMessageProvider() const {
33 static TestPermissionMessageProvider provider
;
37 // TODO(yoz): Implement something reasonable here.
38 scoped_ptr
<FeatureProvider
> TestExtensionsClient::CreateFeatureProvider(
39 const std::string
& name
) const {
40 return scoped_ptr
<FeatureProvider
>();
43 // TODO(yoz): Implement something reasonable here.
44 scoped_ptr
<JSONFeatureProviderSource
>
45 TestExtensionsClient::CreateFeatureProviderSource(
46 const std::string
& name
) const {
47 return scoped_ptr
<JSONFeatureProviderSource
>();
50 void TestExtensionsClient::FilterHostPermissions(
51 const URLPatternSet
& hosts
,
52 URLPatternSet
* new_hosts
,
53 std::set
<PermissionMessage
>* messages
) const {
56 void TestExtensionsClient::SetScriptingWhitelist(
57 const ExtensionsClient::ScriptingWhitelist
& whitelist
) {
58 scripting_whitelist_
= whitelist
;
61 const ExtensionsClient::ScriptingWhitelist
&
62 TestExtensionsClient::GetScriptingWhitelist() const {
63 return scripting_whitelist_
;
66 URLPatternSet
TestExtensionsClient::GetPermittedChromeSchemeHosts(
67 const Extension
* extension
,
68 const APIPermissionSet
& api_permissions
) const {
73 bool TestExtensionsClient::IsScriptableURL(const GURL
& url
,
74 std::string
* error
) const {
78 bool TestExtensionsClient::IsAPISchemaGenerated(
79 const std::string
& name
) const {
83 base::StringPiece
TestExtensionsClient::GetAPISchema(
84 const std::string
& name
) const {
85 return base::StringPiece();
88 void TestExtensionsClient::RegisterAPISchemaResources(ExtensionAPI
* api
) const {
91 bool TestExtensionsClient::ShouldSuppressFatalErrors() const {
95 } // namespace extensions