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

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

Issue 2010493004: Ignore duplicate HOVER events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Check for valid currentRange Created 4 years, 6 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 | « no previous file | 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 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 29 matching lines...) Expand all
40 * @private 40 * @private
41 */ 41 */
42 this.lastValueChanged_ = new Date(0); 42 this.lastValueChanged_ = new Date(0);
43 43
44 var e = EventType; 44 var e = EventType;
45 this.addListener_(e.activedescendantchanged, this.onActiveDescendantChanged); 45 this.addListener_(e.activedescendantchanged, this.onActiveDescendantChanged);
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.onHover);
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.onSelection); 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
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 153
154 /** 154 /**
155 * @param {!AutomationEvent} evt 155 * @param {!AutomationEvent} evt
156 */ 156 */
157 onEventWithFlushedOutput: function(evt) { 157 onEventWithFlushedOutput: function(evt) {
158 Output.flushNextSpeechUtterance(); 158 Output.flushNextSpeechUtterance();
159 this.onEventDefault(evt); 159 this.onEventDefault(evt);
160 }, 160 },
161 161
162 /** 162 /**
163 * @param {!AutomationEvent} evt
164 */
165 onHover: function(evt) {
166 if (ChromeVoxState.instance.currentRange &&
167 evt.target == ChromeVoxState.instance.currentRange.start.node)
168 return;
169 Output.flushNextSpeechUtterance();
170 this.onEventDefault(evt);
171 },
172
173 /**
163 * Makes an announcement without changing focus. 174 * Makes an announcement without changing focus.
164 * @param {!AutomationEvent} evt 175 * @param {!AutomationEvent} evt
165 */ 176 */
166 onActiveDescendantChanged: function(evt) { 177 onActiveDescendantChanged: function(evt) {
167 if (!evt.target.activeDescendant) 178 if (!evt.target.activeDescendant)
168 return; 179 return;
169 this.onEventDefault(new chrome.automation.AutomationEvent( 180 this.onEventDefault(new chrome.automation.AutomationEvent(
170 EventType.focus, evt.target.activeDescendant)); 181 EventType.focus, evt.target.activeDescendant));
171 }, 182 },
172 183
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 if (cvox.ChromeVox.isMac) 398 if (cvox.ChromeVox.isMac)
388 return; 399 return;
389 chrome.automation.getDesktop(function(desktop) { 400 chrome.automation.getDesktop(function(desktop) {
390 global.desktopAutomationHandler = new DesktopAutomationHandler(desktop); 401 global.desktopAutomationHandler = new DesktopAutomationHandler(desktop);
391 }); 402 });
392 }; 403 };
393 404
394 DesktopAutomationHandler.init_(); 405 DesktopAutomationHandler.init_();
395 406
396 }); // goog.scope 407 }); // goog.scope
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698