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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.js

Issue 2217783002: DevTools: use view locations in the elements and sources sidebars. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 /** 132 /**
133 * @override 133 * @override
134 * @param {!WebInspector.Target} target 134 * @param {!WebInspector.Target} target
135 */ 135 */
136 targetAdded: function(target) 136 targetAdded: function(target)
137 { 137 {
138 var hasThreads = WebInspector.targetManager.targets(WebInspector.Target. Capability.JS).length > 1; 138 var hasThreads = WebInspector.targetManager.targets(WebInspector.Target. Capability.JS).length > 1;
139 if (hasThreads && !this.sidebarPanes.threads) { 139 if (hasThreads && !this.sidebarPanes.threads) {
140 this.sidebarPanes.threads = new WebInspector.ThreadsSidebarPane(); 140 this.sidebarPanes.threads = new WebInspector.ThreadsSidebarPane();
141 if (this._sidebarPaneStack) { 141 if (this._sidebarPaneStack) {
142 this._sidebarPaneStack.insertViewBefore(this.sidebarPanes.thread s, this._splitWidget.isVertical() ? this.sidebarPanes.watchExpressions : this.si debarPanes.callstack, true); 142 this._sidebarPaneStack.showView(this.sidebarPanes.threads);
143 // this._splitWidget.isVertical() ? this.sidebarPanes.watchExpre ssions : this.sidebarPanes.callstack, true);
dgozman 2016/08/05 01:32:09 Commented code.
143 } 144 }
144 } 145 }
145 }, 146 },
146 147
147 /** 148 /**
148 * @override 149 * @override
149 * @param {!WebInspector.Target} target 150 * @param {!WebInspector.Target} target
150 */ 151 */
151 targetRemoved: function(target) 152 targetRemoved: function(target)
152 { 153 {
(...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after
1118 1119
1119 this._splitWidget.setVertical(!vertically); 1120 this._splitWidget.setVertical(!vertically);
1120 this._splitWidget.element.classList.toggle("sources-split-view-vertical" , vertically); 1121 this._splitWidget.element.classList.toggle("sources-split-view-vertical" , vertically);
1121 1122
1122 WebInspector.SourcesPanel.updateResizer(this); 1123 WebInspector.SourcesPanel.updateResizer(this);
1123 1124
1124 // Create vertical box with stack. 1125 // Create vertical box with stack.
1125 var vbox = new WebInspector.VBox(); 1126 var vbox = new WebInspector.VBox();
1126 vbox.element.appendChild(this._debugToolbarDrawer); 1127 vbox.element.appendChild(this._debugToolbarDrawer);
1127 vbox.setMinimumAndPreferredSizes(25, 25, WebInspector.SourcesPanel.minTo olbarWidth, 100); 1128 vbox.setMinimumAndPreferredSizes(25, 25, WebInspector.SourcesPanel.minTo olbarWidth, 100);
1128 this._sidebarPaneStack = new WebInspector.View.ExpandableStackContainer( ); 1129 this._sidebarPaneStack = WebInspector.viewManager.createStackLocation("s ources-sidebar");
1129 this._sidebarPaneStack.show(vbox.element); 1130 this._sidebarPaneStack.widget().show(vbox.element);
1130 vbox.element.appendChild(this._debugToolbar.element); 1131 vbox.element.appendChild(this._debugToolbar.element);
1131 1132
1132 if (!vertically) { 1133 if (!vertically) {
1133 // Populate the only stack. 1134 // Populate the only stack.
1134 for (var pane in this.sidebarPanes) { 1135 for (var pane in this.sidebarPanes) {
1135 if (this.sidebarPanes[pane]) 1136 if (this.sidebarPanes[pane])
1136 this._sidebarPaneStack.appendView(this.sidebarPanes[pane]); 1137 this._sidebarPaneStack.appendView(this.sidebarPanes[pane]);
1137 } 1138 }
1138 this._extensionSidebarPanesContainer = this._sidebarPaneStack; 1139 this._extensionSidebarPanesContainer = this._sidebarPaneStack;
1139 this.sidebarPaneView = vbox; 1140 this.sidebarPaneView = vbox;
1140 1141
1141 this.sidebarPanes.scopechain.revealWidget(); 1142 this.sidebarPanes.scopechain.revealWidget();
1142 this.sidebarPanes.watchExpressions.expandIfNecessary(); 1143 this.sidebarPanes.watchExpressions.expandIfNecessary();
1143 } else { 1144 } else {
1144 var splitWidget = new WebInspector.SplitWidget(true, true, "sourcesP anelDebuggerSidebarSplitViewState", 0.5); 1145 var splitWidget = new WebInspector.SplitWidget(true, true, "sourcesP anelDebuggerSidebarSplitViewState", 0.5);
1145 splitWidget.setMainWidget(vbox); 1146 splitWidget.setMainWidget(vbox);
1146 1147
1147 // Populate the left stack. 1148 // Populate the left stack.
1148 if (this.sidebarPanes.threads) 1149 if (this.sidebarPanes.threads)
1149 this._sidebarPaneStack.appendView(this.sidebarPanes.threads); 1150 this._sidebarPaneStack.appendView(this.sidebarPanes.threads);
1150 this._sidebarPaneStack.appendView(this.sidebarPanes.callstack); 1151 this._sidebarPaneStack.appendView(this.sidebarPanes.callstack);
1151 this._sidebarPaneStack.appendView(this.sidebarPanes.jsBreakpoints); 1152 this._sidebarPaneStack.appendView(this.sidebarPanes.jsBreakpoints);
1152 this._sidebarPaneStack.appendView(this.sidebarPanes.domBreakpoints); 1153 this._sidebarPaneStack.appendView(this.sidebarPanes.domBreakpoints);
1153 this._sidebarPaneStack.appendView(this.sidebarPanes.xhrBreakpoints); 1154 this._sidebarPaneStack.appendView(this.sidebarPanes.xhrBreakpoints);
1154 this._sidebarPaneStack.appendView(this.sidebarPanes.eventListenerBre akpoints); 1155 this._sidebarPaneStack.appendView(this.sidebarPanes.eventListenerBre akpoints);
1155 this._sidebarPaneStack.appendView(this.sidebarPanes.objectEventListe ners); 1156 this._sidebarPaneStack.appendView(this.sidebarPanes.objectEventListe ners);
1156 1157
1157 var tabbedPane = new WebInspector.View.TabbedPaneContainer(); 1158 var tabbedLocation = WebInspector.viewManager.createTabbedLocation(" sources-sidebar-tabs");
1158 splitWidget.setSidebarWidget(tabbedPane); 1159 splitWidget.setSidebarWidget(tabbedLocation.tabbedPane());
1159 tabbedPane.appendView(this.sidebarPanes.scopechain); 1160 tabbedLocation.appendView(this.sidebarPanes.scopechain);
1160 tabbedPane.appendView(this.sidebarPanes.watchExpressions); 1161 tabbedLocation.appendView(this.sidebarPanes.watchExpressions);
1161 if (this.sidebarPanes.serviceWorkers) 1162 if (this.sidebarPanes.serviceWorkers)
1162 tabbedPane.appendView(this.sidebarPanes.serviceWorkers); 1163 tabbedLocation.appendView(this.sidebarPanes.serviceWorkers);
1163 tabbedPane.selectTab(this._lastSelectedTabSetting.get()); 1164 // tabbedLocation.show(this._lastSelectedTabSetting.get());
dgozman 2016/08/05 01:32:09 Commented code.
1164 tabbedPane.addEventListener(WebInspector.TabbedPane.EventTypes.TabSe lected, this._tabSelected, this); 1165 tabbedLocation.tabbedPane().addEventListener(WebInspector.TabbedPane .EventTypes.TabSelected, this._tabSelected, this);
1165 this._extensionSidebarPanesContainer = tabbedPane; 1166 this._extensionSidebarPanesContainer = tabbedLocation;
1166 this.sidebarPaneView = splitWidget; 1167 this.sidebarPaneView = splitWidget;
1167 } 1168 }
1168 1169
1169 var extensionSidebarPanes = WebInspector.extensionServer.sidebarPanes(); 1170 var extensionSidebarPanes = WebInspector.extensionServer.sidebarPanes();
1170 for (var i = 0; i < extensionSidebarPanes.length; ++i) 1171 for (var i = 0; i < extensionSidebarPanes.length; ++i)
1171 this._addExtensionSidebarPane(extensionSidebarPanes[i]); 1172 this._addExtensionSidebarPane(extensionSidebarPanes[i]);
1172 1173
1173 this._splitWidget.setSidebarWidget(this.sidebarPaneView); 1174 this._splitWidget.setSidebarWidget(this.sidebarPaneView);
1174 if (this.sidebarPanes.threads) 1175 if (this.sidebarPanes.threads)
1175 this.sidebarPanes.threads.revealWidget(); 1176 this.sidebarPanes.threads.revealWidget();
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
1473 __proto__: WebInspector.VBox.prototype 1474 __proto__: WebInspector.VBox.prototype
1474 } 1475 }
1475 1476
1476 /** 1477 /**
1477 * @return {boolean} 1478 * @return {boolean}
1478 */ 1479 */
1479 WebInspector.SourcesPanel.WrapperView.isShowing = function() 1480 WebInspector.SourcesPanel.WrapperView.isShowing = function()
1480 { 1481 {
1481 return !!WebInspector.SourcesPanel.WrapperView._instance && WebInspector.Sou rcesPanel.WrapperView._instance.isShowing(); 1482 return !!WebInspector.SourcesPanel.WrapperView._instance && WebInspector.Sou rcesPanel.WrapperView._instance.isShowing();
1482 } 1483 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698