| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 * @param {!WebInspector.RemoteObject} object | 7 * @param {!WebInspector.RemoteObject} object |
| 8 */ | 8 */ |
| 9 WebInspector.CustomPreviewSection = function(object) | 9 WebInspector.CustomPreviewSection = function(object) |
| 10 { | 10 { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 * @constructor | 38 * @constructor |
| 39 * @param {!WebInspector.RemoteObject} object | 39 * @param {!WebInspector.RemoteObject} object |
| 40 * @param {boolean=} expand | 40 * @param {boolean=} expand |
| 41 * @return {!Element} | 41 * @return {!Element} |
| 42 */ | 42 */ |
| 43 WebInspector.CustomPreviewSection.createInShadow = function(object, expand) | 43 WebInspector.CustomPreviewSection.createInShadow = function(object, expand) |
| 44 { | 44 { |
| 45 var customPreviewSection = new WebInspector.CustomPreviewSection(object); | 45 var customPreviewSection = new WebInspector.CustomPreviewSection(object); |
| 46 var element = WebInspector.CustomPreviewSection._createComponentRoot(); | 46 var element = WebInspector.CustomPreviewSection._createComponentRoot(); |
| 47 var shadowRoot = element.createShadowRoot(); | 47 var shadowRoot = element.createShadowRoot(); |
| 48 shadowRoot.appendChild(WebInspector.View.createStyleElement("components/cust
omPreviewSection.css")); | 48 shadowRoot.appendChild(WebInspector.Widget.createStyleElement("components/cu
stomPreviewSection.css")); |
| 49 shadowRoot.appendChild(customPreviewSection.element()); | 49 shadowRoot.appendChild(customPreviewSection.element()); |
| 50 | 50 |
| 51 if (expand && object.customPreview().hasBody) | 51 if (expand && object.customPreview().hasBody) |
| 52 customPreviewSection._loadBody(); | 52 customPreviewSection._loadBody(); |
| 53 return element; | 53 return element; |
| 54 } | 54 } |
| 55 | 55 |
| 56 /** | 56 /** |
| 57 * @return {!Element} | 57 * @return {!Element} |
| 58 */ | 58 */ |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 objectTag.shift(); | 129 objectTag.shift(); |
| 130 var attributes = objectTag.shift(); | 130 var attributes = objectTag.shift(); |
| 131 var remoteObject = this._object.target().runtimeModel.createRemoteObject
(/** @type {!RuntimeAgent.RemoteObject} */ (attributes)); | 131 var remoteObject = this._object.target().runtimeModel.createRemoteObject
(/** @type {!RuntimeAgent.RemoteObject} */ (attributes)); |
| 132 if (remoteObject.customPreview()) | 132 if (remoteObject.customPreview()) |
| 133 return (new WebInspector.CustomPreviewSection(remoteObject)).element
(); | 133 return (new WebInspector.CustomPreviewSection(remoteObject)).element
(); |
| 134 | 134 |
| 135 var header = createElement("span"); | 135 var header = createElement("span"); |
| 136 var componentRoot = WebInspector.CustomPreviewSection._createComponentRo
ot(); | 136 var componentRoot = WebInspector.CustomPreviewSection._createComponentRo
ot(); |
| 137 header.appendChild(componentRoot); | 137 header.appendChild(componentRoot); |
| 138 var shadowRoot = componentRoot.createShadowRoot(); | 138 var shadowRoot = componentRoot.createShadowRoot(); |
| 139 shadowRoot.appendChild(WebInspector.View.createStyleElement("components/
objectValue.css")); | 139 shadowRoot.appendChild(WebInspector.Widget.createStyleElement("component
s/objectValue.css")); |
| 140 shadowRoot.appendChild(WebInspector.ObjectPropertiesSection.createValueE
lement(remoteObject, false)); | 140 shadowRoot.appendChild(WebInspector.ObjectPropertiesSection.createValueE
lement(remoteObject, false)); |
| 141 if (!remoteObject.hasChildren) | 141 if (!remoteObject.hasChildren) |
| 142 return header; | 142 return header; |
| 143 | 143 |
| 144 var objectPropertiesSection = new WebInspector.ObjectPropertiesSection(r
emoteObject, header); | 144 var objectPropertiesSection = new WebInspector.ObjectPropertiesSection(r
emoteObject, header); |
| 145 var sectionElement = objectPropertiesSection.element; | 145 var sectionElement = objectPropertiesSection.element; |
| 146 sectionElement.classList.add("custom-expandable-section-standard-section
"); | 146 sectionElement.classList.add("custom-expandable-section-standard-section
"); |
| 147 return sectionElement; | 147 return sectionElement; |
| 148 }, | 148 }, |
| 149 | 149 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 { | 240 { |
| 241 if (!bodyJsonML) | 241 if (!bodyJsonML) |
| 242 return; | 242 return; |
| 243 | 243 |
| 244 this._cachedContent = this._renderJSONMLTag(bodyJsonML); | 244 this._cachedContent = this._renderJSONMLTag(bodyJsonML); |
| 245 this._sectionElement.appendChild(this._cachedContent); | 245 this._sectionElement.appendChild(this._cachedContent); |
| 246 this._toggleExpand(); | 246 this._toggleExpand(); |
| 247 } | 247 } |
| 248 } | 248 } |
| 249 } | 249 } |
| OLD | NEW |