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

Unified Diff: chrome/browser/resources/chromeos/chromevox/cvox2/background/panel.js

Issue 2873373005: Add custom action support (Closed)
Patch Set: Migrate to DataObjectBuilder. Created 3 years, 6 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: chrome/browser/resources/chromeos/chromevox/cvox2/background/panel.js
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/panel.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/panel.js
index a7ac16c46c76fc0ccb20ca07f450b5cd633981c6..c77635b5152c5427ccc6da4d391395bae33b6ce0 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/panel.js
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/panel.js
@@ -446,6 +446,17 @@ Panel.onOpenMenus = function(opt_event, opt_activateMenuTitle) {
Panel.addNodeMenu(menuTitle, node, predicate, async);
}
+ // Add actions menu if there are custom actions.
+ if (node.customActions && node.customActions.length > 0) {
+ var actionsMenu = Panel.addMenu('panel_menu_actions');
+ for (var i = 0; i < node.customActions.length; i++) {
+ var customAction = node.customActions[i];
+ actionsMenu.addMenuItem(customAction.description,
+ '' /* menuItemShortcut */, '' /* menuItemBraille */,
+ node.performCustomAction.bind(node, customAction.id));
+ }
+ }
+
// Activate either the specified menu or the first menu.
var selectedMenu = Panel.menus_[0];
for (var i = 0; i < Panel.menus_.length; i++) {

Powered by Google App Engine
This is Rietveld 408576698