| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 * @unrestricted | 5 * @unrestricted |
| 6 */ | 6 */ |
| 7 ObjectUI.RemoteObjectPreviewFormatter = class { | 7 ObjectUI.RemoteObjectPreviewFormatter = class { |
| 8 /** | 8 /** |
| 9 * @param {!Protocol.Runtime.PropertyPreview} a | 9 * @param {!Protocol.Runtime.PropertyPreview} a |
| 10 * @param {!Protocol.Runtime.PropertyPreview} b | 10 * @param {!Protocol.Runtime.PropertyPreview} b |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 var arrayName = preview.subtype === 'typedarray' ? SDK.RemoteObject.arra
yNameFromDescription(description) : ''; | 41 var arrayName = preview.subtype === 'typedarray' ? SDK.RemoteObject.arra
yNameFromDescription(description) : ''; |
| 42 text = arrayName + arrayLengthText; | 42 text = arrayName + arrayLengthText; |
| 43 } else { | 43 } else { |
| 44 var hideDescription = previewExperimentEnabled && description === 'Objec
t'; | 44 var hideDescription = previewExperimentEnabled && description === 'Objec
t'; |
| 45 text = hideDescription ? '' : description; | 45 text = hideDescription ? '' : description; |
| 46 } | 46 } |
| 47 if (text.length > 0) | 47 if (text.length > 0) |
| 48 parentElement.createChild('span', 'object-description').textContent = te
xt + ' '; | 48 parentElement.createChild('span', 'object-description').textContent = te
xt + ' '; |
| 49 } | 49 } |
| 50 | 50 |
| 51 var propertiesElement = parentElement.createChild('span', 'object-properties
-preview source-code'); | 51 var propertiesElement = parentElement.createChild('span', 'object-properties
-preview monospace'); |
| 52 propertiesElement.createTextChild(isArrayOrTypedArray ? '[' : '{'); | 52 propertiesElement.createTextChild(isArrayOrTypedArray ? '[' : '{'); |
| 53 if (preview.entries) | 53 if (preview.entries) |
| 54 this._appendEntriesPreview(propertiesElement, preview); | 54 this._appendEntriesPreview(propertiesElement, preview); |
| 55 else if (isArrayOrTypedArray) | 55 else if (isArrayOrTypedArray) |
| 56 this._appendArrayPropertiesPreview(propertiesElement, preview); | 56 this._appendArrayPropertiesPreview(propertiesElement, preview); |
| 57 else | 57 else |
| 58 this._appendObjectPropertiesPreview(propertiesElement, preview); | 58 this._appendObjectPropertiesPreview(propertiesElement, preview); |
| 59 if (preview.overflow) { | 59 if (preview.overflow) { |
| 60 var ellipsisText = propertiesElement.textContent.length > 1 ? ',\u00a0\u20
26' : '\u2026'; | 60 var ellipsisText = propertiesElement.textContent.length > 1 ? ',\u00a0\u20
26' : '\u2026'; |
| 61 propertiesElement.createChild('span').textContent = ellipsisText; | 61 propertiesElement.createChild('span').textContent = ellipsisText; |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 preview = '{\u2026}'; | 247 preview = '{\u2026}'; |
| 248 span.textContent = preview; | 248 span.textContent = preview; |
| 249 span.title = description; | 249 span.title = description; |
| 250 return span; | 250 return span; |
| 251 } | 251 } |
| 252 | 252 |
| 253 span.textContent = description; | 253 span.textContent = description; |
| 254 return span; | 254 return span; |
| 255 } | 255 } |
| 256 }; | 256 }; |
| OLD | NEW |