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

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

Issue 2431223003: [DevTools]: Require explicit connection (Closed)
Patch Set: Fixed Node.JS connection title 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 WebInspector.context.addFlavorChangeListener(WebInspector.Target, this._onCu rrentTargetChanged, this); 105 WebInspector.context.addFlavorChangeListener(WebInspector.Target, this._onCu rrentTargetChanged, this);
106 WebInspector.context.addFlavorChangeListener(WebInspector.DebuggerModel.Call Frame, this._callFrameChanged, this); 106 WebInspector.context.addFlavorChangeListener(WebInspector.DebuggerModel.Call Frame, this._callFrameChanged, this);
107 WebInspector.targetManager.addModelListener(WebInspector.DebuggerModel, WebI nspector.DebuggerModel.Events.DebuggerWasEnabled, this._debuggerWasEnabled, this ); 107 WebInspector.targetManager.addModelListener(WebInspector.DebuggerModel, WebI nspector.DebuggerModel.Events.DebuggerWasEnabled, this._debuggerWasEnabled, this );
108 WebInspector.targetManager.addModelListener(WebInspector.DebuggerModel, WebI nspector.DebuggerModel.Events.DebuggerPaused, this._debuggerPaused, this); 108 WebInspector.targetManager.addModelListener(WebInspector.DebuggerModel, WebI nspector.DebuggerModel.Events.DebuggerPaused, this._debuggerPaused, this);
109 WebInspector.targetManager.addModelListener(WebInspector.DebuggerModel, WebI nspector.DebuggerModel.Events.DebuggerResumed, this._debuggerResumed, this); 109 WebInspector.targetManager.addModelListener(WebInspector.DebuggerModel, WebI nspector.DebuggerModel.Events.DebuggerResumed, this._debuggerResumed, this);
110 WebInspector.targetManager.addModelListener(WebInspector.DebuggerModel, WebI nspector.DebuggerModel.Events.GlobalObjectCleared, this._debuggerReset, this); 110 WebInspector.targetManager.addModelListener(WebInspector.DebuggerModel, WebI nspector.DebuggerModel.Events.GlobalObjectCleared, this._debuggerReset, this);
111 new WebInspector.WorkspaceMappingTip(this, this._workspace); 111 new WebInspector.WorkspaceMappingTip(this, this._workspace);
112 WebInspector.extensionServer.addEventListener(WebInspector.ExtensionServer.E vents.SidebarPaneAdded, this._extensionSidebarPaneAdded, this); 112 WebInspector.extensionServer.addEventListener(WebInspector.ExtensionServer.E vents.SidebarPaneAdded, this._extensionSidebarPaneAdded, this);
113 WebInspector.DataSaverInfobar.maybeShowInPanel(this); 113 WebInspector.DataSaverInfobar.maybeShowInPanel(this);
114 WebInspector.targetManager.observeTargets(this); 114 WebInspector.targetManager.observeTargets(this);
115 WebInspector.targetConnectionManager.addEventListener(WebInspector.TargetCon nectionManager.Events.ConnectionAdded, this._connectionAdded, this);
115 }; 116 };
116 117
117 WebInspector.SourcesPanel._lastModificationTimeout = 200; 118 WebInspector.SourcesPanel._lastModificationTimeout = 200;
118 119
119 WebInspector.SourcesPanel.minToolbarWidth = 215; 120 WebInspector.SourcesPanel.minToolbarWidth = 215;
120 121
121 WebInspector.SourcesPanel.prototype = { 122 WebInspector.SourcesPanel.prototype = {
122 /** 123 /**
123 * @override 124 * @override
124 * @param {!WebInspector.Target} target 125 * @param {!WebInspector.Target} target
125 */ 126 */
126 targetAdded: function(target) 127 targetAdded: function(target)
127 { 128 {
128 var hasThreads = WebInspector.targetManager.targets(WebInspector.Target. Capability.JS).length > 1; 129 this._showThreadsIfNeeded();
129 if (hasThreads && !this._threadsSidebarPane) {
130 this._threadsSidebarPane = /** @type {!WebInspector.View} */ (WebIns pector.viewManager.view("sources.threads"));
131 if (this._sidebarPaneStack) {
132 this._sidebarPaneStack.showView(this._threadsSidebarPane, this._ splitWidget.isVertical() ? this._watchSidebarPane : this._callstackPane);
133 }
134 }
135 }, 130 },
136 131
137 /** 132 /**
138 * @override 133 * @override
139 * @param {!WebInspector.Target} target 134 * @param {!WebInspector.Target} target
140 */ 135 */
141 targetRemoved: function(target) 136 targetRemoved: function(target)
142 { 137 {
143 }, 138 },
144 139
140 _connectionAdded: function()
141 {
142 this._showThreadsIfNeeded();
143 },
144
145 _showThreadsIfNeeded: function()
146 {
147 var hasThreads = WebInspector.targetManager.targets(WebInspector.Target. Capability.JS).length > 1 || WebInspector.targetConnectionManager.connections(). length > 0;
dgozman 2016/10/26 22:14:06 I think this is complicated enough to justify stat
148 if (hasThreads && !this._threadsSidebarPane) {
149 this._threadsSidebarPane = /** @type {!WebInspector.View} */ (WebIns pector.viewManager.view("sources.threads"));
150 if (this._sidebarPaneStack) {
151 this._sidebarPaneStack.showView(this._threadsSidebarPane, this._ splitWidget.isVertical() ? this._watchSidebarPane : this._callstackPane);
152 }
153 }
154 },
155
145 /** 156 /**
146 * @param {?WebInspector.Target} target 157 * @param {?WebInspector.Target} target
147 */ 158 */
148 _setTarget: function(target) 159 _setTarget: function(target)
149 { 160 {
150 if (!target) 161 if (!target)
151 return; 162 return;
152 var debuggerModel = WebInspector.DebuggerModel.fromTarget(target); 163 var debuggerModel = WebInspector.DebuggerModel.fromTarget(target);
153 if (!debuggerModel) 164 if (!debuggerModel)
154 return; 165 return;
(...skipping 1238 matching lines...) Expand 10 before | Expand all | Expand 10 after
1393 __proto__: WebInspector.VBox.prototype 1404 __proto__: WebInspector.VBox.prototype
1394 }; 1405 };
1395 1406
1396 /** 1407 /**
1397 * @return {boolean} 1408 * @return {boolean}
1398 */ 1409 */
1399 WebInspector.SourcesPanel.WrapperView.isShowing = function() 1410 WebInspector.SourcesPanel.WrapperView.isShowing = function()
1400 { 1411 {
1401 return !!WebInspector.SourcesPanel.WrapperView._instance && WebInspector.Sou rcesPanel.WrapperView._instance.isShowing(); 1412 return !!WebInspector.SourcesPanel.WrapperView._instance && WebInspector.Sou rcesPanel.WrapperView._instance.isShowing();
1402 }; 1413 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698