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

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

Issue 2431223003: [DevTools]: Require explicit connection (Closed)
Patch Set: Code review comments were addressed 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 this._liveLocationPool = new WebInspector.LiveLocationPool(); 101 this._liveLocationPool = new WebInspector.LiveLocationPool();
102 102
103 this._setTarget(WebInspector.context.flavor(WebInspector.Target)); 103 this._setTarget(WebInspector.context.flavor(WebInspector.Target));
104 WebInspector.breakpointManager.addEventListener(WebInspector.BreakpointManag er.Events.BreakpointsActiveStateChanged, this._breakpointsActiveStateChanged, th is); 104 WebInspector.breakpointManager.addEventListener(WebInspector.BreakpointManag er.Events.BreakpointsActiveStateChanged, this._breakpointsActiveStateChanged, th is);
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 WebInspector.targetManager.addModelListener(WebInspector.SubTargetsManager, WebInspector.SubTargetsManager.Events.SubTargetAdded, this._subTargetAdded, this );
111 new WebInspector.WorkspaceMappingTip(this, this._workspace); 112 new WebInspector.WorkspaceMappingTip(this, this._workspace);
112 WebInspector.extensionServer.addEventListener(WebInspector.ExtensionServer.E vents.SidebarPaneAdded, this._extensionSidebarPaneAdded, this); 113 WebInspector.extensionServer.addEventListener(WebInspector.ExtensionServer.E vents.SidebarPaneAdded, this._extensionSidebarPaneAdded, this);
113 WebInspector.DataSaverInfobar.maybeShowInPanel(this); 114 WebInspector.DataSaverInfobar.maybeShowInPanel(this);
114 WebInspector.targetManager.observeTargets(this); 115 WebInspector.targetManager.observeTargets(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 _subTargetAdded: function()
141 {
142 this._showThreadsIfNeeded();
143 },
144
145 _showThreadsIfNeeded: function()
146 {
147 if (WebInspector.ThreadsSidebarPane.isShown() && !this._threadsSidebarPa ne) {
148 this._threadsSidebarPane = /** @type {!WebInspector.View} */ (WebIns pector.viewManager.view("sources.threads"));
149 if (this._sidebarPaneStack) {
150 this._sidebarPaneStack.showView(this._threadsSidebarPane, this._ splitWidget.isVertical() ? this._watchSidebarPane : this._callstackPane);
151 }
152 }
153 },
154
145 /** 155 /**
146 * @param {?WebInspector.Target} target 156 * @param {?WebInspector.Target} target
147 */ 157 */
148 _setTarget: function(target) 158 _setTarget: function(target)
149 { 159 {
150 if (!target) 160 if (!target)
151 return; 161 return;
152 var debuggerModel = WebInspector.DebuggerModel.fromTarget(target); 162 var debuggerModel = WebInspector.DebuggerModel.fromTarget(target);
153 if (!debuggerModel) 163 if (!debuggerModel)
154 return; 164 return;
(...skipping 1238 matching lines...) Expand 10 before | Expand all | Expand 10 after
1393 __proto__: WebInspector.VBox.prototype 1403 __proto__: WebInspector.VBox.prototype
1394 }; 1404 };
1395 1405
1396 /** 1406 /**
1397 * @return {boolean} 1407 * @return {boolean}
1398 */ 1408 */
1399 WebInspector.SourcesPanel.WrapperView.isShowing = function() 1409 WebInspector.SourcesPanel.WrapperView.isShowing = function()
1400 { 1410 {
1401 return !!WebInspector.SourcesPanel.WrapperView._instance && WebInspector.Sou rcesPanel.WrapperView._instance.isShowing(); 1411 return !!WebInspector.SourcesPanel.WrapperView._instance && WebInspector.Sou rcesPanel.WrapperView._instance.isShowing();
1402 }; 1412 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698