summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorjamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-02 09:47:42 +0000
committerjamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-02 09:47:42 +0000
commitb061bf39f06c0d951b39fe990081543ab97445e0 (patch)
treef709f8bfe4a5927b4214bc03ef71616865bfe855 /apps
parent15c102925855ae00adb25cde896aad00758357fd (diff)
downloadchromium_src-b061bf39f06c0d951b39fe990081543ab97445e0.zip
chromium_src-b061bf39f06c0d951b39fe990081543ab97445e0.tar.gz
chromium_src-b061bf39f06c0d951b39fe990081543ab97445e0.tar.bz2
Add _api_features.json for chrome.shell API
The chrome.shell API is only available in app_shell, so it should not be part of the common extensions _api_features.json. This fixes a CHECK failure in the renderer when loading the Calculator sample app, which tests for the existence of chrome.shell. (The schema is not available, because the API is only implemented in app_shell, but chrome.shell returns true because the "shell" is in the shared extensions _api_features.json.) BUG=369318 TEST=manual Review URL: https://codereview.chromium.org/260963006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@267776 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'apps')
-rw-r--r--apps/shell/app_shell_resources.grd3
-rw-r--r--apps/shell/common/api/_api_features.json18
-rw-r--r--apps/shell/common/shell_extensions_client.cc4
3 files changed, 24 insertions, 1 deletions
diff --git a/apps/shell/app_shell_resources.grd b/apps/shell/app_shell_resources.grd
index 4e77d0d..236b488 100644
--- a/apps/shell/app_shell_resources.grd
+++ b/apps/shell/app_shell_resources.grd
@@ -8,6 +8,9 @@
</outputs>
<release seq="1">
<includes>
+ <!-- Features specific to app_shell. -->
+ <include name="IDR_SHELL_EXTENSION_API_FEATURES" file="common\api\_api_features.json" type="BINDATA" />
+
<!-- Custom bindings for extension APIs. -->
<include name="IDR_SHELL_CUSTOM_BINDINGS_JS" file="renderer\shell_custom_bindings.js" type="BINDATA" />
</includes>
diff --git a/apps/shell/common/api/_api_features.json b/apps/shell/common/api/_api_features.json
new file mode 100644
index 0000000..9571ca8
--- /dev/null
+++ b/apps/shell/common/api/_api_features.json
@@ -0,0 +1,18 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// This features file defines extension APIs implemented under src/apps/shell.
+// See extensions/common/features/* to understand this file, in particular
+// feature.h, simple_feature.h, and base_feature_provider.h.
+//
+// Note that specifying "web_page", "blessed_web_page", or "all" as a context
+// type will require manually updating chrome/renderer/resources/dispatcher.cc.
+
+{
+ "shell": {
+ "channel": "dev",
+ "contexts": ["blessed_extension"],
+ "extension_types": ["platform_app"]
+ }
+}
diff --git a/apps/shell/common/shell_extensions_client.cc b/apps/shell/common/shell_extensions_client.cc
index 4d08fc6..6abe2b6 100644
--- a/apps/shell/common/shell_extensions_client.cc
+++ b/apps/shell/common/shell_extensions_client.cc
@@ -21,6 +21,7 @@
#include "extensions/common/permissions/permission_message_provider.h"
#include "extensions/common/permissions/permissions_provider.h"
#include "extensions/common/url_pattern_set.h"
+#include "grit/app_shell_resources.h"
#include "grit/common_resources.h"
#include "grit/extensions_resources.h"
@@ -132,8 +133,9 @@ scoped_ptr<FeatureProvider> ShellExtensionsClient::CreateFeatureProvider(
const std::string& name) const {
extensions::JSONFeatureProviderSource source(name);
if (name == "api") {
- // TODO(yoz): Only include src/extensions resources.
source.LoadJSON(IDR_EXTENSION_API_FEATURES);
+ source.LoadJSON(IDR_SHELL_EXTENSION_API_FEATURES);
+ // TODO(yoz): Don't include Chrome resources.
source.LoadJSON(IDR_CHROME_EXTENSION_API_FEATURES);
return scoped_ptr<FeatureProvider>(new BaseFeatureProvider(
source.dictionary(), CreateFeature<extensions::APIFeature>));