OLD | NEW |
---|---|
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 Loading... | |
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 Loading... | |
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("toolbar-left"); |
dgozman
2015/04/23 14:09:36
Let's rename to "main-toolbar-left".
sergeyv
2015/04/23 17:42:12
Done.
| |
119 this._leftToolbar.element.classList.add("inspector-view-toolbar", "inspe ctor-view-toolbar-left"); | |
120 this._leftToolbar.makeNarrow(); | |
121 this._tabbedPane.insertBeforeTabStrip(this._leftToolbar.element); | |
122 | |
123 this._rightToolbar = new WebInspector.ExtensibleToolbar("toolbar-right") ; | |
124 this._rightToolbar.element.classList.add("inspector-view-toolbar"); | |
125 this._tabbedPane.appendAfterTabStrip(this._rightToolbar.element); | |
126 | |
127 this._closeButtonToolbarItem = createElementWithClass("div", "inspector- view-close-button"); | |
dgozman
2015/04/23 14:09:36
Turn this into StatusBarItem.
sergeyv
2015/04/23 17:42:12
Done.
| |
128 var closeButtonElement = this._closeButtonToolbarItem.createChild("div", "", "dt-close-button"); | |
129 closeButtonElement.addEventListener("click", InspectorFrontendHost.close Window.bind(InspectorFrontendHost), true); | |
130 this._rightToolbar.element.appendChild(this._closeButtonToolbarItem); | |
136 }, | 131 }, |
137 | 132 |
138 /** | 133 /** |
139 * @param {!WebInspector.ToolbarItem} item | |
140 */ | |
141 appendToRightToolbar: function(item) | |
142 { | |
143 this._rightToolbar.appendToolbarItem(item); | |
144 }, | |
145 | |
146 /** | |
147 * @param {!WebInspector.PanelDescriptor} panelDescriptor | 134 * @param {!WebInspector.PanelDescriptor} panelDescriptor |
148 */ | 135 */ |
149 addPanel: function(panelDescriptor) | 136 addPanel: function(panelDescriptor) |
150 { | 137 { |
151 var panelName = panelDescriptor.name(); | 138 var panelName = panelDescriptor.name(); |
152 this._panelDescriptors[panelName] = panelDescriptor; | 139 this._panelDescriptors[panelName] = panelDescriptor; |
153 this._tabbedPane.appendTab(panelName, panelDescriptor.title(), new WebIn spector.View()); | 140 this._tabbedPane.appendTab(panelName, panelDescriptor.title(), new WebIn spector.View()); |
154 if (this._lastActivePanelSetting.get() === panelName) | 141 if (this._lastActivePanelSetting.get() === panelName) |
155 this._tabbedPane.selectTab(panelName); | 142 this._tabbedPane.selectTab(panelName); |
156 }, | 143 }, |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
197 return promise; | 184 return promise; |
198 }, | 185 }, |
199 | 186 |
200 /** | 187 /** |
201 * @param {!WebInspector.Event} event | 188 * @param {!WebInspector.Event} event |
202 */ | 189 */ |
203 _onSuspendStateChanged: function(event) | 190 _onSuspendStateChanged: function(event) |
204 { | 191 { |
205 this._currentPanelLocked = WebInspector.targetManager.allTargetsSuspende d(); | 192 this._currentPanelLocked = WebInspector.targetManager.allTargetsSuspende d(); |
206 this._tabbedPane.setCurrentTabLocked(this._currentPanelLocked); | 193 this._tabbedPane.setCurrentTabLocked(this._currentPanelLocked); |
207 this._leftToolbar.setEnabled(!this._currentPanelLocked); | 194 if (this._leftToolbar) |
208 this._rightToolbar.setEnabled(!this._currentPanelLocked); | 195 this._leftToolbar.setEnabled(!this._currentPanelLocked); |
196 if (this._rightToolbar) | |
197 this._rightToolbar.setEnabled(!this._currentPanelLocked); | |
209 }, | 198 }, |
210 | 199 |
211 /** | 200 /** |
212 * The returned Promise is resolved with null if another showPanel() | 201 * The returned Promise is resolved with null if another showPanel() |
213 * gets called while this.panel(panelName) Promise is in flight. | 202 * gets called while this.panel(panelName) Promise is in flight. |
214 * | 203 * |
215 * @param {string} panelName | 204 * @param {string} panelName |
216 * @return {!Promise.<?WebInspector.Panel>} | 205 * @return {!Promise.<?WebInspector.Panel>} |
217 */ | 206 */ |
218 showPanel: function(panelName) | 207 showPanel: function(panelName) |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
550 WebInspector.InspectorView.ToggleDrawerButtonProvider.prototype = { | 539 WebInspector.InspectorView.ToggleDrawerButtonProvider.prototype = { |
551 /** | 540 /** |
552 * @override | 541 * @override |
553 * @return {?WebInspector.ToolbarItem} | 542 * @return {?WebInspector.ToolbarItem} |
554 */ | 543 */ |
555 item: function() | 544 item: function() |
556 { | 545 { |
557 return WebInspector.inspectorView._drawer.toggleButton(); | 546 return WebInspector.inspectorView._drawer.toggleButton(); |
558 } | 547 } |
559 } | 548 } |
OLD | NEW |