Chromium Code Reviews| Index: third_party/WebKit/Source/devtools/front_end/components/ObjectPropertiesSection.js |
| diff --git a/third_party/WebKit/Source/devtools/front_end/components/ObjectPropertiesSection.js b/third_party/WebKit/Source/devtools/front_end/components/ObjectPropertiesSection.js |
| index 5f9d406b81aa8eec22eed1aa4f21b687c513ea82..b6a0a754ef7d1331fb37acaa7cd1dcc90749600c 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/components/ObjectPropertiesSection.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/components/ObjectPropertiesSection.js |
| @@ -215,6 +215,8 @@ WebInspector.ObjectPropertyTreeElement = function(property) |
| this.selectable = false; |
| /** @type {!Array.<!Object>} */ |
| this._highlightChanges = []; |
| + |
| + this._linkifier = new WebInspector.Linkifier(); |
|
dgozman
2016/07/06 19:25:12
Let's pass linkifier from the user of ObjectProper
kozy
2016/07/06 22:38:41
Done.
|
| } |
| WebInspector.ObjectPropertyTreeElement.prototype = { |
| @@ -309,7 +311,7 @@ WebInspector.ObjectPropertyTreeElement.prototype = { |
| separatorElement.textContent = ": "; |
| if (this.property.value) { |
| - this.valueElement = WebInspector.ObjectPropertiesSection.createValueElementWithCustomSupport(this.property.value, this.property.wasThrown, this.listItemElement); |
| + this.valueElement = WebInspector.ObjectPropertiesSection.createValueElementWithCustomSupport(this.property.value, this.property.wasThrown, this.listItemElement, this._linkifier); |
| this.valueElement.addEventListener("contextmenu", this._contextMenuFired.bind(this, this.property), false); |
| } else if (this.property.getter) { |
| this.valueElement = WebInspector.ObjectPropertyTreeElement.createRemoteObjectAccessorPropertySpan(this.property.parentObject, [this.property.name], this._onInvokeGetterClick.bind(this)); |
| @@ -1102,25 +1104,27 @@ WebInspector.ObjectPropertiesSection.valueTextForFunctionDescription = function( |
| * @param {!WebInspector.RemoteObject} value |
| * @param {boolean} wasThrown |
| * @param {!Element=} parentElement |
| + * @param {!WebInspector.Linkifier=} linkifier |
| * @return {!Element} |
| */ |
| -WebInspector.ObjectPropertiesSection.createValueElementWithCustomSupport = function(value, wasThrown, parentElement) |
| +WebInspector.ObjectPropertiesSection.createValueElementWithCustomSupport = function(value, wasThrown, parentElement, linkifier) |
| { |
| if (value.customPreview()) { |
| var result = (new WebInspector.CustomPreviewComponent(value)).element; |
| result.classList.add("object-properties-section-custom-section"); |
| return result |
| } |
| - return WebInspector.ObjectPropertiesSection.createValueElement(value, wasThrown, parentElement); |
| + return WebInspector.ObjectPropertiesSection.createValueElement(value, wasThrown, parentElement, linkifier); |
| } |
| /** |
| * @param {!WebInspector.RemoteObject} value |
| * @param {boolean} wasThrown |
| * @param {!Element=} parentElement |
| + * @param {!WebInspector.Linkifier=} linkifier |
| * @return {!Element} |
| */ |
| -WebInspector.ObjectPropertiesSection.createValueElement = function(value, wasThrown, parentElement) |
| +WebInspector.ObjectPropertiesSection.createValueElement = function(value, wasThrown, parentElement, linkifier) |
| { |
| var valueElement = createElementWithClass("span", "value"); |
| var type = value.type; |
| @@ -1174,6 +1178,11 @@ WebInspector.ObjectPropertiesSection.createValueElement = function(value, wasThr |
| valueElement.title = description || ""; |
| } |
| + if (type === "object" && subtype === "internal#location" && linkifier) { |
| + var loc = value.value; |
| + return linkifier.linkifyScriptLocation(value.target(), loc.scriptId, "", loc.lineNumber, loc.columnNumber); |
| + } |
| + |
| function mouseMove() |
| { |
| WebInspector.DOMModel.highlightObjectAsDOMNode(value); |