| 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.ThrottledView} |
| 8 */ | 8 */ |
| 9 WebInspector.AccessibilitySidebarView = function() | 9 WebInspector.AccessibilitySidebarView = function() |
| 10 { | 10 { |
| 11 WebInspector.ThrottledWidget.call(this); | 11 WebInspector.ThrottledView.call(this, WebInspector.UIString("Accessibility")
); |
| 12 this._axNodeSubPane = null; | 12 this._axNodeSubPane = null; |
| 13 this._node = null; | 13 this._node = null; |
| 14 this._sidebarPaneStack = null; | 14 this._sidebarPaneStack = null; |
| 15 WebInspector.context.addFlavorChangeListener(WebInspector.DOMNode, this._pul
lNode, this); | 15 WebInspector.context.addFlavorChangeListener(WebInspector.DOMNode, this._pul
lNode, this); |
| 16 this._pullNode(); | 16 this._pullNode(); |
| 17 } | 17 } |
| 18 | 18 |
| 19 WebInspector.AccessibilitySidebarView.prototype = { | 19 WebInspector.AccessibilitySidebarView.prototype = { |
| 20 /** | 20 /** |
| 21 * @return {?WebInspector.DOMNode} | 21 * @return {?WebInspector.DOMNode} |
| (...skipping 22 matching lines...) Expand all Loading... |
| 44 var node = this.node(); | 44 var node = this.node(); |
| 45 return WebInspector.AccessibilityModel.fromTarget(node.target()).getAXNo
de(node.id) | 45 return WebInspector.AccessibilityModel.fromTarget(node.target()).getAXNo
de(node.id) |
| 46 .then(accessibilityNodeCallback.bind(this)) | 46 .then(accessibilityNodeCallback.bind(this)) |
| 47 }, | 47 }, |
| 48 | 48 |
| 49 /** | 49 /** |
| 50 * @override | 50 * @override |
| 51 */ | 51 */ |
| 52 wasShown: function() | 52 wasShown: function() |
| 53 { | 53 { |
| 54 WebInspector.ThrottledWidget.prototype.wasShown.call(this); | 54 WebInspector.ThrottledView.prototype.wasShown.call(this); |
| 55 | 55 |
| 56 if (!this._sidebarPaneStack) { | 56 if (!this._sidebarPaneStack) { |
| 57 this._axNodeSubPane = new WebInspector.AXNodeSubPane(); | 57 this._axNodeSubPane = new WebInspector.AXNodeSubPane(); |
| 58 this._axNodeSubPane.setNode(this.node()); | 58 this._axNodeSubPane.setNode(this.node()); |
| 59 this._axNodeSubPane.show(this.element); | 59 this._axNodeSubPane.show(this.element); |
| 60 this._axNodeSubPane.expandPane(); | |
| 61 | 60 |
| 62 this._sidebarPaneStack = new WebInspector.SidebarPaneStack(); | 61 this._sidebarPaneStack = new WebInspector.SidebarPaneStack(); |
| 63 this._sidebarPaneStack.element.classList.add("flex-auto"); | 62 this._sidebarPaneStack.element.classList.add("flex-auto"); |
| 64 this._sidebarPaneStack.show(this.element); | 63 this._sidebarPaneStack.show(this.element); |
| 65 this._sidebarPaneStack.addPane(this._axNodeSubPane); | 64 this._sidebarPaneStack.addPane(this._axNodeSubPane); |
| 66 } | 65 } |
| 67 | 66 |
| 68 WebInspector.targetManager.addModelListener(WebInspector.DOMModel, WebIn
spector.DOMModel.Events.AttrModified, this._onAttrChange, this); | 67 WebInspector.targetManager.addModelListener(WebInspector.DOMModel, WebIn
spector.DOMModel.Events.AttrModified, this._onAttrChange, this); |
| 69 WebInspector.targetManager.addModelListener(WebInspector.DOMModel, WebIn
spector.DOMModel.Events.AttrRemoved, this._onAttrChange, this); | 68 WebInspector.targetManager.addModelListener(WebInspector.DOMModel, WebIn
spector.DOMModel.Events.AttrRemoved, this._onAttrChange, this); |
| 70 WebInspector.targetManager.addModelListener(WebInspector.DOMModel, WebIn
spector.DOMModel.Events.CharacterDataModified, this._onNodeChange, this); | 69 WebInspector.targetManager.addModelListener(WebInspector.DOMModel, WebIn
spector.DOMModel.Events.CharacterDataModified, this._onNodeChange, this); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 { | 109 { |
| 111 if (!this.node()) | 110 if (!this.node()) |
| 112 return; | 111 return; |
| 113 var node = event.data; | 112 var node = event.data; |
| 114 if (this.node() !== node) | 113 if (this.node() !== node) |
| 115 return; | 114 return; |
| 116 this.update(); | 115 this.update(); |
| 117 }, | 116 }, |
| 118 | 117 |
| 119 | 118 |
| 120 __proto__: WebInspector.ThrottledWidget.prototype | 119 __proto__: WebInspector.ThrottledView.prototype |
| 121 }; | 120 }; |
| 122 | 121 |
| 123 /** | 122 /** |
| 124 * @constructor | 123 * @constructor |
| 125 * @extends {WebInspector.SidebarPane} | 124 * @extends {WebInspector.View} |
| 126 * @param {string} name | 125 * @param {string} name |
| 127 */ | 126 */ |
| 128 WebInspector.AccessibilitySubPane = function(name) | 127 WebInspector.AccessibilitySubPane = function(name) |
| 129 { | 128 { |
| 130 WebInspector.SidebarPane.call(this, name); | 129 WebInspector.View.call(this, name); |
| 131 | 130 |
| 132 this._axNode = null; | 131 this._axNode = null; |
| 133 this.registerRequiredCSS("accessibility/accessibilityNode.css"); | 132 this.registerRequiredCSS("accessibility/accessibilityNode.css"); |
| 134 } | 133 } |
| 135 | 134 |
| 136 WebInspector.AccessibilitySubPane.prototype = { | 135 WebInspector.AccessibilitySubPane.prototype = { |
| 137 /** | 136 /** |
| 138 * @param {?AccessibilityAgent.AXNode} axNode | 137 * @param {?AccessibilityAgent.AXNode} axNode |
| 139 * @protected | 138 * @protected |
| 140 */ | 139 */ |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 { | 177 { |
| 179 var treeOutline = new TreeOutlineInShadow(); | 178 var treeOutline = new TreeOutlineInShadow(); |
| 180 treeOutline.registerRequiredCSS("accessibility/accessibilityNode.css"); | 179 treeOutline.registerRequiredCSS("accessibility/accessibilityNode.css"); |
| 181 treeOutline.registerRequiredCSS("components/objectValue.css"); | 180 treeOutline.registerRequiredCSS("components/objectValue.css"); |
| 182 | 181 |
| 183 treeOutline.element.classList.add("hidden"); | 182 treeOutline.element.classList.add("hidden"); |
| 184 this.element.appendChild(treeOutline.element); | 183 this.element.appendChild(treeOutline.element); |
| 185 return treeOutline; | 184 return treeOutline; |
| 186 }, | 185 }, |
| 187 | 186 |
| 188 __proto__: WebInspector.SidebarPane.prototype | 187 __proto__: WebInspector.View.prototype |
| 189 } | 188 } |
| OLD | NEW |