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

Side by Side Diff: Source/devtools/front_end/components/InspectorView.js

Issue 1105643002: Devtools: Introduce WI.ExtensibleToolbar (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Move close button out of toolbar Created 5 years, 8 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) 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 this._drawerSplitView.show(this.element); 46 this._drawerSplitView.show(this.element);
47 47
48 this._tabbedPane = new WebInspector.TabbedPane(); 48 this._tabbedPane = new WebInspector.TabbedPane();
49 this._tabbedPane.element.classList.add("inspector-view-tabbed-pane"); 49 this._tabbedPane.element.classList.add("inspector-view-tabbed-pane");
50 this._tabbedPane.setRetainTabOrder(true); 50 this._tabbedPane.setRetainTabOrder(true);
51 if (Runtime.experiments.isEnabled("materialDesign")) 51 if (Runtime.experiments.isEnabled("materialDesign"))
52 this._tabbedPane.setTabSlider(true); 52 this._tabbedPane.setTabSlider(true);
53 this._drawerSplitView.setMainView(this._tabbedPane); 53 this._drawerSplitView.setMainView(this._tabbedPane);
54 this._drawer = new WebInspector.Drawer(this._drawerSplitView); 54 this._drawer = new WebInspector.Drawer(this._drawerSplitView);
55 55
56 this._leftToolbar = new WebInspector.Toolbar();
57 this._leftToolbar.element.classList.add("inspector-view-toolbar", "inspector -view-toolbar-left");
58 this._leftToolbar.makeNarrow();
59 this._tabbedPane.insertBeforeTabStrip(this._leftToolbar.element);
60
61 this._rightToolbar = new WebInspector.Toolbar();
62 this._rightToolbar.element.classList.add("inspector-view-toolbar");
63 this._tabbedPane.appendAfterTabStrip(this._rightToolbar.element);
64
65 this._closeButtonToolbarItem = createElementWithClass("div", "inspector-view -close-button");
66 var closeButtonElement = this._closeButtonToolbarItem.createChild("div", "", "dt-close-button");
67 closeButtonElement.addEventListener("click", InspectorFrontendHost.closeWind ow.bind(InspectorFrontendHost), true);
68 this._rightToolbar.element.appendChild(this._closeButtonToolbarItem);
69
70 this._panels = {}; 56 this._panels = {};
71 // Used by tests. 57 // Used by tests.
72 WebInspector["panels"] = this._panels; 58 WebInspector["panels"] = this._panels;
73 59
74 this._history = []; 60 this._history = [];
75 this._historyIterator = -1; 61 this._historyIterator = -1;
76 this._keyDownBound = this._keyDown.bind(this); 62 this._keyDownBound = this._keyDown.bind(this);
77 this._keyPressBound = this._keyPress.bind(this); 63 this._keyPressBound = this._keyPress.bind(this);
78 /** @type {!Object.<string, !WebInspector.PanelDescriptor>} */ 64 /** @type {!Object.<string, !WebInspector.PanelDescriptor>} */
79 this._panelDescriptors = {}; 65 this._panelDescriptors = {};
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 * @param {!Runtime.Extension} extension 106 * @param {!Runtime.Extension} extension
121 * @this {!WebInspector.InspectorView} 107 * @this {!WebInspector.InspectorView}
122 */ 108 */
123 function processPanelExtensions(extension) 109 function processPanelExtensions(extension)
124 { 110 {
125 this.addPanel(new WebInspector.RuntimeExtensionPanelDescriptor(exten sion)); 111 this.addPanel(new WebInspector.RuntimeExtensionPanelDescriptor(exten sion));
126 } 112 }
127 WebInspector.endBatchUpdate(); 113 WebInspector.endBatchUpdate();
128 }, 114 },
129 115
130 /** 116 createToolbars: function()
131 * @param {!WebInspector.ToolbarItem} item
132 */
133 appendToLeftToolbar: function(item)
134 { 117 {
135 this._leftToolbar.appendToolbarItem(item); 118 this._leftToolbar = new WebInspector.ExtensibleToolbar("main-toolbar-lef t");
119 this._leftToolbar.element.classList.add("inspector-view-toolbar", "inspe ctor-view-toolbar-left");
dgozman 2015/04/24 12:12:34 "inspector-view-toolbar" is unused.
sergeyv 2015/04/24 12:25:52 It is used in UIUtils, these toolbars could be sty
120 this._leftToolbar.makeNarrow();
121 this._tabbedPane.insertBeforeTabStrip(this._leftToolbar.element);
122
123 var rightToolbarContainer = createElementWithClass("span", "right-toolba r-container");
dgozman 2015/04/24 12:12:34 span->div
sergeyv 2015/04/24 12:25:52 Done.
124 this._tabbedPane.appendAfterTabStrip(rightToolbarContainer);
125
126 this._rightToolbar = new WebInspector.ExtensibleToolbar("main-toolbar-ri ght");
127 this._rightToolbar.element.classList.add("inspector-view-toolbar", "insp ector-view-toolbar-right");
dgozman 2015/04/24 12:12:34 Both these classes are unused.
sergeyv 2015/04/24 12:25:52 Removed last one
128 rightToolbarContainer.appendChild(this._rightToolbar.element);
129
130 var closeButton = createElementWithClass("div", "inspector-view-close-bu tton");
dgozman 2015/04/24 12:12:34 This div should be unnecessary.
sergeyv 2015/04/24 12:25:52 Done.
131 var closeButtonElement = closeButton.createChild("div", "", "dt-close-bu tton");
132 closeButtonElement.addEventListener("click", InspectorFrontendHost.close Window.bind(InspectorFrontendHost), true);
133 rightToolbarContainer.appendChild(closeButton);
136 }, 134 },
137 135
138 /** 136 /**
139 * @param {!WebInspector.ToolbarItem} item
140 */
141 appendToRightToolbar: function(item)
142 {
143 this._rightToolbar.appendToolbarItem(item);
144 },
145
146 /**
147 * @param {!WebInspector.PanelDescriptor} panelDescriptor 137 * @param {!WebInspector.PanelDescriptor} panelDescriptor
148 */ 138 */
149 addPanel: function(panelDescriptor) 139 addPanel: function(panelDescriptor)
150 { 140 {
151 var panelName = panelDescriptor.name(); 141 var panelName = panelDescriptor.name();
152 this._panelDescriptors[panelName] = panelDescriptor; 142 this._panelDescriptors[panelName] = panelDescriptor;
153 this._tabbedPane.appendTab(panelName, panelDescriptor.title(), new WebIn spector.View()); 143 this._tabbedPane.appendTab(panelName, panelDescriptor.title(), new WebIn spector.View());
154 if (this._lastActivePanelSetting.get() === panelName) 144 if (this._lastActivePanelSetting.get() === panelName)
155 this._tabbedPane.selectTab(panelName); 145 this._tabbedPane.selectTab(panelName);
156 }, 146 },
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 return promise; 187 return promise;
198 }, 188 },
199 189
200 /** 190 /**
201 * @param {!WebInspector.Event} event 191 * @param {!WebInspector.Event} event
202 */ 192 */
203 _onSuspendStateChanged: function(event) 193 _onSuspendStateChanged: function(event)
204 { 194 {
205 this._currentPanelLocked = WebInspector.targetManager.allTargetsSuspende d(); 195 this._currentPanelLocked = WebInspector.targetManager.allTargetsSuspende d();
206 this._tabbedPane.setCurrentTabLocked(this._currentPanelLocked); 196 this._tabbedPane.setCurrentTabLocked(this._currentPanelLocked);
207 this._leftToolbar.setEnabled(!this._currentPanelLocked); 197 if (this._leftToolbar)
208 this._rightToolbar.setEnabled(!this._currentPanelLocked); 198 this._leftToolbar.setEnabled(!this._currentPanelLocked);
199 if (this._rightToolbar)
200 this._rightToolbar.setEnabled(!this._currentPanelLocked);
209 }, 201 },
210 202
211 /** 203 /**
212 * The returned Promise is resolved with null if another showPanel() 204 * The returned Promise is resolved with null if another showPanel()
213 * gets called while this.panel(panelName) Promise is in flight. 205 * gets called while this.panel(panelName) Promise is in flight.
214 * 206 *
215 * @param {string} panelName 207 * @param {string} panelName
216 * @return {!Promise.<?WebInspector.Panel>} 208 * @return {!Promise.<?WebInspector.Panel>}
217 */ 209 */
218 showPanel: function(panelName) 210 showPanel: function(panelName)
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 WebInspector.InspectorView.ToggleDrawerButtonProvider.prototype = { 542 WebInspector.InspectorView.ToggleDrawerButtonProvider.prototype = {
551 /** 543 /**
552 * @override 544 * @override
553 * @return {?WebInspector.ToolbarItem} 545 * @return {?WebInspector.ToolbarItem}
554 */ 546 */
555 item: function() 547 item: function()
556 { 548 {
557 return WebInspector.inspectorView._drawer.toggleButton(); 549 return WebInspector.inspectorView._drawer.toggleButton();
558 } 550 }
559 } 551 }
OLDNEW
« no previous file with comments | « no previous file | Source/devtools/front_end/inspectorStyle.css » ('j') | Source/devtools/front_end/inspectorStyle.css » ('J')

Powered by Google App Engine
This is Rietveld 408576698