Web Inspector: Debugger Popovers and Probes should use FormattedValue/ObjectTreeView...
[WebKit-https.git] / Source / WebInspectorUI / UserInterface / Views / ProbeSetDataGridNode.js
index e62e24dd18777d02095ba7fbe30182abf77e2454..3b5b1ba91bf3119a0d75f88df331c4aa81356223 100644 (file)
@@ -85,22 +85,8 @@ WebInspector.ProbeSetDataGridNode.prototype = {
             return sample;
         }
 
             return sample;
         }
 
-        if (sample instanceof WebInspector.RemoteObject) {
-            switch (sample.type) {
-            case "function": // FIXME: is there a better way to visualize functions?
-            case "object":
-                return new WebInspector.ObjectPropertiesSection(sample, WebInspector.ProbeSet.SampleObjectTitle).element;
-            case "string":
-            case "number":
-            case "boolean":
-            case "undefined":
-            case "null":
-                return document.createTextNode(sample.value);
-            case "array":
-            // FIXME: reuse existing visualization of arrays here.
-            default: console.log("Don't know how to represent sample:", sample);
-            }
-        }
+        if (sample instanceof WebInspector.RemoteObject)
+            return WebInspector.FormattedValue.createObjectTreeOrFormattedValueForRemoteObject(sample, null);
 
         return sample;
     },
 
         return sample;
     },