| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 #include "extensions/test/test_extensions_client.h" | 5 #include "extensions/test/test_extensions_client.h" |
| 6 | 6 |
| 7 #include "extensions/common/common_manifest_handlers.h" | 7 #include "extensions/common/common_manifest_handlers.h" |
| 8 #include "extensions/common/features/base_feature_provider.h" | 8 #include "extensions/common/features/feature_provider.h" |
| 9 #include "extensions/common/features/json_feature_provider_source.h" |
| 9 #include "extensions/common/manifest_handler.h" | 10 #include "extensions/common/manifest_handler.h" |
| 11 #include "extensions/common/url_pattern_set.h" |
| 10 #include "extensions/test/test_permission_message_provider.h" | 12 #include "extensions/test/test_permission_message_provider.h" |
| 11 #include "extensions/test/test_permissions_provider.h" | |
| 12 | 13 |
| 13 namespace extensions { | 14 namespace extensions { |
| 14 | 15 |
| 15 TestExtensionsClient::TestExtensionsClient() { | 16 TestExtensionsClient::TestExtensionsClient() { |
| 16 } | 17 } |
| 17 | 18 |
| 18 TestExtensionsClient::~TestExtensionsClient() { | 19 TestExtensionsClient::~TestExtensionsClient() { |
| 19 } | 20 } |
| 20 | 21 |
| 21 void TestExtensionsClient::Initialize() { | 22 void TestExtensionsClient::Initialize() { |
| 22 // Registration could already be finalized in unit tests, where the utility | 23 // Registration could already be finalized in unit tests, where the utility |
| 23 // thread runs in-process. | 24 // thread runs in-process. |
| 24 if (!ManifestHandler::IsRegistrationFinalized()) { | 25 if (!ManifestHandler::IsRegistrationFinalized()) { |
| 25 RegisterCommonManifestHandlers(); | 26 RegisterCommonManifestHandlers(); |
| 26 ManifestHandler::FinalizeRegistration(); | 27 ManifestHandler::FinalizeRegistration(); |
| 27 } | 28 } |
| 28 } | 29 } |
| 29 | 30 |
| 30 const PermissionsProvider& | |
| 31 TestExtensionsClient::GetPermissionsProvider() const { | |
| 32 static TestPermissionsProvider provider; | |
| 33 return provider; | |
| 34 } | |
| 35 | |
| 36 const PermissionMessageProvider& | 31 const PermissionMessageProvider& |
| 37 TestExtensionsClient::GetPermissionMessageProvider() const { | 32 TestExtensionsClient::GetPermissionMessageProvider() const { |
| 38 static TestPermissionMessageProvider provider; | 33 static TestPermissionMessageProvider provider; |
| 39 return provider; | 34 return provider; |
| 40 } | 35 } |
| 41 | 36 |
| 42 // TODO(yoz): Implement something reasonable here. | 37 // TODO(yoz): Implement something reasonable here. |
| 43 scoped_ptr<FeatureProvider> TestExtensionsClient::CreateFeatureProvider( | 38 scoped_ptr<FeatureProvider> TestExtensionsClient::CreateFeatureProvider( |
| 44 const std::string& name) const { | 39 const std::string& name) const { |
| 45 return scoped_ptr<FeatureProvider>(); | 40 return scoped_ptr<FeatureProvider>(); |
| 46 } | 41 } |
| 47 | 42 |
| 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>(); |
| 48 } |
| 49 |
| 48 void TestExtensionsClient::FilterHostPermissions( | 50 void TestExtensionsClient::FilterHostPermissions( |
| 49 const URLPatternSet& hosts, | 51 const URLPatternSet& hosts, |
| 50 URLPatternSet* new_hosts, | 52 URLPatternSet* new_hosts, |
| 51 std::set<PermissionMessage>* messages) const { | 53 std::set<PermissionMessage>* messages) const { |
| 52 } | 54 } |
| 53 | 55 |
| 54 void TestExtensionsClient::SetScriptingWhitelist( | 56 void TestExtensionsClient::SetScriptingWhitelist( |
| 55 const ExtensionsClient::ScriptingWhitelist& whitelist) { | 57 const ExtensionsClient::ScriptingWhitelist& whitelist) { |
| 56 scripting_whitelist_ = whitelist; | 58 scripting_whitelist_ = whitelist; |
| 57 } | 59 } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 81 base::StringPiece TestExtensionsClient::GetAPISchema( | 83 base::StringPiece TestExtensionsClient::GetAPISchema( |
| 82 const std::string& name) const { | 84 const std::string& name) const { |
| 83 return base::StringPiece(); | 85 return base::StringPiece(); |
| 84 } | 86 } |
| 85 | 87 |
| 86 bool TestExtensionsClient::ShouldSuppressFatalErrors() const { | 88 bool TestExtensionsClient::ShouldSuppressFatalErrors() const { |
| 87 return true; | 89 return true; |
| 88 } | 90 } |
| 89 | 91 |
| 90 } // namespace extensions | 92 } // namespace extensions |
| OLD | NEW |