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

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

Issue 2873373005: Add custom action support (Closed)
Patch Set: Fix a few files. Created 3 years, 7 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 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++) {

Powered by Google App Engine
This is Rietveld 408576698