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

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

Issue 2205123003: DevTools: introduce view locations, allow opening views by id. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments addressed Created 4 years, 4 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 unified diff | Download patch
OLDNEW
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 693 matching lines...) Expand 10 before | Expand all | Expand 10 after
704 WebInspector.VBoxWithResizeCallback.prototype = { 704 WebInspector.VBoxWithResizeCallback.prototype = {
705 onResize: function() 705 onResize: function()
706 { 706 {
707 this._resizeCallback(); 707 this._resizeCallback();
708 }, 708 },
709 709
710 __proto__: WebInspector.VBox.prototype 710 __proto__: WebInspector.VBox.prototype
711 } 711 }
712 712
713 /** 713 /**
714 * @constructor
715 * @extends {WebInspector.VBox}
716 * @param {string} title
717 * @param {boolean=} isWebComponent
718 */
719 WebInspector.View = function(title, isWebComponent)
720 {
721 WebInspector.VBox.call(this, isWebComponent);
722 this._title = title;
723 /** @type {!Array<!WebInspector.ToolbarItem>} */
724 this._toolbarItems = [];
725 }
726
727 WebInspector.View.prototype = {
728 /**
729 * @return {string}
730 */
731 title: function()
732 {
733 return this._title;
734 },
735
736 /**
737 * @param {!WebInspector.ToolbarItem} item
738 */
739 addToolbarItem: function(item)
740 {
741 this._toolbarItems.push(item);
742 },
743
744 /**
745 * @return {!Array<!WebInspector.ToolbarItem>}
746 */
747 toolbarItems: function()
748 {
749 return this._toolbarItems;
750 },
751
752 __proto__: WebInspector.VBox.prototype
753 }
754
755 /**
756 * @override 714 * @override
757 * @param {?Node} child 715 * @param {?Node} child
758 * @return {?Node} 716 * @return {?Node}
759 * @suppress {duplicate} 717 * @suppress {duplicate}
760 */ 718 */
761 Element.prototype.appendChild = function(child) 719 Element.prototype.appendChild = function(child)
762 { 720 {
763 WebInspector.Widget.__assert(!child.__widget || child.parentElement === this , "Attempt to add widget via regular DOM operation."); 721 WebInspector.Widget.__assert(!child.__widget || child.parentElement === this , "Attempt to add widget via regular DOM operation.");
764 return WebInspector.Widget._originalAppendChild.call(this, child); 722 return WebInspector.Widget._originalAppendChild.call(this, child);
765 } 723 }
(...skipping 21 matching lines...) Expand all
787 { 745 {
788 WebInspector.Widget.__assert(!child.__widgetCounter && !child.__widget, "Att empt to remove element containing widget via regular DOM operation"); 746 WebInspector.Widget.__assert(!child.__widgetCounter && !child.__widget, "Att empt to remove element containing widget via regular DOM operation");
789 return WebInspector.Widget._originalRemoveChild.call(this, child); 747 return WebInspector.Widget._originalRemoveChild.call(this, child);
790 } 748 }
791 749
792 Element.prototype.removeChildren = function() 750 Element.prototype.removeChildren = function()
793 { 751 {
794 WebInspector.Widget.__assert(!this.__widgetCounter, "Attempt to remove eleme nt containing widget via regular DOM operation"); 752 WebInspector.Widget.__assert(!this.__widgetCounter, "Attempt to remove eleme nt containing widget via regular DOM operation");
795 WebInspector.Widget._originalRemoveChildren.call(this); 753 WebInspector.Widget._originalRemoveChildren.call(this);
796 } 754 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/ui/View.js ('k') | third_party/WebKit/Source/devtools/front_end/ui/module.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698