Chromium Code Reviews| 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 3b53ce0c2860e11b181e989b9535da5aab4071f9..e37bdb8f63e2d5e7cf8d2a290b7a049596cd388d 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/ui/Widget.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/ui/Widget.js |
| @@ -635,19 +635,77 @@ WebInspector.VBoxWithResizeCallback.prototype = { |
| /** |
| * @constructor |
| * @extends {WebInspector.VBox} |
| + * @param {string} title |
| + * @param {boolean=} isWebComponent |
| */ |
| -WebInspector.VBoxWithToolbarItems = function() |
| +WebInspector.View = function(title, isWebComponent) |
| { |
| - WebInspector.VBox.call(this); |
| + WebInspector.VBox.call(this, isWebComponent); |
| + this._title = title; |
| + /** @type {!Array<!WebInspector.ToolbarItem>} */ |
| + this._toolbarItems = []; |
| } |
| -WebInspector.VBoxWithToolbarItems.prototype = { |
| +WebInspector.View.prototype = { |
| + /** |
| + * @return {string} |
| + */ |
| + title: function() |
| + { |
| + return this._title; |
| + }, |
| + |
| + /** |
| + * @param {function()} callback |
| + */ |
| + setRevealCallback: function(callback) |
| + { |
| + this._revealCallback = callback; |
| + if (this._setRevealRequested) |
|
dgozman
2016/07/20 01:37:16
delete this._setRevealRequested;
pfeldman
2016/07/20 01:45:09
Done.
|
| + callback(); |
| + }, |
| + |
| + /** |
| + * @param {function(boolean)} callback |
| + */ |
| + setRequestVisibleCallback: function(callback) |
| + { |
| + this._requestVisibleCallback = callback; |
| + if (this._setVisibleRequested !== undefined) |
|
dgozman
2016/07/20 01:37:16
typeof ... !=== "undefined"
pfeldman
2016/07/20 01:45:10
We can now compare to undefined since 2 years ago.
|
| + callback(this._setVisibleRequested); |
|
dgozman
2016/07/20 01:37:16
delete this._setVisibleRequested;
pfeldman
2016/07/20 01:45:09
Done.
|
| + }, |
| + |
| + requestReveal: function() |
| + { |
| + this._setRevealRequested = true; |
| + if (this._revealCallback) |
| + this._revealCallback(); |
|
dgozman
2016/07/20 01:37:16
else
this._setRevealRequested = true;
pfeldman
2016/07/20 01:45:10
Done.
|
| + }, |
| + |
| + /** |
| + * @param {boolean} visible |
| + */ |
| + requestSetVisible: function(visible) |
| + { |
| + this._setVisibleRequested = visible; |
| + if (this._requestVisibleCallback) |
| + this._requestVisibleCallback(visible); |
|
dgozman
2016/07/20 01:37:16
else
this._setVisibleRequested = visible;
pfeldman
2016/07/20 01:45:09
Done.
|
| + }, |
| + |
| + /** |
| + * @param {!WebInspector.ToolbarItem} item |
| + */ |
| + addToolbarItem: function(item) |
| + { |
| + this._toolbarItems.push(item); |
| + }, |
| + |
| /** |
| * @return {!Array<!WebInspector.ToolbarItem>} |
| */ |
| toolbarItems: function() |
| { |
| - return []; |
| + return this._toolbarItems; |
| }, |
| __proto__: WebInspector.VBox.prototype |