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

Unified Diff: third_party/WebKit/Source/devtools/front_end/ui/Widget.js

Issue 2174863003: DevTools: traverse widget hierarchy to reveal views. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: lcean Created 4 years, 5 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/ui/Widget.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/Widget.js b/third_party/WebKit/Source/devtools/front_end/ui/Widget.js
index bed9940536a657292125376311ef65c51b4a2471..b572002b46ed8753ca1e848f56e24812e1d2e2a3 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/Widget.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/Widget.js
@@ -551,6 +551,25 @@ WebInspector.Widget.prototype = {
this._parentWidget.doLayout();
},
+ /**
+ * @return {boolean}
+ */
+ revealWidget: function()
+ {
+ if (!this._parentWidget)
+ return this._isRoot;
+ if (!this._parentWidget.revealChild(this))
+ return false;
+ return this._parentWidget.revealWidget();
+ },
+
+ /**
+ * @param {!WebInspector.Widget} widget
+ * @return {boolean}
+ * @protected
+ */
+ revealChild: function(widget) { return true; },
+
__proto__: WebInspector.Object.prototype
}
@@ -696,7 +715,6 @@ WebInspector.VBoxWithResizeCallback.prototype = {
WebInspector.View = function(title, isWebComponent)
{
WebInspector.VBox.call(this, isWebComponent);
- this.element.classList.add("view");
this._title = title;
/** @type {!Array<!WebInspector.ToolbarItem>} */
this._toolbarItems = [];
@@ -712,49 +730,6 @@ WebInspector.View.prototype = {
},
/**
- * @param {function()} callback
- */
- setRevealCallback: function(callback)
- {
- this._revealCallback = callback;
- if (this._setRevealRequested) {
- callback();
- delete this._setRevealRequested;
- }
- },
-
- /**
- * @param {function(boolean)} callback
- */
- setRequestVisibleCallback: function(callback)
- {
- this._requestVisibleCallback = callback;
- if (this._setVisibleRequested !== undefined) {
- callback(this._setVisibleRequested);
- delete this._setVisibleRequested;
- }
- },
-
- requestReveal: function()
- {
- if (this._revealCallback)
- this._revealCallback();
- else
- this._setRevealRequested = true;
- },
-
- /**
- * @param {boolean} visible
- */
- requestSetVisible: function(visible)
- {
- if (this._requestVisibleCallback)
- this._requestVisibleCallback(visible);
- else
- this._setVisibleRequested = visible;
- },
-
- /**
* @param {!WebInspector.ToolbarItem} item
*/
addToolbarItem: function(item)

Powered by Google App Engine
This is Rietveld 408576698