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

Side by Side Diff: Source/devtools/front_end/ui/SidebarPane.js

Issue 1113813002: [DevTools] Rename View to Widget. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased Created 5 years, 7 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2007 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
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 10 matching lines...) Expand all
21 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */ 27 */
28 28
29 /** 29 /**
30 * @constructor 30 * @constructor
31 * @extends {WebInspector.View} 31 * @extends {WebInspector.Widget}
32 * @param {string} title 32 * @param {string} title
33 */ 33 */
34 WebInspector.SidebarPane = function(title) 34 WebInspector.SidebarPane = function(title)
35 { 35 {
36 WebInspector.View.call(this); 36 WebInspector.Widget.call(this);
37 this.setMinimumSize(25, 0); 37 this.setMinimumSize(25, 0);
38 this.element.className = "sidebar-pane"; // Override 38 this.element.className = "sidebar-pane"; // Override
39 39
40 this.titleElement = createElementWithClass("div", "sidebar-pane-toolbar"); 40 this.titleElement = createElementWithClass("div", "sidebar-pane-toolbar");
41 this.bodyElement = this.element.createChild("div", "body"); 41 this.bodyElement = this.element.createChild("div", "body");
42 this._title = title; 42 this._title = title;
43 this._expandCallback = null; 43 this._expandCallback = null;
44 this._paneVisible = true; 44 this._paneVisible = true;
45 } 45 }
46 46
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 /** 85 /**
86 * @param {boolean} visible 86 * @param {boolean} visible
87 */ 87 */
88 setVisible: function(visible) 88 setVisible: function(visible)
89 { 89 {
90 this._paneVisible = visible; 90 this._paneVisible = visible;
91 if (this._setVisibleCallback) 91 if (this._setVisibleCallback)
92 this._setVisibleCallback(visible) 92 this._setVisibleCallback(visible)
93 }, 93 },
94 94
95 __proto__: WebInspector.View.prototype 95 __proto__: WebInspector.Widget.prototype
96 } 96 }
97 97
98 /** 98 /**
99 * @constructor 99 * @constructor
100 * @param {!Element} container 100 * @param {!Element} container
101 * @param {!WebInspector.SidebarPane} pane 101 * @param {!WebInspector.SidebarPane} pane
102 */ 102 */
103 WebInspector.SidebarPaneTitle = function(container, pane) 103 WebInspector.SidebarPaneTitle = function(container, pane)
104 { 104 {
105 this._pane = pane; 105 this._pane = pane;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 */ 139 */
140 _onTitleKeyDown: function(event) 140 _onTitleKeyDown: function(event)
141 { 141 {
142 if (isEnterKey(event) || event.keyCode === WebInspector.KeyboardShortcut .Keys.Space.code) 142 if (isEnterKey(event) || event.keyCode === WebInspector.KeyboardShortcut .Keys.Space.code)
143 this._toggleExpanded(); 143 this._toggleExpanded();
144 } 144 }
145 } 145 }
146 146
147 /** 147 /**
148 * @constructor 148 * @constructor
149 * @extends {WebInspector.View} 149 * @extends {WebInspector.Widget}
150 */ 150 */
151 WebInspector.SidebarPaneStack = function() 151 WebInspector.SidebarPaneStack = function()
152 { 152 {
153 WebInspector.View.call(this); 153 WebInspector.Widget.call(this);
154 this.setMinimumSize(25, 0); 154 this.setMinimumSize(25, 0);
155 this.element.className = "sidebar-pane-stack"; // Override 155 this.element.className = "sidebar-pane-stack"; // Override
156 /** @type {!Map.<!WebInspector.SidebarPane, !WebInspector.SidebarPaneTitle>} */ 156 /** @type {!Map.<!WebInspector.SidebarPane, !WebInspector.SidebarPaneTitle>} */
157 this._titleByPane = new Map(); 157 this._titleByPane = new Map();
158 } 158 }
159 159
160 WebInspector.SidebarPaneStack.prototype = { 160 WebInspector.SidebarPaneStack.prototype = {
161 /** 161 /**
162 * @param {!WebInspector.SidebarPane} pane 162 * @param {!WebInspector.SidebarPane} pane
163 */ 163 */
(...skipping 11 matching lines...) Expand all
175 _setPaneVisible: function(pane, visible) 175 _setPaneVisible: function(pane, visible)
176 { 176 {
177 var title = this._titleByPane.get(pane); 177 var title = this._titleByPane.get(pane);
178 if (!title) 178 if (!title)
179 return; 179 return;
180 180
181 title.element.classList.toggle("hidden", !visible); 181 title.element.classList.toggle("hidden", !visible);
182 pane.element.classList.toggle("hidden", !visible); 182 pane.element.classList.toggle("hidden", !visible);
183 }, 183 },
184 184
185 __proto__: WebInspector.View.prototype 185 __proto__: WebInspector.Widget.prototype
186 } 186 }
187 187
188 /** 188 /**
189 * @constructor 189 * @constructor
190 * @extends {WebInspector.TabbedPane} 190 * @extends {WebInspector.TabbedPane}
191 */ 191 */
192 WebInspector.SidebarTabbedPane = function() 192 WebInspector.SidebarTabbedPane = function()
193 { 193 {
194 WebInspector.TabbedPane.call(this); 194 WebInspector.TabbedPane.call(this);
195 this.setRetainTabOrder(true); 195 this.setRetainTabOrder(true);
(...skipping 23 matching lines...) Expand all
219 if (!this.hasTab(title)) 219 if (!this.hasTab(title))
220 this.appendTab(title, title, pane); 220 this.appendTab(title, title, pane);
221 } else { 221 } else {
222 if (this.hasTab(title)) 222 if (this.hasTab(title))
223 this.closeTab(title); 223 this.closeTab(title);
224 } 224 }
225 }, 225 },
226 226
227 __proto__: WebInspector.TabbedPane.prototype 227 __proto__: WebInspector.TabbedPane.prototype
228 } 228 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/ui/Section.js ('k') | Source/devtools/front_end/ui/SoftContextMenu.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698