| OLD | NEW |
| 1 // Copyright 2013 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 #include "chrome/common/extensions/chrome_extensions_client.h" | 5 #include "chrome/common/extensions/chrome_extensions_client.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #include "components/version_info/version_info.h" | 27 #include "components/version_info/version_info.h" |
| 28 #include "content/public/common/url_constants.h" | 28 #include "content/public/common/url_constants.h" |
| 29 #include "extensions/common/api/generated_schemas.h" | 29 #include "extensions/common/api/generated_schemas.h" |
| 30 #include "extensions/common/common_manifest_handlers.h" | 30 #include "extensions/common/common_manifest_handlers.h" |
| 31 #include "extensions/common/constants.h" | 31 #include "extensions/common/constants.h" |
| 32 #include "extensions/common/extension.h" | 32 #include "extensions/common/extension.h" |
| 33 #include "extensions/common/extension_api.h" | 33 #include "extensions/common/extension_api.h" |
| 34 #include "extensions/common/extension_icon_set.h" | 34 #include "extensions/common/extension_icon_set.h" |
| 35 #include "extensions/common/extension_urls.h" | 35 #include "extensions/common/extension_urls.h" |
| 36 #include "extensions/common/features/api_feature.h" | 36 #include "extensions/common/features/api_feature.h" |
| 37 #include "extensions/common/features/base_feature_provider.h" | |
| 38 #include "extensions/common/features/behavior_feature.h" | 37 #include "extensions/common/features/behavior_feature.h" |
| 39 #include "extensions/common/features/feature_provider.h" | 38 #include "extensions/common/features/feature_provider.h" |
| 39 #include "extensions/common/features/json_feature_provider.h" |
| 40 #include "extensions/common/features/json_feature_provider_source.h" | 40 #include "extensions/common/features/json_feature_provider_source.h" |
| 41 #include "extensions/common/features/manifest_feature.h" | 41 #include "extensions/common/features/manifest_feature.h" |
| 42 #include "extensions/common/features/permission_feature.h" | 42 #include "extensions/common/features/permission_feature.h" |
| 43 #include "extensions/common/features/simple_feature.h" | 43 #include "extensions/common/features/simple_feature.h" |
| 44 #include "extensions/common/manifest_constants.h" | 44 #include "extensions/common/manifest_constants.h" |
| 45 #include "extensions/common/manifest_handler.h" | 45 #include "extensions/common/manifest_handler.h" |
| 46 #include "extensions/common/manifest_handlers/icons_handler.h" | 46 #include "extensions/common/manifest_handlers/icons_handler.h" |
| 47 #include "extensions/common/permissions/api_permission_set.h" | 47 #include "extensions/common/permissions/api_permission_set.h" |
| 48 #include "extensions/common/permissions/permissions_info.h" | 48 #include "extensions/common/permissions/permissions_info.h" |
| 49 #include "extensions/common/url_pattern.h" | 49 #include "extensions/common/url_pattern.h" |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 const std::string ChromeExtensionsClient::GetProductName() { | 140 const std::string ChromeExtensionsClient::GetProductName() { |
| 141 return l10n_util::GetStringUTF8(IDS_PRODUCT_NAME); | 141 return l10n_util::GetStringUTF8(IDS_PRODUCT_NAME); |
| 142 } | 142 } |
| 143 | 143 |
| 144 std::unique_ptr<FeatureProvider> ChromeExtensionsClient::CreateFeatureProvider( | 144 std::unique_ptr<FeatureProvider> ChromeExtensionsClient::CreateFeatureProvider( |
| 145 const std::string& name) const { | 145 const std::string& name) const { |
| 146 std::unique_ptr<FeatureProvider> provider; | 146 std::unique_ptr<FeatureProvider> provider; |
| 147 std::unique_ptr<JSONFeatureProviderSource> source( | 147 std::unique_ptr<JSONFeatureProviderSource> source( |
| 148 CreateFeatureProviderSource(name)); | 148 CreateFeatureProviderSource(name)); |
| 149 if (name == "api") { | 149 if (name == "api") { |
| 150 provider.reset(new BaseFeatureProvider(source->dictionary(), | 150 provider.reset(new JSONFeatureProvider(source->dictionary(), |
| 151 CreateFeature<APIFeature>)); | 151 CreateFeature<APIFeature>)); |
| 152 } else if (name == "manifest") { | 152 } else if (name == "manifest") { |
| 153 provider.reset(new BaseFeatureProvider(source->dictionary(), | 153 provider.reset(new JSONFeatureProvider(source->dictionary(), |
| 154 CreateFeature<ManifestFeature>)); | 154 CreateFeature<ManifestFeature>)); |
| 155 } else if (name == "permission") { | 155 } else if (name == "permission") { |
| 156 provider.reset(new BaseFeatureProvider(source->dictionary(), | 156 provider.reset(new JSONFeatureProvider(source->dictionary(), |
| 157 CreateFeature<PermissionFeature>)); | 157 CreateFeature<PermissionFeature>)); |
| 158 } else if (name == "behavior") { | 158 } else if (name == "behavior") { |
| 159 provider.reset(new BaseFeatureProvider(source->dictionary(), | 159 provider.reset(new JSONFeatureProvider(source->dictionary(), |
| 160 CreateFeature<BehaviorFeature>)); | 160 CreateFeature<BehaviorFeature>)); |
| 161 } else { | 161 } else { |
| 162 NOTREACHED(); | 162 NOTREACHED(); |
| 163 } | 163 } |
| 164 return provider; | 164 return provider; |
| 165 } | 165 } |
| 166 | 166 |
| 167 std::unique_ptr<JSONFeatureProviderSource> | 167 std::unique_ptr<JSONFeatureProviderSource> |
| 168 ChromeExtensionsClient::CreateFeatureProviderSource( | 168 ChromeExtensionsClient::CreateFeatureProviderSource( |
| 169 const std::string& name) const { | 169 const std::string& name) const { |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 const { | 377 const { |
| 378 return GetCurrentChannel() == version_info::Channel::UNKNOWN; | 378 return GetCurrentChannel() == version_info::Channel::UNKNOWN; |
| 379 } | 379 } |
| 380 | 380 |
| 381 // static | 381 // static |
| 382 ChromeExtensionsClient* ChromeExtensionsClient::GetInstance() { | 382 ChromeExtensionsClient* ChromeExtensionsClient::GetInstance() { |
| 383 return g_client.Pointer(); | 383 return g_client.Pointer(); |
| 384 } | 384 } |
| 385 | 385 |
| 386 } // namespace extensions | 386 } // namespace extensions |
| OLD | NEW |