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 f3c99f38185bf43dda49bc74114c17665a6bb049..cfe390465a24ea6a9ba6fd789e61550b2d5c2a80 100644 |
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/panel.js |
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/panel.js |
@@ -444,6 +444,21 @@ Panel.onOpenMenus = function(opt_event, opt_activateMenuTitle) { |
Panel.addNodeMenu(menuTitle, node, predicate, async); |
} |
+ // Add custom actions. |
+ var customActionsMenu = Panel.addMenu('panel_menu_custom_actions'); |
+ if (node.customActions && node.customActions.length > 0) { |
+ for (var i = 0; i < node.customActions.length; i++) { |
+ var customAction = node.customActions[i]; |
+ customActionsMenu.addMenuItem(customAction.description, |
+ '' /* menuItemShortcut */, '' /* menuItemBraille */, |
+ node.performCustomAction.bind(node, customAction.id)); |
+ } |
+ } else { |
David Tseng
2017/06/06 18:12:39
I would prefer not adding the menu at all.
yawano
2017/06/08 09:25:28
Done. Changed not to show the menu if there is no
|
+ customActionsMenu.addMenuItem(Msgs.getMsg('panel_menu_item_none'), |
+ '' /* menuItemShortcut */, '' /* menuItemBraille */, |
+ null /* callback */); |
+ } |
+ |
// Activate either the specified menu or the first menu. |
var selectedMenu = Panel.menus_[0]; |
for (var i = 0; i < Panel.menus_.length; i++) { |