Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2045)

Unified Diff: Source/devtools/front_end/components/ObjectPropertiesSection.js

Issue 1107233003: Devtools: [CustomFormatter] Add context menu to disassemble custom previews (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Introduce WebInspector.ObjectPropertiesSection.defaultObjectPresentation Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/devtools/front_end/components/ObjectPropertiesSection.js
diff --git a/Source/devtools/front_end/components/ObjectPropertiesSection.js b/Source/devtools/front_end/components/ObjectPropertiesSection.js
index e453d56f796bcfd04b28ac44b47d2be2911d5039..9ffc15ca93c4c4c6ade75ed2c9df80ad8e260339 100644
--- a/Source/devtools/front_end/components/ObjectPropertiesSection.js
+++ b/Source/devtools/front_end/components/ObjectPropertiesSection.js
@@ -55,6 +55,30 @@ WebInspector.ObjectPropertiesSection = function(object, title, emptyPlaceholder,
/** @const */
WebInspector.ObjectPropertiesSection._arrayLoadThreshold = 100;
+/**
+ * @param {!WebInspector.RemoteObject} object
+ * @param {boolean=} skipProto
+ * @return {!Element}
+ */
+WebInspector.ObjectPropertiesSection.defaultObjectPresentation = function(object, skipProto)
+{
+ var componentRoot = createElementWithClass("span", "source-code");
+ WebInspector.installComponentRootStyles(componentRoot);
+
+ var shadowRoot = componentRoot.createShadowRoot();
+ shadowRoot.appendChild(WebInspector.Widget.createStyleElement("components/objectValue.css"));
+ shadowRoot.appendChild(WebInspector.ObjectPropertiesSection.createValueElement(object, false));
+ if (!object.hasChildren)
+ return componentRoot;
+
+ var objectPropertiesSection = new WebInspector.ObjectPropertiesSection(object, componentRoot);
+ objectPropertiesSection.editable = false;
+ if (skipProto)
+ objectPropertiesSection.skipProto();
+
+ return objectPropertiesSection.element;
+}
+
WebInspector.ObjectPropertiesSection.prototype = {
skipProto: function()
{
@@ -1063,7 +1087,7 @@ WebInspector.ObjectPropertiesSection.valueTextForFunctionDescription = function(
WebInspector.ObjectPropertiesSection.createValueElementWithCustomSupport = function(value, wasThrown, parentElement)
{
if (value.customPreview()) {
- var result = WebInspector.CustomPreviewSection.createInShadow(value);
+ var result = (new WebInspector.CustomPreviewComponent(value)).element;
result.classList.add("object-properties-section-custom-section");
return result
}
« no previous file with comments | « Source/devtools/front_end/components/ObjectPopoverHelper.js ('k') | Source/devtools/front_end/console/ConsoleViewMessage.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698