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

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

Issue 2353033004: [DevTools] Expose left and right toolbar in TabbedPane. (Closed)
Patch Set: review comment Created 4 years, 2 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) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 this._drawerSplitWidget.hideSidebar(); 44 this._drawerSplitWidget.hideSidebar();
45 this._drawerSplitWidget.hideDefaultResizer(); 45 this._drawerSplitWidget.hideDefaultResizer();
46 this._drawerSplitWidget.enableShowModeSaving(); 46 this._drawerSplitWidget.enableShowModeSaving();
47 this._drawerSplitWidget.show(this.element); 47 this._drawerSplitWidget.show(this.element);
48 48
49 // Create drawer tabbed pane. 49 // Create drawer tabbed pane.
50 this._drawerTabbedLocation = WebInspector.viewManager.createTabbedLocation(t his.showDrawer.bind(this), "drawer-view", true); 50 this._drawerTabbedLocation = WebInspector.viewManager.createTabbedLocation(t his.showDrawer.bind(this), "drawer-view", true);
51 this._drawerTabbedLocation.enableMoreTabsButton(); 51 this._drawerTabbedLocation.enableMoreTabsButton();
52 this._drawerTabbedPane = this._drawerTabbedLocation.tabbedPane(); 52 this._drawerTabbedPane = this._drawerTabbedLocation.tabbedPane();
53 this._drawerTabbedPane.setMinimumSize(0, 27); 53 this._drawerTabbedPane.setMinimumSize(0, 27);
54 var drawerToolbar = new WebInspector.Toolbar("drawer-close-toolbar");
55 var closeDrawerButton = new WebInspector.ToolbarButton(WebInspector.UIString ("Close drawer"), "delete-toolbar-item"); 54 var closeDrawerButton = new WebInspector.ToolbarButton(WebInspector.UIString ("Close drawer"), "delete-toolbar-item");
56 closeDrawerButton.addEventListener("click", this.closeDrawer.bind(this)); 55 closeDrawerButton.addEventListener("click", this.closeDrawer.bind(this));
57 drawerToolbar.appendToolbarItem(closeDrawerButton); 56 this._drawerTabbedPane.rightToolbar().appendToolbarItem(closeDrawerButton);
58 this._drawerTabbedPane.appendAfterTabStrip(drawerToolbar.element);
59 this._drawerSplitWidget.installResizer(this._drawerTabbedPane.headerElement( )); 57 this._drawerSplitWidget.installResizer(this._drawerTabbedPane.headerElement( ));
60 this._drawerSplitWidget.setSidebarWidget(this._drawerTabbedPane); 58 this._drawerSplitWidget.setSidebarWidget(this._drawerTabbedPane);
61 59
62 // Create main area tabbed pane. 60 // Create main area tabbed pane.
63 this._tabbedPane = new WebInspector.TabbedPane(); 61 this._tabbedPane = new WebInspector.TabbedPane();
64 this._tabbedPane.registerRequiredCSS("ui/inspectorViewTabbedPane.css"); 62 this._tabbedPane.registerRequiredCSS("ui/inspectorViewTabbedPane.css");
65 this._tabbedPane.setTabSlider(true); 63 this._tabbedPane.setTabSlider(true);
66 this._tabbedPane.setAllowTabReorder(true, false); 64 this._tabbedPane.setAllowTabReorder(true, false);
67 this._tabbedPane.addEventListener(WebInspector.TabbedPane.Events.TabOrderCha nged, this._persistPanelOrder, this); 65 this._tabbedPane.addEventListener(WebInspector.TabbedPane.Events.TabOrderCha nged, this._persistPanelOrder, this);
68 this._tabOrderSetting = WebInspector.settings.createSetting("InspectorView.p anelOrder", {}); 66 this._tabOrderSetting = WebInspector.settings.createSetting("InspectorView.p anelOrder", {});
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 var panelWeights = new Map(); 157 var panelWeights = new Map();
160 self.runtime.extensions(WebInspector.Panel).forEach(processPanelExtensio ns.bind(this)); 158 self.runtime.extensions(WebInspector.Panel).forEach(processPanelExtensio ns.bind(this));
161 var sortedPanels = panelWeights.keysArray().sort(orderComparator); 159 var sortedPanels = panelWeights.keysArray().sort(orderComparator);
162 for (var panelDescriptor of sortedPanels) 160 for (var panelDescriptor of sortedPanels)
163 this._innerAddPanel(panelDescriptor); 161 this._innerAddPanel(panelDescriptor);
164 WebInspector.endBatchUpdate(); 162 WebInspector.endBatchUpdate();
165 }, 163 },
166 164
167 createToolbars: function() 165 createToolbars: function()
168 { 166 {
169 this._leftToolbar = new WebInspector.ExtensibleToolbar("main-toolbar-lef t"); 167 this._tabbedPane.leftToolbar().appendLocationItems("main-toolbar-left");
170 this._leftToolbar.element.classList.add("inspector-view-toolbar", "inspe ctor-view-toolbar-left"); 168 this._tabbedPane.rightToolbar().appendLocationItems("main-toolbar-right" );
171
172 this._tabbedPane.insertBeforeTabStrip(this._leftToolbar.element);
173
174 var rightToolbarContainer = createElementWithClass("div", "hbox flex-non e flex-centered");
175 this._tabbedPane.appendAfterTabStrip(rightToolbarContainer);
176
177 this._rightToolbar = new WebInspector.ExtensibleToolbar("main-toolbar-ri ght");
178 this._rightToolbar.element.classList.add("inspector-view-toolbar", "flex -none");
179 rightToolbarContainer.appendChild(this._rightToolbar.element);
180 }, 169 },
181 170
182 /** 171 /**
183 * @param {!WebInspector.PanelDescriptor} panelDescriptor 172 * @param {!WebInspector.PanelDescriptor} panelDescriptor
184 * @param {number=} index 173 * @param {number=} index
185 */ 174 */
186 _innerAddPanel: function(panelDescriptor, index) 175 _innerAddPanel: function(panelDescriptor, index)
187 { 176 {
188 var panelName = panelDescriptor.name(); 177 var panelName = panelDescriptor.name();
189 this._panelDescriptors[panelName] = panelDescriptor; 178 this._panelDescriptors[panelName] = panelDescriptor;
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 return promise; 235 return promise;
247 }, 236 },
248 237
249 /** 238 /**
250 * @param {boolean} allTargetsSuspended 239 * @param {boolean} allTargetsSuspended
251 */ 240 */
252 onSuspendStateChanged: function(allTargetsSuspended) 241 onSuspendStateChanged: function(allTargetsSuspended)
253 { 242 {
254 this._currentPanelLocked = allTargetsSuspended; 243 this._currentPanelLocked = allTargetsSuspended;
255 this._tabbedPane.setCurrentTabLocked(this._currentPanelLocked); 244 this._tabbedPane.setCurrentTabLocked(this._currentPanelLocked);
256 if (this._leftToolbar) 245 this._tabbedPane.leftToolbar().setEnabled(!this._currentPanelLocked);
257 this._leftToolbar.setEnabled(!this._currentPanelLocked); 246 this._tabbedPane.rightToolbar().setEnabled(!this._currentPanelLocked);
258 if (this._rightToolbar)
259 this._rightToolbar.setEnabled(!this._currentPanelLocked);
260 }, 247 },
261 248
262 /** 249 /**
263 * The returned Promise is resolved with null if another showPanel() 250 * The returned Promise is resolved with null if another showPanel()
264 * gets called while this.panel(panelName) Promise is in flight. 251 * gets called while this.panel(panelName) Promise is in flight.
265 * 252 *
266 * @param {string} panelName 253 * @param {string} panelName
267 * @return {!Promise.<?WebInspector.Panel>} 254 * @return {!Promise.<?WebInspector.Panel>}
268 */ 255 */
269 showPanel: function(panelName) 256 showPanel: function(panelName)
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 */ 591 */
605 handleAction: function(context, actionId) 592 handleAction: function(context, actionId)
606 { 593 {
607 if (WebInspector.inspectorView.drawerVisible()) 594 if (WebInspector.inspectorView.drawerVisible())
608 WebInspector.inspectorView.closeDrawer(); 595 WebInspector.inspectorView.closeDrawer();
609 else 596 else
610 WebInspector.inspectorView.showDrawer(); 597 WebInspector.inspectorView.showDrawer();
611 return true; 598 return true;
612 } 599 }
613 } 600 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698