| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 * @unrestricted | 5 * @unrestricted |
| 6 */ | 6 */ |
| 7 Accessibility.AXTreePane = class extends Accessibility.AccessibilitySubPane { | 7 Accessibility.AXTreePane = class extends Accessibility.AccessibilitySubPane { |
| 8 /** | 8 /** |
| 9 * @param {!Accessibility.AccessibilitySidebarView} axSidebarView | 9 * @param {!Accessibility.AccessibilitySidebarView} axSidebarView |
| 10 */ | 10 */ |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 // Pass an empty title, the title gets made later in onattach. | 172 // Pass an empty title, the title gets made later in onattach. |
| 173 super(''); | 173 super(''); |
| 174 | 174 |
| 175 /** @type {!Accessibility.AccessibilityNode} */ | 175 /** @type {!Accessibility.AccessibilityNode} */ |
| 176 this._axNode = axNode; | 176 this._axNode = axNode; |
| 177 | 177 |
| 178 /** @type {!Accessibility.AXTreePane} */ | 178 /** @type {!Accessibility.AXTreePane} */ |
| 179 this._treePane = treePane; | 179 this._treePane = treePane; |
| 180 | 180 |
| 181 this.selectable = true; | 181 this.selectable = true; |
| 182 this._hovered = false; |
| 182 | 183 |
| 183 this._inspectNodeButton = new Accessibility.InspectNodeButton(axNode, treePa
ne); | 184 this._inspectNodeButton = new Accessibility.InspectNodeButton(axNode, treePa
ne); |
| 185 this.listItemElement.addEventListener('mousemove', this._onmousemove.bind(th
is), false); |
| 186 this.listItemElement.addEventListener('mouseleave', this._onmouseleave.bind(
this), false); |
| 184 } | 187 } |
| 185 | 188 |
| 186 /** | 189 /** |
| 190 * @param {boolean} x |
| 191 */ |
| 192 setHovered(x) { |
| 193 if (this._hovered === x) |
| 194 return; |
| 195 this._hovered = x; |
| 196 this.listItemElement.classList.toggle('hovered', x); |
| 197 if (this._hovered) |
| 198 this._axNode.highlightDOMNode(); |
| 199 } |
| 200 |
| 201 _onmousemove(event) { |
| 202 this.setHovered(true); |
| 203 } |
| 204 |
| 205 _onmouseleave(event) { |
| 206 this.setHovered(false); |
| 207 } |
| 208 |
| 209 /** |
| 187 * @return {!Accessibility.AccessibilityNode} | 210 * @return {!Accessibility.AccessibilityNode} |
| 188 */ | 211 */ |
| 189 axNode() { | 212 axNode() { |
| 190 return this._axNode; | 213 return this._axNode; |
| 191 } | 214 } |
| 192 | 215 |
| 193 /** | 216 /** |
| 194 * @param {boolean} inspected | 217 * @param {boolean} inspected |
| 195 */ | 218 */ |
| 196 setInspected(inspected) { | 219 setInspected(inspected) { |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 continue; | 451 continue; |
| 429 } | 452 } |
| 430 siblingTreeElement = new Accessibility.AXNodeTreeElement(sibling, this._tr
eePane); | 453 siblingTreeElement = new Accessibility.AXNodeTreeElement(sibling, this._tr
eePane); |
| 431 if (foundInspectedNode) | 454 if (foundInspectedNode) |
| 432 this.appendChild(siblingTreeElement); | 455 this.appendChild(siblingTreeElement); |
| 433 else | 456 else |
| 434 this.insertChild(siblingTreeElement, nextIndex++); | 457 this.insertChild(siblingTreeElement, nextIndex++); |
| 435 } | 458 } |
| 436 } | 459 } |
| 437 }; | 460 }; |
| OLD | NEW |