Chromium Code Reviews| 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 109 this._splitView.installResizer(this._debugSidebarResizeWidgetElement); | 109 this._splitView.installResizer(this._debugSidebarResizeWidgetElement); |
| 110 | 110 |
| 111 this.sidebarPanes = {}; | 111 this.sidebarPanes = {}; |
| 112 this.sidebarPanes.watchExpressions = new WebInspector.WatchExpressionsSideba rPane(); | 112 this.sidebarPanes.watchExpressions = new WebInspector.WatchExpressionsSideba rPane(); |
| 113 this.sidebarPanes.callstack = new WebInspector.CallStackSidebarPane(); | 113 this.sidebarPanes.callstack = new WebInspector.CallStackSidebarPane(); |
| 114 this.sidebarPanes.callstack.addEventListener(WebInspector.CallStackSidebarPa ne.Events.CallFrameSelected, this._callFrameSelectedInSidebar.bind(this)); | 114 this.sidebarPanes.callstack.addEventListener(WebInspector.CallStackSidebarPa ne.Events.CallFrameSelected, this._callFrameSelectedInSidebar.bind(this)); |
| 115 this.sidebarPanes.callstack.addEventListener(WebInspector.CallStackSidebarPa ne.Events.CallFrameRestarted, this._callFrameRestartedInSidebar.bind(this)); | 115 this.sidebarPanes.callstack.addEventListener(WebInspector.CallStackSidebarPa ne.Events.CallFrameRestarted, this._callFrameRestartedInSidebar.bind(this)); |
| 116 this.sidebarPanes.callstack.registerShortcuts(this.registerShortcuts.bind(th is)); | 116 this.sidebarPanes.callstack.registerShortcuts(this.registerShortcuts.bind(th is)); |
| 117 | 117 |
| 118 this.sidebarPanes.scopechain = new WebInspector.ScopeChainSidebarPane(); | 118 this.sidebarPanes.scopechain = new WebInspector.ScopeChainSidebarPane(); |
| 119 this.sidebarPanes.jsBreakpoints = new WebInspector.JavaScriptBreakpointsSide barPane(WebInspector.debuggerModel, WebInspector.breakpointManager, this.showUIS ourceCode.bind(this)); | 119 this.sidebarPanes.jsBreakpoints = new WebInspector.JavaScriptBreakpointsSide barPane(WebInspector.breakpointManager, this.showUISourceCode.bind(this)); |
| 120 this.sidebarPanes.domBreakpoints = WebInspector.domBreakpointsSidebarPane.cr eateProxy(this); | 120 this.sidebarPanes.domBreakpoints = WebInspector.domBreakpointsSidebarPane.cr eateProxy(this); |
| 121 this.sidebarPanes.xhrBreakpoints = new WebInspector.XHRBreakpointsSidebarPan e(); | 121 this.sidebarPanes.xhrBreakpoints = new WebInspector.XHRBreakpointsSidebarPan e(); |
| 122 this.sidebarPanes.eventListenerBreakpoints = new WebInspector.EventListenerB reakpointsSidebarPane(); | 122 this.sidebarPanes.eventListenerBreakpoints = new WebInspector.EventListenerB reakpointsSidebarPane(); |
| 123 | 123 |
| 124 if (Capabilities.isMainFrontend) | 124 if (Capabilities.isMainFrontend) |
| 125 this.sidebarPanes.workerList = new WebInspector.WorkersSidebarPane(); | 125 this.sidebarPanes.workerList = new WebInspector.WorkersSidebarPane(); |
| 126 | 126 |
| 127 this._extensionSidebarPanes = []; | 127 this._extensionSidebarPanes = []; |
| 128 this._installDebuggerSidebarController(); | 128 this._installDebuggerSidebarController(); |
| 129 | 129 |
| 130 WebInspector.dockController.addEventListener(WebInspector.DockController.Eve nts.DockSideChanged, this._dockSideChanged.bind(this)); | 130 WebInspector.dockController.addEventListener(WebInspector.DockController.Eve nts.DockSideChanged, this._dockSideChanged.bind(this)); |
| 131 WebInspector.settings.splitVerticallyWhenDockedToRight.addChangeListener(thi s._dockSideChanged.bind(this)); | 131 WebInspector.settings.splitVerticallyWhenDockedToRight.addChangeListener(thi s._dockSideChanged.bind(this)); |
| 132 this._dockSideChanged(); | 132 this._dockSideChanged(); |
| 133 | 133 |
| 134 this._updateDebuggerButtons(); | 134 this._updateDebuggerButtons(); |
| 135 this._pauseOnExceptionEnabledChanged(); | 135 this._pauseOnExceptionEnabledChanged(); |
| 136 WebInspector.settings.pauseOnExceptionEnabled.addChangeListener(this._pauseO nExceptionEnabledChanged, this); | 136 WebInspector.settings.pauseOnExceptionEnabled.addChangeListener(this._pauseO nExceptionEnabledChanged, this); |
| 137 WebInspector.targetManager.observeTargets(this); | 137 WebInspector.targetManager.observeTargets(this); |
| 138 this._setTarget(WebInspector.context.flavor(WebInspector.Target)); | 138 this._setTarget(WebInspector.context.flavor(WebInspector.Target)); |
| 139 WebInspector.breakpointManager.addEventListener(WebInspector.BreakpointManag er.Events.BreakpointsActiveStateChanged, this._breakpointsActiveStateChanged, th is); | |
| 139 WebInspector.context.addFlavorChangeListener(WebInspector.Target, this._onCu rrentTargetChanged, this); | 140 WebInspector.context.addFlavorChangeListener(WebInspector.Target, this._onCu rrentTargetChanged, this); |
| 140 } | 141 } |
| 141 | 142 |
| 142 WebInspector.SourcesPanel.minToolbarWidth = 215; | 143 WebInspector.SourcesPanel.minToolbarWidth = 215; |
| 143 | 144 |
| 144 WebInspector.SourcesPanel.prototype = { | 145 WebInspector.SourcesPanel.prototype = { |
| 145 /** | 146 /** |
| 146 * @param {!WebInspector.Target} target | 147 * @param {!WebInspector.Target} target |
| 147 */ | 148 */ |
| 148 targetAdded: function(target) | 149 targetAdded: function(target) |
| 149 { | 150 { |
| 150 target.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events. DebuggerWasEnabled, this._debuggerWasEnabled, this); | 151 target.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events. DebuggerWasEnabled, this._debuggerWasEnabled, this); |
| 151 target.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events. DebuggerWasDisabled, this._debuggerReset, this); | 152 target.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events. DebuggerWasDisabled, this._debuggerReset, this); |
| 152 target.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events. DebuggerPaused, this._debuggerPaused, this); | 153 target.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events. DebuggerPaused, this._debuggerPaused, this); |
| 153 target.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events. DebuggerResumed, this._debuggerResumed, this); | 154 target.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events. DebuggerResumed, this._debuggerResumed, this); |
| 154 target.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events. CallFrameSelected, this._callFrameSelected, this); | 155 target.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events. CallFrameSelected, this._callFrameSelected, this); |
| 155 target.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events. ConsoleCommandEvaluatedInSelectedCallFrame, this._consoleCommandEvaluatedInSelec tedCallFrame, this); | 156 target.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events. ConsoleCommandEvaluatedInSelectedCallFrame, this._consoleCommandEvaluatedInSelec tedCallFrame, this); |
| 156 target.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events. BreakpointsActiveStateChanged, this._breakpointsActiveStateChanged, this); | |
| 157 target.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events. GlobalObjectCleared, this._debuggerReset, this); | 157 target.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events. GlobalObjectCleared, this._debuggerReset, this); |
| 158 }, | 158 }, |
| 159 | 159 |
| 160 /** | 160 /** |
| 161 * @param {!WebInspector.Target} target | 161 * @param {!WebInspector.Target} target |
| 162 */ | 162 */ |
| 163 targetRemoved: function(target) | 163 targetRemoved: function(target) |
| 164 { | 164 { |
| 165 target.debuggerModel.removeEventListener(WebInspector.DebuggerModel.Even ts.DebuggerWasEnabled, this._debuggerWasEnabled, this); | 165 target.debuggerModel.removeEventListener(WebInspector.DebuggerModel.Even ts.DebuggerWasEnabled, this._debuggerWasEnabled, this); |
| 166 target.debuggerModel.removeEventListener(WebInspector.DebuggerModel.Even ts.DebuggerWasDisabled, this._debuggerReset, this); | 166 target.debuggerModel.removeEventListener(WebInspector.DebuggerModel.Even ts.DebuggerWasDisabled, this._debuggerReset, this); |
| 167 target.debuggerModel.removeEventListener(WebInspector.DebuggerModel.Even ts.DebuggerPaused, this._debuggerPaused, this); | 167 target.debuggerModel.removeEventListener(WebInspector.DebuggerModel.Even ts.DebuggerPaused, this._debuggerPaused, this); |
| 168 target.debuggerModel.removeEventListener(WebInspector.DebuggerModel.Even ts.DebuggerResumed, this._debuggerResumed, this); | 168 target.debuggerModel.removeEventListener(WebInspector.DebuggerModel.Even ts.DebuggerResumed, this._debuggerResumed, this); |
| 169 target.debuggerModel.removeEventListener(WebInspector.DebuggerModel.Even ts.CallFrameSelected, this._callFrameSelected, this); | 169 target.debuggerModel.removeEventListener(WebInspector.DebuggerModel.Even ts.CallFrameSelected, this._callFrameSelected, this); |
| 170 target.debuggerModel.removeEventListener(WebInspector.DebuggerModel.Even ts.ConsoleCommandEvaluatedInSelectedCallFrame, this._consoleCommandEvaluatedInSe lectedCallFrame, this); | 170 target.debuggerModel.removeEventListener(WebInspector.DebuggerModel.Even ts.ConsoleCommandEvaluatedInSelectedCallFrame, this._consoleCommandEvaluatedInSe lectedCallFrame, this); |
| 171 target.debuggerModel.removeEventListener(WebInspector.DebuggerModel.Even ts.BreakpointsActiveStateChanged, this._breakpointsActiveStateChanged, this); | |
| 172 target.debuggerModel.removeEventListener(WebInspector.DebuggerModel.Even ts.GlobalObjectCleared, this._debuggerReset, this); | 171 target.debuggerModel.removeEventListener(WebInspector.DebuggerModel.Even ts.GlobalObjectCleared, this._debuggerReset, this); |
| 173 }, | 172 }, |
| 174 | 173 |
| 175 /** | 174 /** |
| 176 * @param {?WebInspector.Target} target | 175 * @param {?WebInspector.Target} target |
| 177 */ | 176 */ |
| 178 _setTarget: function(target) | 177 _setTarget: function(target) |
| 179 { | 178 { |
| 180 if (!target) | 179 if (!target) |
| 181 return; | 180 return; |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 250 /** | 249 /** |
| 251 * @return {!WebInspector.SearchableView} | 250 * @return {!WebInspector.SearchableView} |
| 252 */ | 251 */ |
| 253 searchableView: function() | 252 searchableView: function() |
| 254 { | 253 { |
| 255 return this._sourcesView.searchableView(); | 254 return this._sourcesView.searchableView(); |
| 256 }, | 255 }, |
| 257 | 256 |
| 258 _consoleCommandEvaluatedInSelectedCallFrame: function(event) | 257 _consoleCommandEvaluatedInSelectedCallFrame: function(event) |
| 259 { | 258 { |
| 260 this.sidebarPanes.scopechain.update(WebInspector.debuggerModel.selectedC allFrame()); | 259 var target = /** @type {!WebInspector.Target} */ (event.target.target() ); |
| 260 if (WebInspector.context.flavor(WebInspector.Target) !== target) | |
| 261 return; | |
| 262 this.sidebarPanes.scopechain.update(target.debuggerModel.selectedCallFra me()); | |
| 261 }, | 263 }, |
| 262 | 264 |
| 263 /** | 265 /** |
| 264 * @param {!WebInspector.Event} event | 266 * @param {!WebInspector.Event} event |
| 265 */ | 267 */ |
| 266 _debuggerPaused: function(event) | 268 _debuggerPaused: function(event) |
| 267 { | 269 { |
| 268 var details = /** @type {!WebInspector.DebuggerPausedDetails} */ (event. data); | 270 var details = /** @type {!WebInspector.DebuggerPausedDetails} */ (event. data); |
| 269 if (!this._paused) | 271 if (!this._paused) |
| 270 WebInspector.inspectorView.setCurrentPanel(this); | 272 WebInspector.inspectorView.setCurrentPanel(this); |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 692 continueToLocation: function(rawLocation) | 694 continueToLocation: function(rawLocation) |
| 693 { | 695 { |
| 694 if (!this._prepareToResume()) | 696 if (!this._prepareToResume()) |
| 695 return; | 697 return; |
| 696 | 698 |
| 697 rawLocation.continueToLocation(); | 699 rawLocation.continueToLocation(); |
| 698 }, | 700 }, |
| 699 | 701 |
| 700 _toggleBreakpointsClicked: function(event) | 702 _toggleBreakpointsClicked: function(event) |
| 701 { | 703 { |
| 702 WebInspector.debuggerModel.setBreakpointsActive(!WebInspector.debuggerMo del.breakpointsActive()); | 704 WebInspector.breakpointManager.toggleBreakpointsActive(); |
|
vsevik
2014/06/26 12:46:35
Let's inline toggleBreakpointsActive.
sergeyv
2014/06/26 13:00:46
Done.
| |
| 703 }, | 705 }, |
| 704 | 706 |
| 705 _breakpointsActiveStateChanged: function(event) | 707 _breakpointsActiveStateChanged: function(event) |
| 706 { | 708 { |
| 707 var active = event.data; | 709 var active = event.data; |
| 708 this._toggleBreakpointsButton.toggled = !active; | 710 this._toggleBreakpointsButton.toggled = !active; |
| 709 this.sidebarPanes.jsBreakpoints.listElement.classList.toggle("breakpoint s-list-deactivated", !active); | 711 this.sidebarPanes.jsBreakpoints.listElement.classList.toggle("breakpoint s-list-deactivated", !active); |
| 710 this._sourcesView.toggleBreakpointsActiveState(active); | 712 this._sourcesView.toggleBreakpointsActiveState(active); |
| 711 if (active) | 713 if (active) |
| 712 this._toggleBreakpointsButton.title = WebInspector.UIString("Deactiv ate breakpoints."); | 714 this._toggleBreakpointsButton.title = WebInspector.UIString("Deactiv ate breakpoints."); |
| (...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1470 WebInspector.SourcesPanel.TogglePauseActionDelegate.prototype = { | 1472 WebInspector.SourcesPanel.TogglePauseActionDelegate.prototype = { |
| 1471 /** | 1473 /** |
| 1472 * @return {boolean} | 1474 * @return {boolean} |
| 1473 */ | 1475 */ |
| 1474 handleAction: function() | 1476 handleAction: function() |
| 1475 { | 1477 { |
| 1476 /** @type {!WebInspector.SourcesPanel} */ (WebInspector.inspectorView.sh owPanel("sources")).togglePause(); | 1478 /** @type {!WebInspector.SourcesPanel} */ (WebInspector.inspectorView.sh owPanel("sources")).togglePause(); |
| 1477 return true; | 1479 return true; |
| 1478 } | 1480 } |
| 1479 } | 1481 } |
| OLD | NEW |