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

Unified Diff: chrome/common/extensions/api/context_menus.json

Issue 1055673002: [Extensions API] Remove inline enums (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Latest master Created 5 years, 8 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 | « chrome/common/extensions/api/content_settings.json ('k') | chrome/common/extensions/api/cookies.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/api/context_menus.json
diff --git a/chrome/common/extensions/api/context_menus.json b/chrome/common/extensions/api/context_menus.json
index 3a8c2818663dbac61cae7f627418699450910dbb..778d7a2783cb7f42a1547a20365382b68c9a6491 100644
--- a/chrome/common/extensions/api/context_menus.json
+++ b/chrome/common/extensions/api/context_menus.json
@@ -12,6 +12,20 @@
"description": "The maximum number of top level extension items that can be added to an extension action context menu. Any items beyond this limit will be ignored."
}
},
+ "types": [
+ {
+ "id": "ContextType",
+ "type": "string",
+ "enum": ["all", "page", "frame", "selection", "link", "editable", "image", "video", "audio", "launcher", "browser_action", "page_action"],
+ "description": "The different contexts a menu can appear in. Specifying ['all'] is equivalent to the combination of all other contexts except for 'launcher'. The 'launcher' context is only supported by apps and is used to add menu items to the context menu that appears when clicking on the app icon in the launcher/taskbar/dock/etc. Different platforms might put limitations on what is actually supported in a launcher context menu."
+ },
+ {
+ "id": "ItemType",
+ "type": "string",
+ "enum": ["normal", "checkbox", "radio", "separator"],
+ "description": "The type of menu item."
+ }
+ ],
"functions": [
{
"name": "create",
@@ -30,8 +44,7 @@
"name": "createProperties",
"properties": {
"type": {
- "type": "string",
- "enum": ["normal", "checkbox", "radio", "separator"],
+ "$ref": "ItemType",
"optional": true,
"description": "The type of menu item. Defaults to 'normal' if not specified."
},
@@ -53,12 +66,11 @@
"contexts": {
"type": "array",
"items": {
- "type": "string",
- "enum": ["all", "page", "frame", "selection", "link", "editable", "image", "video", "audio", "launcher", "browser_action", "page_action"]
+ "$ref": "ContextType"
},
"minItems": 1,
"optional": true,
- "description": "List of contexts this menu item will appear in. Defaults to ['page'] if not specified. Specifying ['all'] is equivalent to the combination of all other contexts except for 'launcher'. The 'launcher' context is only supported by apps and is used to add menu items to the context menu that appears when clicking on the app icon in the launcher/taskbar/dock/etc. Different platforms might put limitations on what is actually supported in a launcher context menu."
+ "description": "List of contexts this menu item will appear in. Defaults to ['page'] if not specified."
},
"onclick": {
"type": "function",
@@ -133,8 +145,7 @@
"description": "The properties to update. Accepts the same values as the create function.",
"properties": {
"type": {
- "type": "string",
- "enum": ["normal", "checkbox", "radio", "separator"],
+ "$ref": "ItemType",
"optional": true
},
"title": {
@@ -148,8 +159,7 @@
"contexts": {
"type": "array",
"items": {
- "type": "string",
- "enum": ["all", "page", "frame", "selection", "link", "editable", "image", "video", "audio", "launcher", "browser_action", "page_action"]
+ "$ref": "ContextType"
},
"minItems": 1,
"optional": true
« no previous file with comments | « chrome/common/extensions/api/content_settings.json ('k') | chrome/common/extensions/api/cookies.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698