OLD | NEW |
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 25 matching lines...) Expand all Loading... |
36 this.registerRequiredCSS("sources/sourcesPanel.css"); | 36 this.registerRequiredCSS("sources/sourcesPanel.css"); |
37 new WebInspector.DropTarget(this.element, [WebInspector.DropTarget.Types.Fil
es], WebInspector.UIString("Drop workspace folder here"), this._handleDrop.bind(
this)); | 37 new WebInspector.DropTarget(this.element, [WebInspector.DropTarget.Types.Fil
es], WebInspector.UIString("Drop workspace folder here"), this._handleDrop.bind(
this)); |
38 | 38 |
39 this._workspace = workspaceForTest || WebInspector.workspace; | 39 this._workspace = workspaceForTest || WebInspector.workspace; |
40 this._networkMapping = WebInspector.networkMapping; | 40 this._networkMapping = WebInspector.networkMapping; |
41 | 41 |
42 this._debugToolbar = this._createDebugToolbar(); | 42 this._debugToolbar = this._createDebugToolbar(); |
43 this._debugToolbarDrawer = this._createDebugToolbarDrawer(); | 43 this._debugToolbarDrawer = this._createDebugToolbarDrawer(); |
44 | 44 |
45 const initialDebugSidebarWidth = 225; | 45 const initialDebugSidebarWidth = 225; |
46 this._splitView = new WebInspector.SplitView(true, true, "sourcesPanelSplitV
iewState", initialDebugSidebarWidth); | 46 this._splitWidget = new WebInspector.SplitWidget(true, true, "sourcesPanelSp
litViewState", initialDebugSidebarWidth); |
47 this._splitView.enableShowModeSaving(); | 47 this._splitWidget.enableShowModeSaving(); |
48 this._splitView.show(this.element); | 48 this._splitWidget.show(this.element); |
49 | 49 |
50 // Create scripts navigator | 50 // Create scripts navigator |
51 const initialNavigatorWidth = 225; | 51 const initialNavigatorWidth = 225; |
52 this.editorView = new WebInspector.SplitView(true, false, "sourcesPanelNavig
atorSplitViewState", initialNavigatorWidth); | 52 this.editorView = new WebInspector.SplitWidget(true, false, "sourcesPanelNav
igatorSplitViewState", initialNavigatorWidth); |
53 this.editorView.enableShowModeSaving(); | 53 this.editorView.enableShowModeSaving(); |
54 this.editorView.element.tabIndex = 0; | 54 this.editorView.element.tabIndex = 0; |
55 this._splitView.setMainView(this.editorView); | 55 this._splitWidget.setMainWidget(this.editorView); |
56 | 56 |
57 this._navigator = new WebInspector.SourcesNavigator(this._workspace); | 57 this._navigator = new WebInspector.SourcesNavigator(this._workspace); |
58 this._navigator.view.setMinimumSize(100, 25); | 58 this._navigator.view.setMinimumSize(100, 25); |
59 this.editorView.setSidebarView(this._navigator.view); | 59 this.editorView.setSidebarWidget(this._navigator.view); |
60 this._navigator.addEventListener(WebInspector.SourcesNavigator.Events.Source
Selected, this._sourceSelected, this); | 60 this._navigator.addEventListener(WebInspector.SourcesNavigator.Events.Source
Selected, this._sourceSelected, this); |
61 this._navigator.addEventListener(WebInspector.SourcesNavigator.Events.Source
Renamed, this._sourceRenamed, this); | 61 this._navigator.addEventListener(WebInspector.SourcesNavigator.Events.Source
Renamed, this._sourceRenamed, this); |
62 | 62 |
63 this._sourcesView = new WebInspector.SourcesView(this._workspace, this); | 63 this._sourcesView = new WebInspector.SourcesView(this._workspace, this); |
64 this._sourcesView.addEventListener(WebInspector.SourcesView.Events.EditorSel
ected, this._editorSelected.bind(this)); | 64 this._sourcesView.addEventListener(WebInspector.SourcesView.Events.EditorSel
ected, this._editorSelected.bind(this)); |
65 this._sourcesView.addEventListener(WebInspector.SourcesView.Events.EditorClo
sed, this._editorClosed.bind(this)); | 65 this._sourcesView.addEventListener(WebInspector.SourcesView.Events.EditorClo
sed, this._editorClosed.bind(this)); |
66 this._sourcesView.registerShortcuts(this.registerShortcuts.bind(this)); | 66 this._sourcesView.registerShortcuts(this.registerShortcuts.bind(this)); |
67 this.editorView.setMainView(this._sourcesView); | 67 this.editorView.setMainWidget(this._sourcesView); |
68 | 68 |
69 this._debugSidebarResizeWidgetElement = createElement("div"); | 69 this._debugSidebarResizeWidgetElement = createElement("div"); |
70 this._debugSidebarResizeWidgetElement.id = "scripts-debug-sidebar-resizer-wi
dget"; | 70 this._debugSidebarResizeWidgetElement.id = "scripts-debug-sidebar-resizer-wi
dget"; |
71 this._splitView.addEventListener(WebInspector.SplitView.Events.ShowModeChang
ed, this._updateDebugSidebarResizeWidget, this); | 71 this._splitWidget.addEventListener(WebInspector.SplitWidget.Events.ShowModeC
hanged, this._updateDebugSidebarResizeWidget, this); |
72 this._updateDebugSidebarResizeWidget(); | 72 this._updateDebugSidebarResizeWidget(); |
73 this._splitView.installResizer(this._debugSidebarResizeWidgetElement); | 73 this._splitWidget.installResizer(this._debugSidebarResizeWidgetElement); |
74 | 74 |
75 this.sidebarPanes = {}; | 75 this.sidebarPanes = {}; |
76 this.sidebarPanes.threads = new WebInspector.ThreadsSidebarPane(); | 76 this.sidebarPanes.threads = new WebInspector.ThreadsSidebarPane(); |
77 this.sidebarPanes.watchExpressions = new WebInspector.WatchExpressionsSideba
rPane(); | 77 this.sidebarPanes.watchExpressions = new WebInspector.WatchExpressionsSideba
rPane(); |
78 this.sidebarPanes.callstack = new WebInspector.CallStackSidebarPane(); | 78 this.sidebarPanes.callstack = new WebInspector.CallStackSidebarPane(); |
79 this.sidebarPanes.callstack.addEventListener(WebInspector.CallStackSidebarPa
ne.Events.CallFrameSelected, this._callFrameSelectedInSidebar.bind(this)); | 79 this.sidebarPanes.callstack.addEventListener(WebInspector.CallStackSidebarPa
ne.Events.CallFrameSelected, this._callFrameSelectedInSidebar.bind(this)); |
80 this.sidebarPanes.callstack.addEventListener(WebInspector.CallStackSidebarPa
ne.Events.RevealHiddenCallFrames, this._hiddenCallFramesRevealedInSidebar.bind(t
his)); | 80 this.sidebarPanes.callstack.addEventListener(WebInspector.CallStackSidebarPa
ne.Events.RevealHiddenCallFrames, this._hiddenCallFramesRevealedInSidebar.bind(t
his)); |
81 this.sidebarPanes.callstack.registerShortcuts(this.registerShortcuts.bind(th
is)); | 81 this.sidebarPanes.callstack.registerShortcuts(this.registerShortcuts.bind(th
is)); |
82 | 82 |
83 this.sidebarPanes.scopechain = new WebInspector.ScopeChainSidebarPane(); | 83 this.sidebarPanes.scopechain = new WebInspector.ScopeChainSidebarPane(); |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 this.sidebarPanes.callstack.setStatus(WebInspector.UIString("Pau
sed on a \"%s\" async operation.", description)); | 271 this.sidebarPanes.callstack.setStatus(WebInspector.UIString("Pau
sed on a \"%s\" async operation.", description)); |
272 this.sidebarPanes.asyncOperationBreakpoints.highlightBreakpoint(
operationId); | 272 this.sidebarPanes.asyncOperationBreakpoints.highlightBreakpoint(
operationId); |
273 } | 273 } |
274 } else { | 274 } else { |
275 if (details.callFrames.length) | 275 if (details.callFrames.length) |
276 WebInspector.debuggerWorkspaceBinding.createCallFrameLiveLocatio
n(details.callFrames[0], didGetUILocation.bind(this)); | 276 WebInspector.debuggerWorkspaceBinding.createCallFrameLiveLocatio
n(details.callFrames[0], didGetUILocation.bind(this)); |
277 else | 277 else |
278 console.warn("ScriptsPanel paused, but callFrames.length is zero
."); // TODO remove this once we understand this case better | 278 console.warn("ScriptsPanel paused, but callFrames.length is zero
."); // TODO remove this once we understand this case better |
279 } | 279 } |
280 | 280 |
281 this._splitView.showBoth(true); | 281 this._splitWidget.showBoth(true); |
282 this._toggleDebuggerSidebarButton.disabled = true; | 282 this._toggleDebuggerSidebarButton.disabled = true; |
283 window.focus(); | 283 window.focus(); |
284 InspectorFrontendHost.bringToFront(); | 284 InspectorFrontendHost.bringToFront(); |
285 }, | 285 }, |
286 | 286 |
287 /** | 287 /** |
288 * @param {!WebInspector.Event} event | 288 * @param {!WebInspector.Event} event |
289 */ | 289 */ |
290 _debuggerResumed: function(event) | 290 _debuggerResumed: function(event) |
291 { | 291 { |
(...skipping 20 matching lines...) Expand all Loading... |
312 | 312 |
313 /** | 313 /** |
314 * @param {!WebInspector.Event} event | 314 * @param {!WebInspector.Event} event |
315 */ | 315 */ |
316 _debuggerReset: function(event) | 316 _debuggerReset: function(event) |
317 { | 317 { |
318 this._debuggerResumed(event); | 318 this._debuggerResumed(event); |
319 }, | 319 }, |
320 | 320 |
321 /** | 321 /** |
322 * @return {!WebInspector.View} | 322 * @return {!WebInspector.Widget} |
323 */ | 323 */ |
324 get visibleView() | 324 get visibleView() |
325 { | 325 { |
326 return this._sourcesView.visibleView(); | 326 return this._sourcesView.visibleView(); |
327 }, | 327 }, |
328 | 328 |
329 /** | 329 /** |
330 * @param {!WebInspector.UISourceCode} uiSourceCode | 330 * @param {!WebInspector.UISourceCode} uiSourceCode |
331 * @param {number=} lineNumber 0-based | 331 * @param {number=} lineNumber 0-based |
332 * @param {number=} columnNumber | 332 * @param {number=} columnNumber |
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
784 }, | 784 }, |
785 | 785 |
786 addToWatch: function(expression) | 786 addToWatch: function(expression) |
787 { | 787 { |
788 this.sidebarPanes.watchExpressions.addExpression(expression); | 788 this.sidebarPanes.watchExpressions.addExpression(expression); |
789 }, | 789 }, |
790 | 790 |
791 _installDebuggerSidebarController: function() | 791 _installDebuggerSidebarController: function() |
792 { | 792 { |
793 this.editorView.displayShowHideSidebarButton("navigator"); | 793 this.editorView.displayShowHideSidebarButton("navigator"); |
794 this._toggleDebuggerSidebarButton = this._splitView.displayShowHideSideb
arButton("debugger", "scripts-debugger-show-hide-button"); | 794 this._toggleDebuggerSidebarButton = this._splitWidget.displayShowHideSid
ebarButton("debugger", "scripts-debugger-show-hide-button"); |
795 this._sourcesView.element.appendChild(this._debugSidebarResizeWidgetElem
ent); | 795 this._sourcesView.element.appendChild(this._debugSidebarResizeWidgetElem
ent); |
796 }, | 796 }, |
797 | 797 |
798 _updateDebugSidebarResizeWidget: function() | 798 _updateDebugSidebarResizeWidget: function() |
799 { | 799 { |
800 this._debugSidebarResizeWidgetElement.classList.toggle("hidden", this._s
plitView.showMode() !== WebInspector.SplitView.ShowMode.Both); | 800 this._debugSidebarResizeWidgetElement.classList.toggle("hidden", this._s
plitWidget.showMode() !== WebInspector.SplitWidget.ShowMode.Both); |
801 }, | 801 }, |
802 | 802 |
803 /** | 803 /** |
804 * @param {!WebInspector.UISourceCode} uiSourceCode | 804 * @param {!WebInspector.UISourceCode} uiSourceCode |
805 */ | 805 */ |
806 _showLocalHistory: function(uiSourceCode) | 806 _showLocalHistory: function(uiSourceCode) |
807 { | 807 { |
808 WebInspector.RevisionHistoryView.showHistory(uiSourceCode); | 808 WebInspector.RevisionHistoryView.showHistory(uiSourceCode); |
809 }, | 809 }, |
810 | 810 |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1088 { | 1088 { |
1089 var vertically = WebInspector.dockController.isVertical() && WebInspecto
r.moduleSetting("splitVerticallyWhenDockedToRight").get(); | 1089 var vertically = WebInspector.dockController.isVertical() && WebInspecto
r.moduleSetting("splitVerticallyWhenDockedToRight").get(); |
1090 this._splitVertically(vertically); | 1090 this._splitVertically(vertically); |
1091 }, | 1091 }, |
1092 | 1092 |
1093 /** | 1093 /** |
1094 * @param {boolean} vertically | 1094 * @param {boolean} vertically |
1095 */ | 1095 */ |
1096 _splitVertically: function(vertically) | 1096 _splitVertically: function(vertically) |
1097 { | 1097 { |
1098 if (this.sidebarPaneView && vertically === !this._splitView.isVertical()
) | 1098 if (this.sidebarPaneView && vertically === !this._splitWidget.isVertical
()) |
1099 return; | 1099 return; |
1100 | 1100 |
1101 if (this.sidebarPaneView) | 1101 if (this.sidebarPaneView) |
1102 this.sidebarPaneView.detach(); | 1102 this.sidebarPaneView.detach(); |
1103 | 1103 |
1104 this._splitView.setVertical(!vertically); | 1104 this._splitWidget.setVertical(!vertically); |
1105 this._splitView.element.classList.toggle("sources-split-view-vertical",
vertically); | 1105 this._splitWidget.element.classList.toggle("sources-split-view-vertical"
, vertically); |
1106 | 1106 |
1107 if (!vertically) | 1107 if (!vertically) |
1108 this._splitView.uninstallResizer(this._sourcesView.toolbarContainerE
lement()); | 1108 this._splitWidget.uninstallResizer(this._sourcesView.toolbarContaine
rElement()); |
1109 else | 1109 else |
1110 this._splitView.installResizer(this._sourcesView.toolbarContainerEle
ment()); | 1110 this._splitWidget.installResizer(this._sourcesView.toolbarContainerE
lement()); |
1111 | 1111 |
1112 // Create vertical box with stack. | 1112 // Create vertical box with stack. |
1113 var vbox = new WebInspector.VBox(); | 1113 var vbox = new WebInspector.VBox(); |
1114 vbox.element.appendChild(this._debugToolbarDrawer); | 1114 vbox.element.appendChild(this._debugToolbarDrawer); |
1115 vbox.element.appendChild(this._debugToolbar.element); | 1115 vbox.element.appendChild(this._debugToolbar.element); |
1116 vbox.setMinimumAndPreferredSizes(25, 25, WebInspector.SourcesPanel.minTo
olbarWidth, 100); | 1116 vbox.setMinimumAndPreferredSizes(25, 25, WebInspector.SourcesPanel.minTo
olbarWidth, 100); |
1117 var sidebarPaneStack = new WebInspector.SidebarPaneStack(); | 1117 var sidebarPaneStack = new WebInspector.SidebarPaneStack(); |
1118 sidebarPaneStack.element.classList.add("flex-auto"); | 1118 sidebarPaneStack.element.classList.add("flex-auto"); |
1119 sidebarPaneStack.show(vbox.element); | 1119 sidebarPaneStack.show(vbox.element); |
1120 | 1120 |
1121 if (!vertically) { | 1121 if (!vertically) { |
1122 // Populate the only stack. | 1122 // Populate the only stack. |
1123 for (var pane in this.sidebarPanes) | 1123 for (var pane in this.sidebarPanes) |
1124 sidebarPaneStack.addPane(this.sidebarPanes[pane]); | 1124 sidebarPaneStack.addPane(this.sidebarPanes[pane]); |
1125 this._extensionSidebarPanesContainer = sidebarPaneStack; | 1125 this._extensionSidebarPanesContainer = sidebarPaneStack; |
1126 this.sidebarPaneView = vbox; | 1126 this.sidebarPaneView = vbox; |
1127 | 1127 |
1128 this.sidebarPanes.scopechain.expand(); | 1128 this.sidebarPanes.scopechain.expand(); |
1129 this.sidebarPanes.watchExpressions.expandIfNecessary(); | 1129 this.sidebarPanes.watchExpressions.expandIfNecessary(); |
1130 } else { | 1130 } else { |
1131 var splitView = new WebInspector.SplitView(true, true, "sourcesPanel
DebuggerSidebarSplitViewState", 0.5); | 1131 var splitWidget = new WebInspector.SplitWidget(true, true, "sourcesP
anelDebuggerSidebarSplitViewState", 0.5); |
1132 splitView.setMainView(vbox); | 1132 splitWidget.setMainWidget(vbox); |
1133 | 1133 |
1134 // Populate the left stack. | 1134 // Populate the left stack. |
1135 sidebarPaneStack.addPane(this.sidebarPanes.threads); | 1135 sidebarPaneStack.addPane(this.sidebarPanes.threads); |
1136 sidebarPaneStack.addPane(this.sidebarPanes.callstack); | 1136 sidebarPaneStack.addPane(this.sidebarPanes.callstack); |
1137 sidebarPaneStack.addPane(this.sidebarPanes.jsBreakpoints); | 1137 sidebarPaneStack.addPane(this.sidebarPanes.jsBreakpoints); |
1138 sidebarPaneStack.addPane(this.sidebarPanes.domBreakpoints); | 1138 sidebarPaneStack.addPane(this.sidebarPanes.domBreakpoints); |
1139 sidebarPaneStack.addPane(this.sidebarPanes.xhrBreakpoints); | 1139 sidebarPaneStack.addPane(this.sidebarPanes.xhrBreakpoints); |
1140 sidebarPaneStack.addPane(this.sidebarPanes.eventListenerBreakpoints)
; | 1140 sidebarPaneStack.addPane(this.sidebarPanes.eventListenerBreakpoints)
; |
1141 if (Runtime.experiments.isEnabled("stepIntoAsync")) | 1141 if (Runtime.experiments.isEnabled("stepIntoAsync")) |
1142 sidebarPaneStack.addPane(this.sidebarPanes.asyncOperationBreakpo
ints); | 1142 sidebarPaneStack.addPane(this.sidebarPanes.asyncOperationBreakpo
ints); |
1143 | 1143 |
1144 var tabbedPane = new WebInspector.SidebarTabbedPane(); | 1144 var tabbedPane = new WebInspector.SidebarTabbedPane(); |
1145 splitView.setSidebarView(tabbedPane); | 1145 splitWidget.setSidebarWidget(tabbedPane); |
1146 tabbedPane.addPane(this.sidebarPanes.scopechain); | 1146 tabbedPane.addPane(this.sidebarPanes.scopechain); |
1147 tabbedPane.addPane(this.sidebarPanes.watchExpressions); | 1147 tabbedPane.addPane(this.sidebarPanes.watchExpressions); |
1148 if (this.sidebarPanes.serviceWorkers) | 1148 if (this.sidebarPanes.serviceWorkers) |
1149 tabbedPane.addPane(this.sidebarPanes.serviceWorkers); | 1149 tabbedPane.addPane(this.sidebarPanes.serviceWorkers); |
1150 tabbedPane.selectTab(this._lastSelectedTabSetting.get()); | 1150 tabbedPane.selectTab(this._lastSelectedTabSetting.get()); |
1151 tabbedPane.addEventListener(WebInspector.TabbedPane.EventTypes.TabSe
lected, this._tabSelected, this); | 1151 tabbedPane.addEventListener(WebInspector.TabbedPane.EventTypes.TabSe
lected, this._tabSelected, this); |
1152 this._extensionSidebarPanesContainer = tabbedPane; | 1152 this._extensionSidebarPanesContainer = tabbedPane; |
1153 this.sidebarPaneView = splitView; | 1153 this.sidebarPaneView = splitWidget; |
1154 } | 1154 } |
1155 | 1155 |
1156 var extensionSidebarPanes = WebInspector.extensionServer.sidebarPanes(); | 1156 var extensionSidebarPanes = WebInspector.extensionServer.sidebarPanes(); |
1157 for (var i = 0; i < extensionSidebarPanes.length; ++i) | 1157 for (var i = 0; i < extensionSidebarPanes.length; ++i) |
1158 this._addExtensionSidebarPane(extensionSidebarPanes[i]); | 1158 this._addExtensionSidebarPane(extensionSidebarPanes[i]); |
1159 | 1159 |
1160 this._splitView.setSidebarView(this.sidebarPaneView); | 1160 this._splitWidget.setSidebarWidget(this.sidebarPaneView); |
1161 this.sidebarPanes.threads.expand(); | 1161 this.sidebarPanes.threads.expand(); |
1162 this.sidebarPanes.jsBreakpoints.expand(); | 1162 this.sidebarPanes.jsBreakpoints.expand(); |
1163 this.sidebarPanes.callstack.expand(); | 1163 this.sidebarPanes.callstack.expand(); |
1164 }, | 1164 }, |
1165 | 1165 |
1166 /** | 1166 /** |
1167 * @param {!WebInspector.Event} event | 1167 * @param {!WebInspector.Event} event |
1168 */ | 1168 */ |
1169 _tabSelected: function(event) | 1169 _tabSelected: function(event) |
1170 { | 1170 { |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1418 WebInspector.SourcesPanelFactory.prototype = { | 1418 WebInspector.SourcesPanelFactory.prototype = { |
1419 /** | 1419 /** |
1420 * @override | 1420 * @override |
1421 * @return {!WebInspector.Panel} | 1421 * @return {!WebInspector.Panel} |
1422 */ | 1422 */ |
1423 createPanel: function() | 1423 createPanel: function() |
1424 { | 1424 { |
1425 return WebInspector.SourcesPanel.instance(); | 1425 return WebInspector.SourcesPanel.instance(); |
1426 } | 1426 } |
1427 } | 1427 } |
OLD | NEW |