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

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

Issue 1458723002: Finish implementing ChromeVox Next active indicator. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@load_key_map
Patch Set: Addressed feedback and added tests Created 5 years, 1 month 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 Handles automation from a desktop automation node. 6 * @fileoverview Handles automation from a desktop automation node.
7 */ 7 */
8 8
9 goog.provide('DesktopAutomationHandler'); 9 goog.provide('DesktopAutomationHandler');
10 10
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 // Value change events fire on web text fields and text areas when pressing 245 // Value change events fire on web text fields and text areas when pressing
246 // enter; suppress them. 246 // enter; suppress them.
247 if (!global.backgroundObj.currentRange || 247 if (!global.backgroundObj.currentRange ||
248 evt.target.role != RoleType.textField) { 248 evt.target.role != RoleType.textField) {
249 this.onEventDefault(evt); 249 this.onEventDefault(evt);
250 global.backgroundObj.currentRange = cursors.Range.fromNode(evt.target); 250 global.backgroundObj.currentRange = cursors.Range.fromNode(evt.target);
251 } 251 }
252 }, 252 },
253 253
254 /** 254 /**
255 * Handle updating the active indicator when the document scrolls.
256 * @param {Object} evt
Peter Lundblad 2015/11/23 13:39:08 nit: I think this @param is redundant given overri
dmazzoni 2015/11/23 17:22:49 Done.
257 * @override
258 */
259 onScrollPositionChanged: function(evt) {
260 var currentRange = global.backgroundObj.currentRange;
261 if (currentRange)
262 new Output().withLocation(currentRange, null, evt.type).go();
263 },
264
265 /**
255 * Create an editable text handler for the given node if needed. 266 * Create an editable text handler for the given node if needed.
256 * @param {Object} node 267 * @param {Object} node
257 */ 268 */
258 createEditableTextHandlerIfNeeded_: function(node) { 269 createEditableTextHandlerIfNeeded_: function(node) {
259 if (!this.editableTextHandler_ || 270 if (!this.editableTextHandler_ ||
260 node != global.backgroundObj.currentRange.start.node) { 271 node != global.backgroundObj.currentRange.start.node) {
261 var start = node.textSelStart; 272 var start = node.textSelStart;
262 var end = node.textSelEnd; 273 var end = node.textSelEnd;
263 if (start > end) { 274 if (start > end) {
264 var tempOffset = end; 275 var tempOffset = end;
(...skipping 20 matching lines...) Expand all
285 if (cvox.ChromeVox.isMac) 296 if (cvox.ChromeVox.isMac)
286 return; 297 return;
287 chrome.automation.getDesktop(function(desktop) { 298 chrome.automation.getDesktop(function(desktop) {
288 global.desktopAutomationHandler = new DesktopAutomationHandler(desktop); 299 global.desktopAutomationHandler = new DesktopAutomationHandler(desktop);
289 }); 300 });
290 }; 301 };
291 302
292 DesktopAutomationHandler.init_(); 303 DesktopAutomationHandler.init_();
293 304
294 }); // goog.scope 305 }); // goog.scope
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698