| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 this.editorToolbar = this._createEditorToolbar(); | 46 this.editorToolbar = this._createEditorToolbar(); |
| 47 this.debugToolbar = this._createDebugToolbar(); | 47 this.debugToolbar = this._createDebugToolbar(); |
| 48 | 48 |
| 49 const initialSidebarWidth = 225; | 49 const initialSidebarWidth = 225; |
| 50 const minimalViewsContainerWidthPercent = 34; | 50 const minimalViewsContainerWidthPercent = 34; |
| 51 this.createSplitView(this.element, WebInspector.SplitView.SidebarPosition.Ri
ght, initialSidebarWidth); | 51 this.createSplitView(this.element, WebInspector.SplitView.SidebarPosition.Ri
ght, initialSidebarWidth); |
| 52 this.splitView.element.id = "scripts-split-view"; | 52 this.splitView.element.id = "scripts-split-view"; |
| 53 this.splitView.minimalSidebarWidth = Preferences.minScriptsSidebarWidth; | 53 this.splitView.minimalSidebarWidth = Preferences.minScriptsSidebarWidth; |
| 54 this.splitView.minimalMainWidthPercent = minimalViewsContainerWidthPercent; | 54 this.splitView.minimalMainWidthPercent = minimalViewsContainerWidthPercent; |
| 55 | 55 |
| 56 this.splitView.sidebarElement.appendChild(this.debugToolbar); | 56 this.sidebarElement.appendChild(this.debugToolbar); |
| 57 this.splitView.mainElement.appendChild(this.editorToolbar); | 57 this.splitView.mainElement.appendChild(this.editorToolbar); |
| 58 | 58 |
| 59 this.viewsContainerElement = this.splitView.mainElement; | 59 this.viewsContainerElement = this.splitView.mainElement; |
| 60 | 60 |
| 61 this.debugSidebarResizeWidgetElement = document.createElement("div"); | 61 this.debugSidebarResizeWidgetElement = document.createElement("div"); |
| 62 this.debugSidebarResizeWidgetElement.id = "scripts-debug-sidebar-resizer-wid
get"; | 62 this.debugSidebarResizeWidgetElement.id = "scripts-debug-sidebar-resizer-wid
get"; |
| 63 this.splitView.installResizer(this.debugSidebarResizeWidgetElement); | 63 this.splitView.installResizer(this.debugSidebarResizeWidgetElement); |
| 64 this.editorToolbar.appendChild(this.debugSidebarResizeWidgetElement); | 64 this.editorToolbar.appendChild(this.debugSidebarResizeWidgetElement); |
| 65 | 65 |
| 66 this.sidebarPanes = {}; | 66 this.sidebarPanes = {}; |
| 67 this.sidebarPanes.watchExpressions = new WebInspector.WatchExpressionsSideba
rPane(); | 67 this.sidebarPanes.watchExpressions = new WebInspector.WatchExpressionsSideba
rPane(); |
| 68 this.sidebarPanes.callstack = new WebInspector.CallStackSidebarPane(this._pr
esentationModel); | 68 this.sidebarPanes.callstack = new WebInspector.CallStackSidebarPane(this._pr
esentationModel); |
| 69 this.sidebarPanes.scopechain = new WebInspector.ScopeChainSidebarPane(); | 69 this.sidebarPanes.scopechain = new WebInspector.ScopeChainSidebarPane(); |
| 70 this.sidebarPanes.jsBreakpoints = new WebInspector.JavaScriptBreakpointsSide
barPane(this._presentationModel, this._showSourceLine.bind(this)); | 70 this.sidebarPanes.jsBreakpoints = new WebInspector.JavaScriptBreakpointsSide
barPane(this._presentationModel, this._showSourceLine.bind(this)); |
| 71 if (Capabilities.nativeInstrumentationEnabled) { | 71 if (Capabilities.nativeInstrumentationEnabled) { |
| 72 this.sidebarPanes.domBreakpoints = WebInspector.domBreakpointsSidebarPan
e; | 72 this.sidebarPanes.domBreakpoints = WebInspector.domBreakpointsSidebarPan
e; |
| 73 this.sidebarPanes.xhrBreakpoints = new WebInspector.XHRBreakpointsSideba
rPane(); | 73 this.sidebarPanes.xhrBreakpoints = new WebInspector.XHRBreakpointsSideba
rPane(); |
| 74 this.sidebarPanes.eventListenerBreakpoints = new WebInspector.EventListe
nerBreakpointsSidebarPane(); | 74 this.sidebarPanes.eventListenerBreakpoints = new WebInspector.EventListe
nerBreakpointsSidebarPane(); |
| 75 } | 75 } |
| 76 | 76 |
| 77 if (Preferences.exposeWorkersInspection && !WebInspector.WorkerManager.isWor
kerFrontend()) { | 77 if (Preferences.exposeWorkersInspection && !WebInspector.WorkerManager.isWor
kerFrontend()) { |
| 78 WorkerAgent.setWorkerInspectionEnabled(true); | 78 WorkerAgent.setWorkerInspectionEnabled(true); |
| 79 this.sidebarPanes.workerList = new WebInspector.WorkerListSidebarPane(We
bInspector.workerManager); | 79 this.sidebarPanes.workerList = new WebInspector.WorkerListSidebarPane(We
bInspector.workerManager); |
| 80 } else | 80 } else |
| 81 this.sidebarPanes.workers = new WebInspector.WorkersSidebarPane(); | 81 this.sidebarPanes.workers = new WebInspector.WorkersSidebarPane(); |
| 82 | 82 |
| 83 this._debugSidebarContentsElement = document.createElement("div"); |
| 84 this._debugSidebarContentsElement.id = "scripts-debug-sidebar-contents"; |
| 85 this.sidebarElement.appendChild(this._debugSidebarContentsElement); |
| 86 |
| 83 for (var pane in this.sidebarPanes) | 87 for (var pane in this.sidebarPanes) |
| 84 this.sidebarElement.appendChild(this.sidebarPanes[pane].element); | 88 this._debugSidebarContentsElement.appendChild(this.sidebarPanes[pane].el
ement); |
| 85 | 89 |
| 86 this.sidebarPanes.callstack.expanded = true; | 90 this.sidebarPanes.callstack.expanded = true; |
| 87 | 91 |
| 88 this.sidebarPanes.scopechain.expanded = true; | 92 this.sidebarPanes.scopechain.expanded = true; |
| 89 this.sidebarPanes.jsBreakpoints.expanded = true; | 93 this.sidebarPanes.jsBreakpoints.expanded = true; |
| 90 | 94 |
| 91 var helpSection = WebInspector.shortcutsScreen.section(WebInspector.UIString
("Scripts Panel")); | 95 var helpSection = WebInspector.shortcutsScreen.section(WebInspector.UIString
("Scripts Panel")); |
| 92 this.sidebarPanes.callstack.registerShortcuts(helpSection, this.registerShor
tcut.bind(this)); | 96 this.sidebarPanes.callstack.registerShortcuts(helpSection, this.registerShor
tcut.bind(this)); |
| 93 var evaluateInConsoleShortcut = WebInspector.KeyboardShortcut.makeDescriptor
("e", WebInspector.KeyboardShortcut.Modifiers.Shift | WebInspector.KeyboardShort
cut.Modifiers.Ctrl); | 97 var evaluateInConsoleShortcut = WebInspector.KeyboardShortcut.makeDescriptor
("e", WebInspector.KeyboardShortcut.Modifiers.Shift | WebInspector.KeyboardShort
cut.Modifiers.Ctrl); |
| 94 helpSection.addKey(evaluateInConsoleShortcut.name, WebInspector.UIString("Ev
aluate selection in console")); | 98 helpSection.addKey(evaluateInConsoleShortcut.name, WebInspector.UIString("Ev
aluate selection in console")); |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 | 175 |
| 172 get paused() | 176 get paused() |
| 173 { | 177 { |
| 174 return this._paused; | 178 return this._paused; |
| 175 }, | 179 }, |
| 176 | 180 |
| 177 wasShown: function() | 181 wasShown: function() |
| 178 { | 182 { |
| 179 WebInspector.Panel.prototype.wasShown.call(this); | 183 WebInspector.Panel.prototype.wasShown.call(this); |
| 180 if (Capabilities.nativeInstrumentationEnabled) | 184 if (Capabilities.nativeInstrumentationEnabled) |
| 181 this.sidebarElement.insertBefore(this.sidebarPanes.domBreakpoints.el
ement, this.sidebarPanes.xhrBreakpoints.element); | 185 this._debugSidebarContentsElement.insertBefore(this.sidebarPanes.dom
Breakpoints.element, this.sidebarPanes.xhrBreakpoints.element); |
| 182 this.sidebarPanes.watchExpressions.show(); | 186 this.sidebarPanes.watchExpressions.show(); |
| 183 }, | 187 }, |
| 184 | 188 |
| 185 breakpointsActivated: function() | 189 breakpointsActivated: function() |
| 186 { | 190 { |
| 187 return this.toggleBreakpointsButton.toggled; | 191 return this.toggleBreakpointsButton.toggled; |
| 188 }, | 192 }, |
| 189 | 193 |
| 190 activateBreakpoints: function() | 194 activateBreakpoints: function() |
| 191 { | 195 { |
| (...skipping 958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1150 this._presentationModel.setFormatSource(this._toggleFormatSourceButton.t
oggled); | 1154 this._presentationModel.setFormatSource(this._toggleFormatSourceButton.t
oggled); |
| 1151 }, | 1155 }, |
| 1152 | 1156 |
| 1153 addToWatch: function(expression) | 1157 addToWatch: function(expression) |
| 1154 { | 1158 { |
| 1155 this.sidebarPanes.watchExpressions.addExpression(expression); | 1159 this.sidebarPanes.watchExpressions.addExpression(expression); |
| 1156 } | 1160 } |
| 1157 } | 1161 } |
| 1158 | 1162 |
| 1159 WebInspector.ScriptsPanel.prototype.__proto__ = WebInspector.Panel.prototype; | 1163 WebInspector.ScriptsPanel.prototype.__proto__ = WebInspector.Panel.prototype; |
| OLD | NEW |