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

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

Issue 2873373005: Add custom action support (Closed)
Patch Set: Removed MinVersion from struct. 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 f3c99f38185bf43dda49bc74114c17665a6bb049..78608f8f2b76d36a317ad9a5ee2a58b6383d2b53 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/panel.js
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/panel.js
@@ -444,6 +444,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