Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
| 3 * Copyright (C) 2011 Google Inc. All Rights Reserved. | 3 * Copyright (C) 2011 Google Inc. All Rights Reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 628 { | 628 { |
| 629 this._resizeCallback(); | 629 this._resizeCallback(); |
| 630 }, | 630 }, |
| 631 | 631 |
| 632 __proto__: WebInspector.VBox.prototype | 632 __proto__: WebInspector.VBox.prototype |
| 633 } | 633 } |
| 634 | 634 |
| 635 /** | 635 /** |
| 636 * @constructor | 636 * @constructor |
| 637 * @extends {WebInspector.VBox} | 637 * @extends {WebInspector.VBox} |
| 638 * @param {string} title | |
| 639 * @param {boolean=} isWebComponent | |
| 638 */ | 640 */ |
| 639 WebInspector.VBoxWithToolbarItems = function() | 641 WebInspector.View = function(title, isWebComponent) |
| 640 { | 642 { |
| 641 WebInspector.VBox.call(this); | 643 WebInspector.VBox.call(this, isWebComponent); |
| 644 this._title = title; | |
| 645 /** @type {!Array<!WebInspector.ToolbarItem>} */ | |
| 646 this._toolbarItems = []; | |
| 642 } | 647 } |
| 643 | 648 |
| 644 WebInspector.VBoxWithToolbarItems.prototype = { | 649 WebInspector.View.prototype = { |
| 650 /** | |
| 651 * @return {string} | |
| 652 */ | |
| 653 title: function() | |
| 654 { | |
| 655 return this._title; | |
| 656 }, | |
| 657 | |
| 658 /** | |
| 659 * @param {function()} callback | |
| 660 */ | |
| 661 setRevealCallback: function(callback) | |
| 662 { | |
| 663 this._revealCallback = callback; | |
| 664 if (this._setRevealRequested) | |
|
dgozman
2016/07/20 01:37:16
delete this._setRevealRequested;
pfeldman
2016/07/20 01:45:09
Done.
| |
| 665 callback(); | |
| 666 }, | |
| 667 | |
| 668 /** | |
| 669 * @param {function(boolean)} callback | |
| 670 */ | |
| 671 setRequestVisibleCallback: function(callback) | |
| 672 { | |
| 673 this._requestVisibleCallback = callback; | |
| 674 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.
| |
| 675 callback(this._setVisibleRequested); | |
|
dgozman
2016/07/20 01:37:16
delete this._setVisibleRequested;
pfeldman
2016/07/20 01:45:09
Done.
| |
| 676 }, | |
| 677 | |
| 678 requestReveal: function() | |
| 679 { | |
| 680 this._setRevealRequested = true; | |
| 681 if (this._revealCallback) | |
| 682 this._revealCallback(); | |
|
dgozman
2016/07/20 01:37:16
else
this._setRevealRequested = true;
pfeldman
2016/07/20 01:45:10
Done.
| |
| 683 }, | |
| 684 | |
| 685 /** | |
| 686 * @param {boolean} visible | |
| 687 */ | |
| 688 requestSetVisible: function(visible) | |
| 689 { | |
| 690 this._setVisibleRequested = visible; | |
| 691 if (this._requestVisibleCallback) | |
| 692 this._requestVisibleCallback(visible); | |
|
dgozman
2016/07/20 01:37:16
else
this._setVisibleRequested = visible;
pfeldman
2016/07/20 01:45:09
Done.
| |
| 693 }, | |
| 694 | |
| 695 /** | |
| 696 * @param {!WebInspector.ToolbarItem} item | |
| 697 */ | |
| 698 addToolbarItem: function(item) | |
| 699 { | |
| 700 this._toolbarItems.push(item); | |
| 701 }, | |
| 702 | |
| 645 /** | 703 /** |
| 646 * @return {!Array<!WebInspector.ToolbarItem>} | 704 * @return {!Array<!WebInspector.ToolbarItem>} |
| 647 */ | 705 */ |
| 648 toolbarItems: function() | 706 toolbarItems: function() |
| 649 { | 707 { |
| 650 return []; | 708 return this._toolbarItems; |
| 651 }, | 709 }, |
| 652 | 710 |
| 653 __proto__: WebInspector.VBox.prototype | 711 __proto__: WebInspector.VBox.prototype |
| 654 } | 712 } |
| 655 | 713 |
| 656 /** | 714 /** |
| 657 * @override | 715 * @override |
| 658 * @param {?Node} child | 716 * @param {?Node} child |
| 659 * @return {?Node} | 717 * @return {?Node} |
| 660 * @suppress {duplicate} | 718 * @suppress {duplicate} |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 688 { | 746 { |
| 689 WebInspector.Widget.__assert(!child.__widgetCounter && !child.__widget, "Att empt to remove element containing widget via regular DOM operation"); | 747 WebInspector.Widget.__assert(!child.__widgetCounter && !child.__widget, "Att empt to remove element containing widget via regular DOM operation"); |
| 690 return WebInspector.Widget._originalRemoveChild.call(this, child); | 748 return WebInspector.Widget._originalRemoveChild.call(this, child); |
| 691 } | 749 } |
| 692 | 750 |
| 693 Element.prototype.removeChildren = function() | 751 Element.prototype.removeChildren = function() |
| 694 { | 752 { |
| 695 WebInspector.Widget.__assert(!this.__widgetCounter, "Attempt to remove eleme nt containing widget via regular DOM operation"); | 753 WebInspector.Widget.__assert(!this.__widgetCounter, "Attempt to remove eleme nt containing widget via regular DOM operation"); |
| 696 WebInspector.Widget._originalRemoveChildren.call(this); | 754 WebInspector.Widget._originalRemoveChildren.call(this); |
| 697 } | 755 } |
| OLD | NEW |