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

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

Issue 1577973002: Merge to m48: Fix volume slider to emit value changed events and do not focus system tray it\ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2564
Patch Set: Created 4 years, 11 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/chromeos/accessibility/spoken_feedback_browsertest.cc ('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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 /** 230 /**
231 * Provides all feedback once a value changed event fires. 231 * Provides all feedback once a value changed event fires.
232 * @param {Object} evt 232 * @param {Object} evt
233 */ 233 */
234 onValueChanged: function(evt) { 234 onValueChanged: function(evt) {
235 // Don't process nodes inside of web content if ChromeVox Next is inactive. 235 // Don't process nodes inside of web content if ChromeVox Next is inactive.
236 if (evt.target.root.role != RoleType.desktop && 236 if (evt.target.root.role != RoleType.desktop &&
237 global.backgroundObj.mode === ChromeVoxMode.CLASSIC) 237 global.backgroundObj.mode === ChromeVoxMode.CLASSIC)
238 return; 238 return;
239 239
240 if (!evt.target.state.focused)
241 return;
242
243 // Value change events fire on web text fields and text areas when pressing 240 // Value change events fire on web text fields and text areas when pressing
244 // enter; suppress them. 241 // enter; suppress them.
245 if (!global.backgroundObj.currentRange || 242 if (!global.backgroundObj.currentRange ||
246 evt.target.role != RoleType.textField) { 243 evt.target.role != RoleType.textField) {
247 this.onEventDefault(evt); 244 var range = cursors.Range.fromNode(evt.target);
248 global.backgroundObj.currentRange = cursors.Range.fromNode(evt.target); 245 new Output().withSpeechAndBraille(range, range, evt.type)
246 .go();
249 } 247 }
250 }, 248 },
251 249
252 /** 250 /**
253 * Create an editable text handler for the given node if needed. 251 * Create an editable text handler for the given node if needed.
254 * @param {Object} node 252 * @param {Object} node
255 */ 253 */
256 createEditableTextHandlerIfNeeded_: function(node) { 254 createEditableTextHandlerIfNeeded_: function(node) {
257 if (!this.editableTextHandler_ || 255 if (!this.editableTextHandler_ ||
258 node != global.backgroundObj.currentRange.start.node) { 256 node != global.backgroundObj.currentRange.start.node) {
(...skipping 24 matching lines...) Expand all
283 if (cvox.ChromeVox.isMac) 281 if (cvox.ChromeVox.isMac)
284 return; 282 return;
285 chrome.automation.getDesktop(function(desktop) { 283 chrome.automation.getDesktop(function(desktop) {
286 global.desktopAutomationHandler = new DesktopAutomationHandler(desktop); 284 global.desktopAutomationHandler = new DesktopAutomationHandler(desktop);
287 }); 285 });
288 }; 286 };
289 287
290 DesktopAutomationHandler.init_(); 288 DesktopAutomationHandler.init_();
291 289
292 }); // goog.scope 290 }); // goog.scope
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698