summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-30 09:53:49 +0000
committerfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-30 09:53:49 +0000
commitabae42657bdb9b9734feb3d01bd8ca7a70057b71 (patch)
tree60012963437b91d39876afc3128b75767e87a4bd
parentaf643a8e40de6f622263af11609fe8901c85d39f (diff)
downloadchromium_src-abae42657bdb9b9734feb3d01bd8ca7a70057b71.zip
chromium_src-abae42657bdb9b9734feb3d01bd8ca7a70057b71.tar.gz
chromium_src-abae42657bdb9b9734feb3d01bd8ca7a70057b71.tar.bz2
Extension Commands: Remove the "experimental" flag requirement but limit the visibility of this feature to beta channel or more recent.
BUG=124169 TEST=Should be covered by tests. Review URL: https://chromiumcodereview.appspot.com/10899031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@154108 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/extensions/browser_event_router.cc2
-rw-r--r--chrome/browser/extensions/extension_keybinding_apitest.cc5
-rw-r--r--chrome/common/extensions/api/_manifest_features.json4
-rw-r--r--chrome/common/extensions/api/_permission_features.json2
-rw-r--r--chrome/common/extensions/api/commands.json (renamed from chrome/common/extensions/api/experimental_commands.json)2
-rw-r--r--chrome/common/extensions/api/extension_api.cc4
-rw-r--r--chrome/common/extensions/docs/static/commands.html (renamed from chrome/common/extensions/docs/static/experimental.commands.html)8
-rw-r--r--chrome/common/extensions_api_resources.grd2
-rw-r--r--chrome/test/data/extensions/api_test/keybinding/basics/background.js2
-rw-r--r--chrome/test/data/extensions/api_test/keybinding/basics/manifest.json2
-rw-r--r--chrome/test/data/extensions/api_test/keybinding/conflicting/background.js2
-rw-r--r--chrome/test/data/extensions/api_test/keybinding/conflicting/manifest.json2
-rw-r--r--chrome/test/data/extensions/api_test/keybinding/page_action/manifest.json2
-rw-r--r--chrome/test/data/extensions/api_test/keybinding/script_badge/manifest.json2
14 files changed, 18 insertions, 23 deletions
diff --git a/chrome/browser/extensions/browser_event_router.cc b/chrome/browser/extensions/browser_event_router.cc
index 83347cb..1aa89c5 100644
--- a/chrome/browser/extensions/browser_event_router.cc
+++ b/chrome/browser/extensions/browser_event_router.cc
@@ -558,7 +558,7 @@ void BrowserEventRouter::CommandExecuted(Profile* profile,
DispatchEventToExtension(profile,
extension_id,
- "experimental.commands.onCommand",
+ "commands.onCommand",
args.Pass(),
EventRouter::USER_GESTURE_ENABLED);
}
diff --git a/chrome/browser/extensions/extension_keybinding_apitest.cc b/chrome/browser/extensions/extension_keybinding_apitest.cc
index f662306..aa683ea 100644
--- a/chrome/browser/extensions/extension_keybinding_apitest.cc
+++ b/chrome/browser/extensions/extension_keybinding_apitest.cc
@@ -20,10 +20,7 @@ using content::WebContents;
class CommandsApiTest : public ExtensionApiTest {
public:
- CommandsApiTest() {
- CommandLine::ForCurrentProcess()->AppendSwitch(
- switches::kEnableExperimentalExtensionApis);
- }
+ CommandsApiTest() {}
virtual ~CommandsApiTest() {}
protected:
diff --git a/chrome/common/extensions/api/_manifest_features.json b/chrome/common/extensions/api/_manifest_features.json
index 2a79106..70082ce 100644
--- a/chrome/common/extensions/api/_manifest_features.json
+++ b/chrome/common/extensions/api/_manifest_features.json
@@ -56,8 +56,8 @@
"extension_types": ["extension", "packaged_app"]
},
"commands": {
- "channel": "stable",
- "extension_types": "all",
+ "channel": "beta",
+ "extension_types": ["extension", "packaged_app"],
"min_manifest_version": 2
},
"content_security_policy": {
diff --git a/chrome/common/extensions/api/_permission_features.json b/chrome/common/extensions/api/_permission_features.json
index 6b24e71..c988f431 100644
--- a/chrome/common/extensions/api/_permission_features.json
+++ b/chrome/common/extensions/api/_permission_features.json
@@ -80,7 +80,7 @@
"whitelist": ["mfehgcgbbipciphmccgaenjidiccnmng"]
},
"commands": {
- "channel": "stable",
+ "channel": "beta",
"extension_types": ["extension", "packaged_app"]
},
"contentSettings": {
diff --git a/chrome/common/extensions/api/experimental_commands.json b/chrome/common/extensions/api/commands.json
index 8011db5..470881d 100644
--- a/chrome/common/extensions/api/experimental_commands.json
+++ b/chrome/common/extensions/api/commands.json
@@ -4,7 +4,7 @@
[
{
- "namespace": "experimental.commands",
+ "namespace": "commands",
"events": [
{
"name": "onCommand",
diff --git a/chrome/common/extensions/api/extension_api.cc b/chrome/common/extensions/api/extension_api.cc
index c8e3295..c1ead1c 100644
--- a/chrome/common/extensions/api/extension_api.cc
+++ b/chrome/common/extensions/api/extension_api.cc
@@ -354,6 +354,8 @@ void ExtensionAPI::InitDefaultConfiguration() {
IDR_EXTENSION_API_JSON_CHROMEOSINFOPRIVATE));
RegisterSchema("cloudPrintPrivate", ReadFromResource(
IDR_EXTENSION_API_JSON_CLOUDPRINTPRIVATE));
+ RegisterSchema("commands", ReadFromResource(
+ IDR_EXTENSION_API_JSON_COMMANDS));
RegisterSchema("contentSettings", ReadFromResource(
IDR_EXTENSION_API_JSON_CONTENTSETTINGS));
RegisterSchema("contextMenus", ReadFromResource(
@@ -374,8 +376,6 @@ void ExtensionAPI::InitDefaultConfiguration() {
IDR_EXTENSION_API_JSON_EXPERIMENTAL_APP));
RegisterSchema("experimental.bookmarkManager", ReadFromResource(
IDR_EXTENSION_API_JSON_EXPERIMENTAL_BOOKMARKMANAGER));
- RegisterSchema("experimental.commands", ReadFromResource(
- IDR_EXTENSION_API_JSON_EXPERIMENTAL_COMMANDS));
RegisterSchema("experimental.infobars", ReadFromResource(
IDR_EXTENSION_API_JSON_EXPERIMENTAL_INFOBARS));
RegisterSchema("experimental.input.virtualKeyboard", ReadFromResource(
diff --git a/chrome/common/extensions/docs/static/experimental.commands.html b/chrome/common/extensions/docs/static/commands.html
index e876f83..ca813b7 100644
--- a/chrome/common/extensions/docs/static/experimental.commands.html
+++ b/chrome/common/extensions/docs/static/commands.html
@@ -10,16 +10,14 @@ or sending a command to the extension.
<h2 id="manifest">Manifest</h2>
<p>
-In addition to the "experimental" permission you must declare the "commands"
-permission in your extension's manifest to use this API and set manifest_version
-to (at least) 2.
+You must declare the "commands" permission in your extension's manifest to use
+this API and set manifest_version to (at least) 2.
</p>
<pre>{
"name": "My extension",
...
<b> "permissions": [
- "experimental",
"commands",
]</b>,
...
@@ -67,7 +65,7 @@ defined in the manifest (except for '_execute_browser_action' and
'_execute_page_action') via onCommand.addListener. For example:</p>
<pre>
-chrome.experimental.commands.onCommand.addListener(function(command) {
+chrome.commands.onCommand.addListener(function(command) {
console.log('Command:', command);
});
</pre>
diff --git a/chrome/common/extensions_api_resources.grd b/chrome/common/extensions_api_resources.grd
index ff48f8d..23c83de 100644
--- a/chrome/common/extensions_api_resources.grd
+++ b/chrome/common/extensions_api_resources.grd
@@ -15,6 +15,7 @@
<include name="IDR_EXTENSION_API_JSON_BROWSINGDATA" file="extensions\api\browsing_data.json" type="BINDATA" />
<include name="IDR_EXTENSION_API_JSON_CHROMEOSINFOPRIVATE" file="extensions\api\chromeos_info_private.json" type="BINDATA" />
<include name="IDR_EXTENSION_API_JSON_CLOUDPRINTPRIVATE" file="extensions\api\cloud_print_private.json" type="BINDATA" />
+ <include name="IDR_EXTENSION_API_JSON_COMMANDS" file="extensions\api\commands.json" type="BINDATA" />
<include name="IDR_EXTENSION_API_JSON_CONTENTSETTINGS" file="extensions\api\content_settings.json" type="BINDATA" />
<include name="IDR_EXTENSION_API_JSON_CONTEXTMENUS" file="extensions\api\context_menus.json" type="BINDATA" />
<include name="IDR_EXTENSION_API_JSON_COOKIES" file="extensions\api\cookies.json" type="BINDATA" />
@@ -26,7 +27,6 @@
<include name="IDR_EXTENSION_API_JSON_EXPERIMENTAL_ACCESSIBILITY" file="extensions\api\experimental_accessibility.json" type="BINDATA" />
<include name="IDR_EXTENSION_API_JSON_EXPERIMENTAL_APP" file="extensions\api\experimental_app.json" type="BINDATA" />
<include name="IDR_EXTENSION_API_JSON_EXPERIMENTAL_BOOKMARKMANAGER" file="extensions\api\experimental_bookmark_manager.json" type="BINDATA" />
- <include name="IDR_EXTENSION_API_JSON_EXPERIMENTAL_COMMANDS" file="extensions\api\experimental_commands.json" type="BINDATA" />
<include name="IDR_EXTENSION_API_JSON_EXPERIMENTAL_INFOBARS" file="extensions\api\experimental_infobars.json" type="BINDATA" />
<include name="IDR_EXTENSION_API_JSON_EXPERIMENTAL_INPUT_VIRTUALKEYBOARD" file="extensions\api\experimental_input_virtual_keyboard.json" type="BINDATA" />
<include name="IDR_EXTENSION_API_JSON_EXPERIMENTAL_OFFSCREENTABS" file="extensions\api\experimental_offscreen_tabs.json" type="BINDATA" />
diff --git a/chrome/test/data/extensions/api_test/keybinding/basics/background.js b/chrome/test/data/extensions/api_test/keybinding/basics/background.js
index adad457..c1bc28b 100644
--- a/chrome/test/data/extensions/api_test/keybinding/basics/background.js
+++ b/chrome/test/data/extensions/api_test/keybinding/basics/background.js
@@ -8,7 +8,7 @@ chrome.browserAction.onClicked.addListener(function(windowId) {
});
// Called when the user activates the command.
-chrome.experimental.commands.onCommand.addListener(function(command) {
+chrome.commands.onCommand.addListener(function(command) {
chrome.tabs.executeScript(null, { code: "document.body.bgColor='blue'" });
});
diff --git a/chrome/test/data/extensions/api_test/keybinding/basics/manifest.json b/chrome/test/data/extensions/api_test/keybinding/basics/manifest.json
index f7b5c60..218d52f 100644
--- a/chrome/test/data/extensions/api_test/keybinding/basics/manifest.json
+++ b/chrome/test/data/extensions/api_test/keybinding/basics/manifest.json
@@ -6,7 +6,7 @@
"scripts": ["background.js"]
},
"permissions": [
- "tabs", "http://*/*", "experimental", "commands"
+ "tabs", "http://*/*", "commands"
],
"browser_action": {
"default_title": "Make this page red",
diff --git a/chrome/test/data/extensions/api_test/keybinding/conflicting/background.js b/chrome/test/data/extensions/api_test/keybinding/conflicting/background.js
index d321b2f..1b571f3 100644
--- a/chrome/test/data/extensions/api_test/keybinding/conflicting/background.js
+++ b/chrome/test/data/extensions/api_test/keybinding/conflicting/background.js
@@ -8,7 +8,7 @@ chrome.browserAction.onClicked.addListener(function(windowId) {
});
// Called when the user activates the command.
-chrome.experimental.commands.onCommand.addListener(function(command) {
+chrome.commands.onCommand.addListener(function(command) {
chrome.tabs.executeScript(null, { code: "document.body.bgColor='yellow'" });
});
diff --git a/chrome/test/data/extensions/api_test/keybinding/conflicting/manifest.json b/chrome/test/data/extensions/api_test/keybinding/conflicting/manifest.json
index 28bdc96..046e84f 100644
--- a/chrome/test/data/extensions/api_test/keybinding/conflicting/manifest.json
+++ b/chrome/test/data/extensions/api_test/keybinding/conflicting/manifest.json
@@ -6,7 +6,7 @@
"scripts": ["background.js"]
},
"permissions": [
- "tabs", "http://*/*", "experimental", "commands"
+ "tabs", "http://*/*", "commands"
],
"browser_action": {
"default_title": "Make this page green"
diff --git a/chrome/test/data/extensions/api_test/keybinding/page_action/manifest.json b/chrome/test/data/extensions/api_test/keybinding/page_action/manifest.json
index a2c9501..7ff2330 100644
--- a/chrome/test/data/extensions/api_test/keybinding/page_action/manifest.json
+++ b/chrome/test/data/extensions/api_test/keybinding/page_action/manifest.json
@@ -6,7 +6,7 @@
"scripts": ["background.js"]
},
"permissions": [
- "tabs", "http://*/*", "experimental", "commands"
+ "tabs", "http://*/*", "commands"
],
"page_action": {
"default_title": "Make this page red",
diff --git a/chrome/test/data/extensions/api_test/keybinding/script_badge/manifest.json b/chrome/test/data/extensions/api_test/keybinding/script_badge/manifest.json
index adcba36..dedc3d2 100644
--- a/chrome/test/data/extensions/api_test/keybinding/script_badge/manifest.json
+++ b/chrome/test/data/extensions/api_test/keybinding/script_badge/manifest.json
@@ -11,7 +11,7 @@
}
},
"permissions": [
- "tabs", "http://*/*", "experimental", "commands"
+ "tabs", "http://*/*", "commands"
],
"script_badge": {
"default_popup": "popup.html"