Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3888)

Unified Diff: extensions/shell/common/shell_extensions_client.cc

Issue 2165023003: [Extensions] Use compiled feature files (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « extensions/shell/common/shell_extensions_client.h ('k') | extensions/test/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/shell/common/shell_extensions_client.cc
diff --git a/extensions/shell/common/shell_extensions_client.cc b/extensions/shell/common/shell_extensions_client.cc
index 338f31233b25b6ca1fa282a1b34cbfd361b7e3b8..0bce5f533ef27b6f9bf34ed822c9958e285b0c7a 100644
--- a/extensions/shell/common/shell_extensions_client.cc
+++ b/extensions/shell/common/shell_extensions_client.cc
@@ -23,6 +23,10 @@
#include "extensions/common/permissions/permissions_provider.h"
#include "extensions/common/url_pattern_set.h"
#include "extensions/shell/common/api/generated_schemas.h"
+#include "extensions/shell/common/api/shell_api_features.h"
+#include "extensions/shell/common/api/shell_behavior_features.h"
+#include "extensions/shell/common/api/shell_manifest_features.h"
+#include "extensions/shell/common/api/shell_permission_features.h"
#include "grit/app_shell_resources.h"
#include "grit/extensions_resources.h"
@@ -99,20 +103,14 @@ const std::string ShellExtensionsClient::GetProductName() {
std::unique_ptr<FeatureProvider> ShellExtensionsClient::CreateFeatureProvider(
const std::string& name) const {
std::unique_ptr<FeatureProvider> provider;
- std::unique_ptr<JSONFeatureProviderSource> source(
- CreateFeatureProviderSource(name));
if (name == "api") {
- provider.reset(new JSONFeatureProvider(source->dictionary(),
- CreateFeature<APIFeature>));
+ provider.reset(new ShellAPIFeatureProvider());
} else if (name == "manifest") {
- provider.reset(new JSONFeatureProvider(source->dictionary(),
- CreateFeature<ManifestFeature>));
+ provider.reset(new ShellManifestFeatureProvider());
} else if (name == "permission") {
- provider.reset(new JSONFeatureProvider(source->dictionary(),
- CreateFeature<PermissionFeature>));
+ provider.reset(new ShellPermissionFeatureProvider());
} else if (name == "behavior") {
- provider.reset(new JSONFeatureProvider(source->dictionary(),
- CreateFeature<BehaviorFeature>));
+ provider.reset(new ShellBehaviorFeatureProvider());
} else {
NOTREACHED();
}
@@ -120,23 +118,11 @@ std::unique_ptr<FeatureProvider> ShellExtensionsClient::CreateFeatureProvider(
}
std::unique_ptr<JSONFeatureProviderSource>
-ShellExtensionsClient::CreateFeatureProviderSource(
- const std::string& name) const {
+ShellExtensionsClient::CreateAPIFeatureSource() const {
std::unique_ptr<JSONFeatureProviderSource> source(
- new JSONFeatureProviderSource(name));
- if (name == "api") {
- source->LoadJSON(IDR_EXTENSION_API_FEATURES);
- source->LoadJSON(IDR_SHELL_EXTENSION_API_FEATURES);
- } else if (name == "manifest") {
- source->LoadJSON(IDR_EXTENSION_MANIFEST_FEATURES);
- } else if (name == "permission") {
- source->LoadJSON(IDR_EXTENSION_PERMISSION_FEATURES);
- } else if (name == "behavior") {
- source->LoadJSON(IDR_EXTENSION_BEHAVIOR_FEATURES);
- } else {
- NOTREACHED();
- source.reset();
- }
+ new JSONFeatureProviderSource("api"));
+ source->LoadJSON(IDR_EXTENSION_API_FEATURES);
+ source->LoadJSON(IDR_SHELL_EXTENSION_API_FEATURES);
return source;
}
« no previous file with comments | « extensions/shell/common/shell_extensions_client.h ('k') | extensions/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698