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

Unified 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: Fix Ozone by only activating panel when fullscreen Created 4 years, 10 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_menu_item.js
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/panel_menu_item.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/panel_menu_item.js
new file mode 100644
index 0000000000000000000000000000000000000000..4b724ca7ec75c9dfa73f9a5e0d12006a68577c33
--- /dev/null
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/panel_menu_item.js
@@ -0,0 +1,38 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+/**
+ * @fileoverview An item in a drop-down menu in the ChromeVox panel.
+ */
+
+goog.provide('PanelMenuItem');
+
+/**
+ * @param {string} menuItemTitle The title of the menu item.
+ * @param {string} menuItemShortcut The keystrokes to select this item.
+ * @param {Function} callback The function to call if this item is selected.
+ * @constructor
+ */
+PanelMenuItem = function(menuItemTitle, menuItemShortcut, callback) {
+ this.callback = callback;
+
+ this.element = document.createElement('tr');
+ this.element.className = 'menu-item';
+ this.element.tabIndex = -1;
+ this.element.setAttribute('role', 'menuitem');
+
+ this.element.addEventListener('mouseover', (function(evt) {
+ this.element.focus();
+ }).bind(this), false);
+
+ var title = document.createElement('td');
+ title.className = 'menu-item-title';
+ title.textContent = menuItemTitle;
+ this.element.appendChild(title);
+
+ var shortcut = document.createElement('td');
+ shortcut.className = 'menu-item-shortcut';
+ shortcut.textContent = menuItemShortcut;
+ this.element.appendChild(shortcut);
+};

Powered by Google App Engine
This is Rietveld 408576698