| 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 * @constructor | 6 * @constructor |
| 7 * @extends {WebInspector.ThrottledWidget} | 7 * @extends {WebInspector.ThrottledWidget} |
| 8 */ | 8 */ |
| 9 WebInspector.AccessibilitySidebarView = function() | 9 WebInspector.AccessibilitySidebarView = function() |
| 10 { | 10 { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 /** | 21 /** |
| 22 * @return {?WebInspector.DOMNode} | 22 * @return {?WebInspector.DOMNode} |
| 23 */ | 23 */ |
| 24 node: function() | 24 node: function() |
| 25 { | 25 { |
| 26 return this._node; | 26 return this._node; |
| 27 }, | 27 }, |
| 28 | 28 |
| 29 /** | 29 /** |
| 30 * @override | 30 * @override |
| 31 * @param {!WebInspector.Throttler.FinishCallback} finishCallback | |
| 32 * @protected | 31 * @protected |
| 32 * @return {!Promise.<?>} |
| 33 */ | 33 */ |
| 34 doUpdate: function(finishCallback) | 34 doUpdate: function() |
| 35 { | 35 { |
| 36 /** | 36 /** |
| 37 * @param {?AccessibilityAgent.AXNode} accessibilityNode | 37 * @param {?AccessibilityAgent.AXNode} accessibilityNode |
| 38 * @this {WebInspector.AccessibilitySidebarView} | 38 * @this {WebInspector.AccessibilitySidebarView} |
| 39 */ | 39 */ |
| 40 function accessibilityNodeCallback(accessibilityNode) | 40 function accessibilityNodeCallback(accessibilityNode) |
| 41 { | 41 { |
| 42 if (this._computedTextSubPane) | 42 if (this._computedTextSubPane) |
| 43 this._computedTextSubPane.setAXNode(accessibilityNode); | 43 this._computedTextSubPane.setAXNode(accessibilityNode); |
| 44 if (this._axNodeSubPane) | 44 if (this._axNodeSubPane) |
| 45 this._axNodeSubPane.setAXNode(accessibilityNode); | 45 this._axNodeSubPane.setAXNode(accessibilityNode); |
| 46 } | 46 } |
| 47 var node = this.node(); | 47 var node = this.node(); |
| 48 WebInspector.AccessibilityModel.fromTarget(node.target()).getAXNode(node
.id) | 48 return WebInspector.AccessibilityModel.fromTarget(node.target()).getAXNo
de(node.id) |
| 49 .then(accessibilityNodeCallback.bind(this)) | 49 .then(accessibilityNodeCallback.bind(this)) |
| 50 .then(finishCallback) | |
| 51 .catch(/** @type {function()} */(finishCallback)); | |
| 52 }, | 50 }, |
| 53 | 51 |
| 54 /** | 52 /** |
| 55 * @override | 53 * @override |
| 56 */ | 54 */ |
| 57 wasShown: function() | 55 wasShown: function() |
| 58 { | 56 { |
| 59 WebInspector.ThrottledWidget.prototype.wasShown.call(this); | 57 WebInspector.ThrottledWidget.prototype.wasShown.call(this); |
| 60 | 58 |
| 61 if (!this._sidebarPaneStack) { | 59 if (!this._sidebarPaneStack) { |
| (...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 681 reasonElement = WebInspector.formatLocalized("Static text node is used a
s name for ", [], ""); | 679 reasonElement = WebInspector.formatLocalized("Static text node is used a
s name for ", [], ""); |
| 682 break; | 680 break; |
| 683 case "uninteresting": | 681 case "uninteresting": |
| 684 reasonElement = WebInspector.formatLocalized("Element not interesting fo
r accessibility.", [], "") | 682 reasonElement = WebInspector.formatLocalized("Element not interesting fo
r accessibility.", [], "") |
| 685 break; | 683 break; |
| 686 } | 684 } |
| 687 if (reasonElement) | 685 if (reasonElement) |
| 688 reasonElement.classList.add("ax-reason"); | 686 reasonElement.classList.add("ax-reason"); |
| 689 return reasonElement; | 687 return reasonElement; |
| 690 } | 688 } |
| OLD | NEW |