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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 /** | 123 /** |
124 * Provides all feedback once a focus event fires. | 124 * Provides all feedback once a focus event fires. |
125 * @param {Object} evt | 125 * @param {Object} evt |
126 */ | 126 */ |
127 onFocus: function(evt) { | 127 onFocus: function(evt) { |
128 // Invalidate any previous editable text handler state. | 128 // Invalidate any previous editable text handler state. |
129 this.textEditHandler_ = null; | 129 this.textEditHandler_ = null; |
130 | 130 |
131 var node = evt.target; | 131 var node = evt.target; |
132 | 132 |
133 // Discard focus events on embeddedObject nodes. | 133 // Discard focus events on embeddedObject and client nodes. |
134 if (node.role == RoleType.embeddedObject) | 134 if (node.role == RoleType.embeddedObject || node.role == RoleType.client) |
135 return; | 135 return; |
136 | 136 |
137 // It almost never makes sense to place focus directly on a rootWebArea. | 137 // It almost never makes sense to place focus directly on a rootWebArea. |
138 if (node.role == RoleType.rootWebArea) { | 138 if (node.role == RoleType.rootWebArea) { |
139 // Discard focus events for root web areas when focus was previously | 139 // Discard focus events for root web areas when focus was previously |
140 // placed on a descendant. | 140 // placed on a descendant. |
141 var currentRange = ChromeVoxState.instance.currentRange; | 141 var currentRange = ChromeVoxState.instance.currentRange; |
142 if (currentRange && currentRange.start.node.root == node) | 142 if (currentRange && currentRange.start.node.root == node) |
143 return; | 143 return; |
144 | 144 |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 if (cvox.ChromeVox.isMac) | 309 if (cvox.ChromeVox.isMac) |
310 return; | 310 return; |
311 chrome.automation.getDesktop(function(desktop) { | 311 chrome.automation.getDesktop(function(desktop) { |
312 global.desktopAutomationHandler = new DesktopAutomationHandler(desktop); | 312 global.desktopAutomationHandler = new DesktopAutomationHandler(desktop); |
313 }); | 313 }); |
314 }; | 314 }; |
315 | 315 |
316 DesktopAutomationHandler.init_(); | 316 DesktopAutomationHandler.init_(); |
317 | 317 |
318 }); // goog.scope | 318 }); // goog.scope |
OLD | NEW |