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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 this._customPreviewSection._loadBody(); | 55 this._customPreviewSection._loadBody(); |
56 }, | 56 }, |
57 | 57 |
58 /** | 58 /** |
59 * @param {!Event} event | 59 * @param {!Event} event |
60 */ | 60 */ |
61 _contextMenuEventFired: function(event) | 61 _contextMenuEventFired: function(event) |
62 { | 62 { |
63 var contextMenu = new WebInspector.ContextMenu(event); | 63 var contextMenu = new WebInspector.ContextMenu(event); |
64 if (this._customPreviewSection) | 64 if (this._customPreviewSection) |
65 contextMenu.appendItem(WebInspector.UIString.capitalize("Show as Jav
ascript ^object" ), this._disassemble.bind(this)); | 65 contextMenu.appendItem(WebInspector.UIString.capitalize("Show as Jav
ascript ^object"), this._disassemble.bind(this)); |
66 contextMenu.appendApplicableItems(this._object); | 66 contextMenu.appendApplicableItems(this._object); |
67 contextMenu.show(); | 67 contextMenu.show(); |
68 }, | 68 }, |
69 | 69 |
70 _disassemble: function() | 70 _disassemble: function() |
71 { | 71 { |
72 this.element.shadowRoot.textContent = ""; | 72 this.element.shadowRoot.textContent = ""; |
73 this._customPreviewSection = null; | 73 this._customPreviewSection = null; |
74 this.element.shadowRoot.appendChild(WebInspector.ObjectPropertiesSection
.defaultObjectPresentation(this._object)); | 74 this.element.shadowRoot.appendChild(WebInspector.ObjectPropertiesSection
.defaultObjectPresentation(this._object)); |
75 } | 75 } |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 { | 241 { |
242 if (!bodyJsonML) | 242 if (!bodyJsonML) |
243 return; | 243 return; |
244 | 244 |
245 this._cachedContent = this._renderJSONMLTag(bodyJsonML); | 245 this._cachedContent = this._renderJSONMLTag(bodyJsonML); |
246 this._sectionElement.appendChild(this._cachedContent); | 246 this._sectionElement.appendChild(this._cachedContent); |
247 this._toggleExpand(); | 247 this._toggleExpand(); |
248 } | 248 } |
249 } | 249 } |
250 } | 250 } |
OLD | NEW |