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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 /** | 237 /** |
238 * Provides all feedback once a focus event fires. | 238 * Provides all feedback once a focus event fires. |
239 * @param {!AutomationEvent} evt | 239 * @param {!AutomationEvent} evt |
240 */ | 240 */ |
241 onFocus: function(evt) { | 241 onFocus: function(evt) { |
242 // Invalidate any previous editable text handler state. | 242 // Invalidate any previous editable text handler state. |
243 this.textEditHandler_ = null; | 243 this.textEditHandler_ = null; |
244 | 244 |
245 var node = evt.target; | 245 var node = evt.target; |
246 | 246 |
247 // Discard focus events on embeddedObject and client nodes. | 247 // Discard focus events on embeddedObject. |
248 if (node.role == RoleType.embeddedObject || node.role == RoleType.client) | 248 if (node.role == RoleType.embeddedObject) |
249 return; | 249 return; |
250 | 250 |
251 this.createTextEditHandlerIfNeeded_(evt.target); | 251 this.createTextEditHandlerIfNeeded_(evt.target); |
252 | 252 |
253 // Category flush speech triggered by events with no source. This includes | 253 // Category flush speech triggered by events with no source. This includes |
254 // views. | 254 // views. |
255 if (evt.eventFrom == '') | 255 if (evt.eventFrom == '') |
256 Output.forceModeForNextSpeechUtterance(cvox.QueueMode.CATEGORY_FLUSH); | 256 Output.forceModeForNextSpeechUtterance(cvox.QueueMode.CATEGORY_FLUSH); |
257 this.onEventDefault(new chrome.automation.AutomationEvent( | 257 this.onEventDefault(new chrome.automation.AutomationEvent( |
258 EventType.focus, node, evt.eventFrom)); | 258 EventType.focus, node, evt.eventFrom)); |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 DesktopAutomationHandler.init_ = function() { | 467 DesktopAutomationHandler.init_ = function() { |
468 chrome.automation.getDesktop(function(desktop) { | 468 chrome.automation.getDesktop(function(desktop) { |
469 ChromeVoxState.desktopAutomationHandler = | 469 ChromeVoxState.desktopAutomationHandler = |
470 new DesktopAutomationHandler(desktop); | 470 new DesktopAutomationHandler(desktop); |
471 }); | 471 }); |
472 }; | 472 }; |
473 | 473 |
474 DesktopAutomationHandler.init_(); | 474 DesktopAutomationHandler.init_(); |
475 | 475 |
476 }); // goog.scope | 476 }); // goog.scope |
OLD | NEW |