OLD | NEW |
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 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 new Output().withLocation(currentRange, null, evt.type).go(); | 335 new Output().withLocation(currentRange, null, evt.type).go(); |
336 }, | 336 }, |
337 | 337 |
338 /** | 338 /** |
339 * @param {!AutomationEvent} evt | 339 * @param {!AutomationEvent} evt |
340 */ | 340 */ |
341 onSelection: function(evt) { | 341 onSelection: function(evt) { |
342 chrome.automation.getFocus(function(focus) { | 342 chrome.automation.getFocus(function(focus) { |
343 // Some cases (e.g. in overview mode), require overriding the assumption | 343 // Some cases (e.g. in overview mode), require overriding the assumption |
344 // that focus is an ancestor of a selection target. | 344 // that focus is an ancestor of a selection target. |
345 var override = | 345 var override = evt.target.role == RoleType.menuItem || |
346 evt.target.root == focus.root && focus.root.role == RoleType.desktop; | 346 (evt.target.root == focus.root && |
| 347 focus.root.role == RoleType.desktop); |
| 348 Output.flushNextSpeechUtterance(); |
347 if (override || AutomationUtil.isDescendantOf(evt.target, focus)) | 349 if (override || AutomationUtil.isDescendantOf(evt.target, focus)) |
348 this.onEventDefault(evt); | 350 this.onEventDefault(evt); |
349 }.bind(this)); | 351 }.bind(this)); |
350 }, | 352 }, |
351 | 353 |
352 /** | 354 /** |
353 * Provides all feedback once a menu start event fires. | 355 * Provides all feedback once a menu start event fires. |
354 * @param {!AutomationEvent} evt | 356 * @param {!AutomationEvent} evt |
355 */ | 357 */ |
356 onMenuStart: function(evt) { | 358 onMenuStart: function(evt) { |
(...skipping 30 matching lines...) Expand all Loading... |
387 if (cvox.ChromeVox.isMac) | 389 if (cvox.ChromeVox.isMac) |
388 return; | 390 return; |
389 chrome.automation.getDesktop(function(desktop) { | 391 chrome.automation.getDesktop(function(desktop) { |
390 global.desktopAutomationHandler = new DesktopAutomationHandler(desktop); | 392 global.desktopAutomationHandler = new DesktopAutomationHandler(desktop); |
391 }); | 393 }); |
392 }; | 394 }; |
393 | 395 |
394 DesktopAutomationHandler.init_(); | 396 DesktopAutomationHandler.init_(); |
395 | 397 |
396 }); // goog.scope | 398 }); // goog.scope |
OLD | NEW |