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

Unified Diff: third_party/WebKit/Source/devtools/front_end/object_ui/ObjectPropertiesSection.js

Issue 2714833002: DevTools: use interface for ObjectUI and make it a non-autostart module (Closed)
Patch Set: cl fb Created 3 years, 8 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: third_party/WebKit/Source/devtools/front_end/object_ui/ObjectPropertiesSection.js
diff --git a/third_party/WebKit/Source/devtools/front_end/object_ui/ObjectPropertiesSection.js b/third_party/WebKit/Source/devtools/front_end/object_ui/ObjectPropertiesSection.js
index e4731e87f991fd9dfe089f354655f702d76bce6a..f0558a03273db9b5791001f89c2f68ef2936940f 100644
--- a/third_party/WebKit/Source/devtools/front_end/object_ui/ObjectPropertiesSection.js
+++ b/third_party/WebKit/Source/devtools/front_end/object_ui/ObjectPropertiesSection.js
@@ -1350,3 +1350,28 @@ ObjectUI.ObjectPropertiesSectionExpandController = class {
ObjectUI.ObjectPropertiesSectionExpandController._cachedPathSymbol = Symbol('cachedPath');
ObjectUI.ObjectPropertiesSectionExpandController._treeOutlineId = Symbol('treeOutlineId');
+
+/**
+ * @implements {Common.Renderer}
+ */
+ObjectUI.ObjectPropertiesSection.Renderer = class {
+ /**
+ * @override
+ * @param {!Object} object
+ * @param {!Common.Renderer.Options=} options
+ * @return {!Promise<!Element>}
+ */
+ render(object, options) {
+ if (!(object instanceof SDK.RemoteObject))
+ return Promise.reject(new Error('Can\'t render ' + object));
+ options = options || {};
+ var title = options.title;
+ var section = new ObjectUI.ObjectPropertiesSection(object, title);
+ if (!title)
+ section.titleLessMode();
+ if (options.expanded)
+ section.expand();
+ section.editable = !!options.editable;
+ return Promise.resolve(section.element);
+ }
+};

Powered by Google App Engine
This is Rietveld 408576698