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

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

Issue 2350103003: Added Home, end, PageUp, PageDown support in the ChromeVox menu (Closed)
Patch Set: Updated documentation of scrollToTop and scrollToBottom Created 4 years, 3 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
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/cvox2/background/panel.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview A drop-down menu in the ChromeVox panel. 6 * @fileoverview A drop-down menu in the ChromeVox panel.
7 */ 7 */
8 8
9 goog.provide('PanelMenu'); 9 goog.provide('PanelMenu');
10 goog.provide('PanelNodeMenu'); 10 goog.provide('PanelNodeMenu');
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 if (delta >= 0) 162 if (delta >= 0)
163 this.activeIndex_ = 0; 163 this.activeIndex_ = 0;
164 else 164 else
165 this.activeIndex_ = this.menus_.length - 1; 165 this.activeIndex_ = this.menus_.length - 1;
166 } 166 }
167 167
168 this.items_[this.activeIndex_].element.focus(); 168 this.items_[this.activeIndex_].element.focus();
169 }, 169 },
170 170
171 /** 171 /**
172 * Sets the active menu item index to be 0.
173 */
174 scrollToTop: function() {
175 this.activeIndex_ = 0;
176 this.items_[this.activeIndex_].element.focus();
177 },
178
179 /**
180 * Sets the active menu item index to be the last index.
181 */
182 scrollToBottom: function() {
183 this.activeIndex_ = this.items_.length - 1;
184 this.items_[this.activeIndex_].element.focus();
185 },
186
187 /**
172 * Get the callback for the active menu item. 188 * Get the callback for the active menu item.
173 * @return {Function} The callback. 189 * @return {Function} The callback.
174 */ 190 */
175 getCallbackForCurrentItem: function() { 191 getCallbackForCurrentItem: function() {
176 if (this.activeIndex_ >= 0 && this.activeIndex_ < this.items_.length) { 192 if (this.activeIndex_ >= 0 && this.activeIndex_ < this.items_.length) {
177 return this.items_[this.activeIndex_].callback; 193 return this.items_[this.activeIndex_].callback;
178 } 194 }
179 return null; 195 return null;
180 }, 196 },
181 197
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 PanelNodeMenu.prototype = { 265 PanelNodeMenu.prototype = {
250 __proto__: PanelMenu.prototype, 266 __proto__: PanelMenu.prototype,
251 267
252 /** @override */ 268 /** @override */
253 activate: function() { 269 activate: function() {
254 var activeItem = this.activeIndex_; 270 var activeItem = this.activeIndex_;
255 PanelMenu.prototype.activate.call(this); 271 PanelMenu.prototype.activate.call(this);
256 this.activateItem(activeItem); 272 this.activateItem(activeItem);
257 } 273 }
258 }; 274 };
OLDNEW
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/cvox2/background/panel.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698