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

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

Issue 2333533003: Add a |contentEquals| method to cursors and ranges. (Closed)
Patch Set: Add a |contentEquals| method to cursors and ranges. 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/cursors_test.extjs ('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 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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 133
134 /** 134 /**
135 * @param {!AutomationEvent} evt 135 * @param {!AutomationEvent} evt
136 */ 136 */
137 onEventIfInRange: function(evt) { 137 onEventIfInRange: function(evt) {
138 if (evt.target.root.role != RoleType.desktop && 138 if (evt.target.root.role != RoleType.desktop &&
139 ChromeVoxState.instance.mode === ChromeVoxMode.CLASSIC) 139 ChromeVoxState.instance.mode === ChromeVoxMode.CLASSIC)
140 return; 140 return;
141 141
142 var prev = ChromeVoxState.instance.currentRange; 142 var prev = ChromeVoxState.instance.currentRange;
143 if (AutomationUtil.isDescendantOf(prev.start.node, evt.target) || 143 if (prev.contentEquals(cursors.Range.fromNode(evt.target)) ||
144 AutomationUtil.isDescendantOf(evt.target, prev.start.node) ||
145 evt.target.state.focused) { 144 evt.target.state.focused) {
146 // Intentionally skip setting range. 145 // Intentionally skip setting range.
147 new Output() 146 new Output()
148 .withRichSpeechAndBraille(cursors.Range.fromNode(evt.target), 147 .withRichSpeechAndBraille(cursors.Range.fromNode(evt.target),
149 prev, 148 prev,
150 Output.EventType.NAVIGATE) 149 Output.EventType.NAVIGATE)
151 .go(); 150 .go();
152 } 151 }
153 }, 152 },
154 153
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 DesktopAutomationHandler.init_ = function() { 454 DesktopAutomationHandler.init_ = function() {
456 chrome.automation.getDesktop(function(desktop) { 455 chrome.automation.getDesktop(function(desktop) {
457 ChromeVoxState.desktopAutomationHandler = 456 ChromeVoxState.desktopAutomationHandler =
458 new DesktopAutomationHandler(desktop); 457 new DesktopAutomationHandler(desktop);
459 }); 458 });
460 }; 459 };
461 460
462 DesktopAutomationHandler.init_(); 461 DesktopAutomationHandler.init_();
463 462
464 }); // goog.scope 463 }); // goog.scope
OLDNEW
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors_test.extjs ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698