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

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

Issue 2008773002: Begin using ChromeVox Next to read tab and window titles. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 this.addListener_(e.alert, this.onAlert); 46 this.addListener_(e.alert, this.onAlert);
47 this.addListener_(e.ariaAttributeChanged, this.onEventIfInRange); 47 this.addListener_(e.ariaAttributeChanged, this.onEventIfInRange);
48 this.addListener_(e.checkedStateChanged, this.onEventIfInRange); 48 this.addListener_(e.checkedStateChanged, this.onEventIfInRange);
49 this.addListener_(e.focus, this.onFocus); 49 this.addListener_(e.focus, this.onFocus);
50 this.addListener_(e.hover, this.onEventWithFlushedOutput); 50 this.addListener_(e.hover, this.onEventWithFlushedOutput);
51 this.addListener_(e.loadComplete, this.onLoadComplete); 51 this.addListener_(e.loadComplete, this.onLoadComplete);
52 this.addListener_(e.menuEnd, this.onMenuEnd); 52 this.addListener_(e.menuEnd, this.onMenuEnd);
53 this.addListener_(e.menuListItemSelected, this.onEventIfSelected); 53 this.addListener_(e.menuListItemSelected, this.onEventIfSelected);
54 this.addListener_(e.menuStart, this.onMenuStart); 54 this.addListener_(e.menuStart, this.onMenuStart);
55 this.addListener_(e.scrollPositionChanged, this.onScrollPositionChanged); 55 this.addListener_(e.scrollPositionChanged, this.onScrollPositionChanged);
56 this.addListener_(e.selection, this.onEventWithFlushedOutput); 56 this.addListener_(e.selection, this.onSelection);
57 this.addListener_(e.textChanged, this.onTextChanged); 57 this.addListener_(e.textChanged, this.onTextChanged);
58 this.addListener_(e.textSelectionChanged, this.onTextSelectionChanged); 58 this.addListener_(e.textSelectionChanged, this.onTextSelectionChanged);
59 this.addListener_(e.valueChanged, this.onValueChanged); 59 this.addListener_(e.valueChanged, this.onValueChanged);
60 60
61 AutomationObjectConstructorInstaller.init(node, function() { 61 AutomationObjectConstructorInstaller.init(node, function() {
62 chrome.automation.getFocus((function(focus) { 62 chrome.automation.getFocus((function(focus) {
63 if (ChromeVoxState.instance.mode != ChromeVoxMode.FORCE_NEXT) 63 if (ChromeVoxState.instance.mode != ChromeVoxMode.FORCE_NEXT)
64 return; 64 return;
65 65
66 if (focus) { 66 if (focus) {
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 if (ChromeVoxState.instance.currentRange && 238 if (ChromeVoxState.instance.currentRange &&
239 ChromeVoxState.instance.currentRange.start.node.root == focus.root) 239 ChromeVoxState.instance.currentRange.start.node.root == focus.root)
240 return; 240 return;
241 241
242 ChromeVoxState.instance.setCurrentRange(cursors.Range.fromNode(focus)); 242 ChromeVoxState.instance.setCurrentRange(cursors.Range.fromNode(focus));
243 new Output().withRichSpeechAndBraille( 243 new Output().withRichSpeechAndBraille(
244 ChromeVoxState.instance.currentRange, null, evt.type).go(); 244 ChromeVoxState.instance.currentRange, null, evt.type).go();
245 }).bind(this)); 245 }).bind(this));
246 }, 246 },
247 247
248 248 /**
249 /**
250 * Provides all feedback once a text changed event fires. 249 * Provides all feedback once a text changed event fires.
251 * @param {!AutomationEvent} evt 250 * @param {!AutomationEvent} evt
252 */ 251 */
253 onTextChanged: function(evt) { 252 onTextChanged: function(evt) {
254 if (evt.target.state.editable) 253 if (evt.target.state.editable)
255 this.onEditableChanged_(evt); 254 this.onEditableChanged_(evt);
256 }, 255 },
257 256
258 /** 257 /**
259 * Provides all feedback once a text selection changed event fires. 258 * Provides all feedback once a text selection changed event fires.
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 onScrollPositionChanged: function(evt) { 329 onScrollPositionChanged: function(evt) {
331 if (ChromeVoxState.instance.mode === ChromeVoxMode.CLASSIC) 330 if (ChromeVoxState.instance.mode === ChromeVoxMode.CLASSIC)
332 return; 331 return;
333 332
334 var currentRange = ChromeVoxState.instance.currentRange; 333 var currentRange = ChromeVoxState.instance.currentRange;
335 if (currentRange) 334 if (currentRange)
336 new Output().withLocation(currentRange, null, evt.type).go(); 335 new Output().withLocation(currentRange, null, evt.type).go();
337 }, 336 },
338 337
339 /** 338 /**
339 * @param {!AutomationEvent} evt
340 */
341 onSelection: function(evt) {
342 chrome.automation.getFocus(function(focus) {
343 if (!AutomationUtil.isDescendantOf(evt.target, focus))
344 return;
345 this.onEventDefault(evt);
346 }.bind(this));
347 },
348
349 /**
340 * Provides all feedback once a menu start event fires. 350 * Provides all feedback once a menu start event fires.
341 * @param {!AutomationEvent} evt 351 * @param {!AutomationEvent} evt
342 */ 352 */
343 onMenuStart: function(evt) { 353 onMenuStart: function(evt) {
344 global.backgroundObj.startExcursion(); 354 global.backgroundObj.startExcursion();
345 this.onEventDefault(evt); 355 this.onEventDefault(evt);
346 }, 356 },
347 357
348 /** 358 /**
349 * Provides all feedback once a menu end event fires. 359 * Provides all feedback once a menu end event fires.
(...skipping 24 matching lines...) Expand all
374 if (cvox.ChromeVox.isMac) 384 if (cvox.ChromeVox.isMac)
375 return; 385 return;
376 chrome.automation.getDesktop(function(desktop) { 386 chrome.automation.getDesktop(function(desktop) {
377 global.desktopAutomationHandler = new DesktopAutomationHandler(desktop); 387 global.desktopAutomationHandler = new DesktopAutomationHandler(desktop);
378 }); 388 });
379 }; 389 };
380 390
381 DesktopAutomationHandler.init_(); 391 DesktopAutomationHandler.init_();
382 392
383 }); // goog.scope 393 }); // goog.scope
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698