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

Side by Side Diff: chrome/browser/resources/chromeos/chromevox/cvox2/background/panel_menu_item.js

Issue 1561773002: Implement ChromeVox Next menus. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@panel_view_type
Patch Set: Address feedback Created 4 years, 11 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 /**
6 * @fileoverview An item in a drop-down menu in the ChromeVox panel.
7 */
8
9 goog.provide('PanelMenuItem');
10
11 /**
12 * @param {string} menuItemTitle The title of the menu item.
13 * @param {string} menuItemShortcut The keystrokes to select this item.
14 * @param {Function} callback The function to call if this item is selected.
15 * @constructor
16 */
17 PanelMenuItem = function(menuItemTitle, menuItemShortcut, callback) {
18 this.callback = callback;
David Tseng 2016/01/12 20:10:57 js doc
19
20 this.element = document.createElement('tr');
21 this.element.className = 'menu-item';
22 this.element.tabIndex = -1;
23 this.element.setAttribute('role', 'menuitem');
24
25 this.element.addEventListener('mouseover', (function(evt) {
26 this.element.focus();
27 }).bind(this), false);
28
29 var title = document.createElement('td');
30 title.className = 'menu-item-title';
31 title.textContent = menuItemTitle;
32 this.element.appendChild(title);
33
34 var shortcut = document.createElement('td');
35 shortcut.className = 'menu-item-shortcut';
36 shortcut.textContent = menuItemShortcut;
37 this.element.appendChild(shortcut);
38 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698