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

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

Issue 2431223003: [DevTools]: Require explicit connection (Closed)
Patch Set: Addressed one last comment Created 4 years, 1 month 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 WebInspector.context.addFlavorChangeListener(WebInspector.DebuggerModel.Call Frame, this._callFrameChanged, this); 115 WebInspector.context.addFlavorChangeListener(WebInspector.DebuggerModel.Call Frame, this._callFrameChanged, this);
116 WebInspector.targetManager.addModelListener( 116 WebInspector.targetManager.addModelListener(
117 WebInspector.DebuggerModel, WebInspector.DebuggerModel.Events.DebuggerWa sEnabled, this._debuggerWasEnabled, 117 WebInspector.DebuggerModel, WebInspector.DebuggerModel.Events.DebuggerWa sEnabled, this._debuggerWasEnabled,
118 this); 118 this);
119 WebInspector.targetManager.addModelListener( 119 WebInspector.targetManager.addModelListener(
120 WebInspector.DebuggerModel, WebInspector.DebuggerModel.Events.DebuggerPa used, this._debuggerPaused, this); 120 WebInspector.DebuggerModel, WebInspector.DebuggerModel.Events.DebuggerPa used, this._debuggerPaused, this);
121 WebInspector.targetManager.addModelListener( 121 WebInspector.targetManager.addModelListener(
122 WebInspector.DebuggerModel, WebInspector.DebuggerModel.Events.DebuggerRe sumed, this._debuggerResumed, this); 122 WebInspector.DebuggerModel, WebInspector.DebuggerModel.Events.DebuggerRe sumed, this._debuggerResumed, this);
123 WebInspector.targetManager.addModelListener( 123 WebInspector.targetManager.addModelListener(
124 WebInspector.DebuggerModel, WebInspector.DebuggerModel.Events.GlobalObje ctCleared, this._debuggerReset, this); 124 WebInspector.DebuggerModel, WebInspector.DebuggerModel.Events.GlobalObje ctCleared, this._debuggerReset, this);
125 WebInspector.targetManager.addModelListener(
126 WebInspector.SubTargetsManager, WebInspector.SubTargetsManager.Events.Pe ndingTargetAdded, this._pendingTargetAdded, this);
125 new WebInspector.WorkspaceMappingTip(this, this._workspace); 127 new WebInspector.WorkspaceMappingTip(this, this._workspace);
126 WebInspector.extensionServer.addEventListener( 128 WebInspector.extensionServer.addEventListener(
127 WebInspector.ExtensionServer.Events.SidebarPaneAdded, this._extensionSid ebarPaneAdded, this); 129 WebInspector.ExtensionServer.Events.SidebarPaneAdded, this._extensionSid ebarPaneAdded, this);
128 WebInspector.DataSaverInfobar.maybeShowInPanel(this); 130 WebInspector.DataSaverInfobar.maybeShowInPanel(this);
129 WebInspector.targetManager.observeTargets(this); 131 WebInspector.targetManager.observeTargets(this);
130 } 132 }
131 133
132 /** 134 /**
133 * @return {!WebInspector.SourcesPanel} 135 * @return {!WebInspector.SourcesPanel}
134 */ 136 */
(...skipping 23 matching lines...) Expand all
158 else 160 else
159 panel._sourcesView.bottomToolbar().appendToolbarItem(panel._toggleDebugg erSidebarButton); 161 panel._sourcesView.bottomToolbar().appendToolbarItem(panel._toggleDebugg erSidebarButton);
160 } 162 }
161 } 163 }
162 164
163 /** 165 /**
164 * @override 166 * @override
165 * @param {!WebInspector.Target} target 167 * @param {!WebInspector.Target} target
166 */ 168 */
167 targetAdded(target) { 169 targetAdded(target) {
168 var hasThreads = WebInspector.targetManager.targets(WebInspector.Target.Capa bility.JS).length > 1; 170 this._showThreadsIfNeeded();
169 if (hasThreads && !this._threadsSidebarPane) {
170 this._threadsSidebarPane = /** @type {!WebInspector.View} */ (WebInspector .viewManager.view('sources.threads'));
171 if (this._sidebarPaneStack) {
172 this._sidebarPaneStack.showView(
173 this._threadsSidebarPane, this._splitWidget.isVertical() ? this._wat chSidebarPane : this._callstackPane);
174 }
175 }
176 } 171 }
177 172
178 /** 173 /**
179 * @override 174 * @override
180 * @param {!WebInspector.Target} target 175 * @param {!WebInspector.Target} target
181 */ 176 */
182 targetRemoved(target) { 177 targetRemoved(target) {
183 } 178 }
184 179
180 _pendingTargetAdded() {
181 this._showThreadsIfNeeded();
182 }
183
184 _showThreadsIfNeeded() {
185 if (WebInspector.ThreadsSidebarPane.shouldBeShown() && !this._threadsSidebar Pane) {
186 this._threadsSidebarPane = /** @type {!WebInspector.View} */ (WebInspector .viewManager.view('sources.threads'));
187 if (this._sidebarPaneStack)
188 this._sidebarPaneStack.showView(this._threadsSidebarPane, this._splitWid get.isVertical() ? this._watchSidebarPane : this._callstackPane);
189 }
190 }
191
192
185 /** 193 /**
186 * @param {?WebInspector.Target} target 194 * @param {?WebInspector.Target} target
187 */ 195 */
188 _setTarget(target) { 196 _setTarget(target) {
189 if (!target) 197 if (!target)
190 return; 198 return;
191 var debuggerModel = WebInspector.DebuggerModel.fromTarget(target); 199 var debuggerModel = WebInspector.DebuggerModel.fromTarget(target);
192 if (!debuggerModel) 200 if (!debuggerModel)
193 return; 201 return;
194 202
(...skipping 1146 matching lines...) Expand 10 before | Expand all | Expand 10 after
1341 */ 1349 */
1342 willHide() { 1350 willHide() {
1343 WebInspector.inspectorView.setDrawerMinimized(false); 1351 WebInspector.inspectorView.setDrawerMinimized(false);
1344 setImmediate(() => WebInspector.SourcesPanel.updateResizerAndSidebarButtons( WebInspector.SourcesPanel.instance())); 1352 setImmediate(() => WebInspector.SourcesPanel.updateResizerAndSidebarButtons( WebInspector.SourcesPanel.instance()));
1345 } 1353 }
1346 1354
1347 _showViewInWrapper() { 1355 _showViewInWrapper() {
1348 this._view.show(this.element); 1356 this._view.show(this.element);
1349 } 1357 }
1350 }; 1358 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698