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

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

Issue 660333003: Add support for app_shell-only extension APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: (shell-identity) rebase Created 6 years, 2 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
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 f27cd09e720ac974a1d0f49c23b7507efbfce5ef..8eae90213be81faa8c28bde2d91a40268fdcba00 100644
--- a/extensions/shell/common/shell_extensions_client.cc
+++ b/extensions/shell/common/shell_extensions_client.cc
@@ -20,6 +20,8 @@
#include "extensions/common/permissions/permissions_info.h"
#include "extensions/common/permissions/permissions_provider.h"
#include "extensions/common/url_pattern_set.h"
+#include "extensions/shell/common/api/generated_schemas.h"
+#include "grit/app_shell_resources.h"
#include "grit/extensions_resources.h"
namespace extensions {
@@ -127,6 +129,7 @@ ShellExtensionsClient::CreateFeatureProviderSource(
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") {
@@ -171,11 +174,17 @@ bool ShellExtensionsClient::IsScriptableURL(const GURL& url,
bool ShellExtensionsClient::IsAPISchemaGenerated(
const std::string& name) const {
- return core_api::GeneratedSchemas::IsGenerated(name);
+ return core_api::GeneratedSchemas::IsGenerated(name) ||
+ shell_api::GeneratedSchemas::IsGenerated(name);
}
base::StringPiece ShellExtensionsClient::GetAPISchema(
const std::string& name) const {
+ // Schema for app_shell-only APIs.
+ if (shell_api::GeneratedSchemas::IsGenerated(name))
+ return shell_api::GeneratedSchemas::Get(name);
+
+ // Core extensions APIs.
return core_api::GeneratedSchemas::Get(name);
}

Powered by Google App Engine
This is Rietveld 408576698