Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 #include "extensions/test/test_extensions_client.h" | |
| 6 | |
| 7 #include "extensions/common/common_manifest_handlers.h" | |
| 8 #include "extensions/common/features/base_feature_provider.h" | |
| 9 #include "extensions/common/manifest_handler.h" | |
| 10 #include "extensions/test/test_permission_message_provider.h" | |
| 11 #include "extensions/test/test_permissions_provider.h" | |
| 12 | |
| 13 namespace extensions { | |
| 14 | |
| 15 TestExtensionsClient::TestExtensionsClient() { | |
| 16 } | |
| 17 | |
| 18 TestExtensionsClient::~TestExtensionsClient() { | |
| 19 } | |
| 20 | |
| 21 void TestExtensionsClient::Initialize() { | |
| 22 // Registration could already be finalized in unit tests, where the utility | |
| 23 // thread runs in-process. | |
| 24 if (!ManifestHandler::IsRegistrationFinalized()) { | |
| 25 RegisterCommonManifestHandlers(); | |
| 26 ManifestHandler::FinalizeRegistration(); | |
| 27 } | |
| 28 } | |
| 29 | |
| 30 const PermissionsProvider& | |
| 31 TestExtensionsClient::GetPermissionsProvider() const { | |
| 32 static TestPermissionsProvider provider; | |
| 33 return provider; | |
| 34 } | |
| 35 | |
| 36 const PermissionMessageProvider& | |
| 37 TestExtensionsClient::GetPermissionMessageProvider() const { | |
| 38 static TestPermissionMessageProvider provider; | |
| 39 return provider; | |
| 40 } | |
| 41 | |
| 42 FeatureProvider* TestExtensionsClient::GetFeatureProviderByName( | |
| 43 const std::string& name) const { | |
| 44 return BaseFeatureProvider::GetByName(name); | |
| 45 } | |
| 46 | |
| 47 void TestExtensionsClient::FilterHostPermissions( | |
| 48 const URLPatternSet& hosts, | |
| 49 URLPatternSet* new_hosts, | |
| 50 std::set<PermissionMessage>* messages) const { | |
| 51 } | |
| 52 | |
| 53 void TestExtensionsClient::SetScriptingWhitelist( | |
| 54 const ExtensionsClient::ScriptingWhitelist& whitelist) { | |
| 55 scripting_whitelist_ = whitelist; | |
| 56 } | |
| 57 | |
| 58 const ExtensionsClient::ScriptingWhitelist& | |
| 59 TestExtensionsClient::GetScriptingWhitelist() const { | |
| 60 return scripting_whitelist_; | |
| 61 } | |
| 62 | |
| 63 URLPatternSet TestExtensionsClient::GetPermittedChromeSchemeHosts( | |
| 64 const Extension* extension, | |
| 65 const APIPermissionSet& api_permissions) const { | |
| 66 URLPatternSet hosts; | |
| 67 return hosts; | |
|
James Cook
2014/04/11 16:26:49
nit: Can this be "return URLPatternSet();"?
| |
| 68 } | |
| 69 | |
| 70 bool TestExtensionsClient::IsScriptableURL(const GURL& url, | |
| 71 std::string* error) const { | |
| 72 return true; | |
| 73 } | |
| 74 | |
| 75 bool TestExtensionsClient::IsAPISchemaGenerated( | |
| 76 const std::string& name) const { | |
| 77 return false; | |
| 78 } | |
| 79 | |
| 80 base::StringPiece TestExtensionsClient::GetAPISchema( | |
| 81 const std::string& name) const { | |
| 82 return base::StringPiece(); | |
| 83 } | |
| 84 | |
| 85 void TestExtensionsClient::AddExtraFeatureFilters( | |
| 86 SimpleFeature* feature) const { | |
| 87 } | |
| 88 | |
| 89 } // namespace extensions | |
| OLD | NEW |