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

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: Made test expectations approximate 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 * @override
257 */
258 onScrollPositionChanged: function(evt) {
259 var currentRange = global.backgroundObj.currentRange;
260 if (currentRange)
261 new Output().withLocation(currentRange, null, evt.type).go();
262 },
263
264 /**
255 * Create an editable text handler for the given node if needed. 265 * Create an editable text handler for the given node if needed.
256 * @param {Object} node 266 * @param {Object} node
257 */ 267 */
258 createEditableTextHandlerIfNeeded_: function(node) { 268 createEditableTextHandlerIfNeeded_: function(node) {
259 if (!this.editableTextHandler_ || 269 if (!this.editableTextHandler_ ||
260 node != global.backgroundObj.currentRange.start.node) { 270 node != global.backgroundObj.currentRange.start.node) {
261 var start = node.textSelStart; 271 var start = node.textSelStart;
262 var end = node.textSelEnd; 272 var end = node.textSelEnd;
263 if (start > end) { 273 if (start > end) {
264 var tempOffset = end; 274 var tempOffset = end;
(...skipping 20 matching lines...) Expand all
285 if (cvox.ChromeVox.isMac) 295 if (cvox.ChromeVox.isMac)
286 return; 296 return;
287 chrome.automation.getDesktop(function(desktop) { 297 chrome.automation.getDesktop(function(desktop) {
288 global.desktopAutomationHandler = new DesktopAutomationHandler(desktop); 298 global.desktopAutomationHandler = new DesktopAutomationHandler(desktop);
289 }); 299 });
290 }; 300 };
291 301
292 DesktopAutomationHandler.init_(); 302 DesktopAutomationHandler.init_();
293 303
294 }); // goog.scope 304 }); // goog.scope
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698