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