| 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 "base/stl_util.h" | 7 #include "base/stl_util.h" |
| 8 #include "extensions/common/api/generated_schemas.h" | 8 #include "extensions/common/api/generated_schemas.h" |
| 9 #include "extensions/common/common_manifest_handlers.h" | 9 #include "extensions/common/common_manifest_handlers.h" |
| 10 #include "extensions/common/extension_urls.h" | 10 #include "extensions/common/extension_urls.h" |
| 11 #include "extensions/common/features/api_feature.h" | 11 #include "extensions/common/features/api_feature.h" |
| 12 #include "extensions/common/features/base_feature_provider.h" | |
| 13 #include "extensions/common/features/behavior_feature.h" | 12 #include "extensions/common/features/behavior_feature.h" |
| 14 #include "extensions/common/features/feature_provider.h" | 13 #include "extensions/common/features/feature_provider.h" |
| 14 #include "extensions/common/features/json_feature_provider.h" |
| 15 #include "extensions/common/features/json_feature_provider_source.h" | 15 #include "extensions/common/features/json_feature_provider_source.h" |
| 16 #include "extensions/common/features/manifest_feature.h" | 16 #include "extensions/common/features/manifest_feature.h" |
| 17 #include "extensions/common/features/permission_feature.h" | 17 #include "extensions/common/features/permission_feature.h" |
| 18 #include "extensions/common/manifest_handler.h" | 18 #include "extensions/common/manifest_handler.h" |
| 19 #include "extensions/common/permissions/extensions_api_permissions.h" | 19 #include "extensions/common/permissions/extensions_api_permissions.h" |
| 20 #include "extensions/common/permissions/permissions_info.h" | 20 #include "extensions/common/permissions/permissions_info.h" |
| 21 #include "extensions/common/url_pattern_set.h" | 21 #include "extensions/common/url_pattern_set.h" |
| 22 #include "extensions/test/test_permission_message_provider.h" | 22 #include "extensions/test/test_permission_message_provider.h" |
| 23 #include "grit/extensions_resources.h" | 23 #include "grit/extensions_resources.h" |
| 24 | 24 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 const std::string TestExtensionsClient::GetProductName() { | 71 const std::string TestExtensionsClient::GetProductName() { |
| 72 return "extensions_test"; | 72 return "extensions_test"; |
| 73 } | 73 } |
| 74 | 74 |
| 75 std::unique_ptr<FeatureProvider> TestExtensionsClient::CreateFeatureProvider( | 75 std::unique_ptr<FeatureProvider> TestExtensionsClient::CreateFeatureProvider( |
| 76 const std::string& name) const { | 76 const std::string& name) const { |
| 77 std::unique_ptr<FeatureProvider> provider; | 77 std::unique_ptr<FeatureProvider> provider; |
| 78 std::unique_ptr<JSONFeatureProviderSource> source( | 78 std::unique_ptr<JSONFeatureProviderSource> source( |
| 79 CreateFeatureProviderSource(name)); | 79 CreateFeatureProviderSource(name)); |
| 80 if (name == "api") { | 80 if (name == "api") { |
| 81 provider.reset(new BaseFeatureProvider(source->dictionary(), | 81 provider.reset(new JSONFeatureProvider(source->dictionary(), |
| 82 CreateFeature<APIFeature>)); | 82 CreateFeature<APIFeature>)); |
| 83 } else if (name == "manifest") { | 83 } else if (name == "manifest") { |
| 84 provider.reset(new BaseFeatureProvider(source->dictionary(), | 84 provider.reset(new JSONFeatureProvider(source->dictionary(), |
| 85 CreateFeature<ManifestFeature>)); | 85 CreateFeature<ManifestFeature>)); |
| 86 } else if (name == "permission") { | 86 } else if (name == "permission") { |
| 87 provider.reset(new BaseFeatureProvider(source->dictionary(), | 87 provider.reset(new JSONFeatureProvider(source->dictionary(), |
| 88 CreateFeature<PermissionFeature>)); | 88 CreateFeature<PermissionFeature>)); |
| 89 } else if (name == "behavior") { | 89 } else if (name == "behavior") { |
| 90 provider.reset(new BaseFeatureProvider(source->dictionary(), | 90 provider.reset(new JSONFeatureProvider(source->dictionary(), |
| 91 CreateFeature<BehaviorFeature>)); | 91 CreateFeature<BehaviorFeature>)); |
| 92 } else { | 92 } else { |
| 93 NOTREACHED(); | 93 NOTREACHED(); |
| 94 } | 94 } |
| 95 return provider; | 95 return provider; |
| 96 } | 96 } |
| 97 | 97 |
| 98 std::unique_ptr<JSONFeatureProviderSource> | 98 std::unique_ptr<JSONFeatureProviderSource> |
| 99 TestExtensionsClient::CreateFeatureProviderSource( | 99 TestExtensionsClient::CreateFeatureProviderSource( |
| 100 const std::string& name) const { | 100 const std::string& name) const { |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 std::set<base::FilePath> TestExtensionsClient::GetBrowserImagePaths( | 178 std::set<base::FilePath> TestExtensionsClient::GetBrowserImagePaths( |
| 179 const Extension* extension) { | 179 const Extension* extension) { |
| 180 std::set<base::FilePath> result = | 180 std::set<base::FilePath> result = |
| 181 ExtensionsClient::GetBrowserImagePaths(extension); | 181 ExtensionsClient::GetBrowserImagePaths(extension); |
| 182 for (auto* filter : browser_image_filters_) | 182 for (auto* filter : browser_image_filters_) |
| 183 filter->Filter(extension, &result); | 183 filter->Filter(extension, &result); |
| 184 return result; | 184 return result; |
| 185 } | 185 } |
| 186 | 186 |
| 187 } // namespace extensions | 187 } // namespace extensions |
| OLD | NEW |