| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 WebInspector.UISourceCodeFrame.call(this, uiSourceCode); | 41 WebInspector.UISourceCodeFrame.call(this, uiSourceCode); |
| 42 if (uiSourceCode.project().type() === WebInspector.projectTypes.Debugger) | 42 if (uiSourceCode.project().type() === WebInspector.projectTypes.Debugger) |
| 43 this.element.classList.add("source-frame-debugger-script"); | 43 this.element.classList.add("source-frame-debugger-script"); |
| 44 | 44 |
| 45 this._popoverHelper = new WebInspector.ObjectPopoverHelper(this._scriptsPane
l.element, | 45 this._popoverHelper = new WebInspector.ObjectPopoverHelper(this._scriptsPane
l.element, |
| 46 this._getPopoverAnchor.bind(this), this._resolveObjectForPopover.bind(th
is), this._onHidePopover.bind(this), true); | 46 this._getPopoverAnchor.bind(this), this._resolveObjectForPopover.bind(th
is), this._onHidePopover.bind(this), true); |
| 47 this._popoverHelper.setTimeout(250, 250); | 47 this._popoverHelper.setTimeout(250, 250); |
| 48 | 48 |
| 49 this.textEditor.element.addEventListener("keydown", this._onKeyDown.bind(thi
s), true); | 49 this.textEditor.element.addEventListener("keydown", this._onKeyDown.bind(thi
s), true); |
| 50 | 50 |
| 51 this.textEditor.addEventListener(WebInspector.CodeMirrorTextEditor.Events.Gu
tterClick, this._handleGutterClick.bind(this), this); | 51 this.textEditor.addEventListener(WebInspector.SourcesTextEditor.Events.Gutte
rClick, this._handleGutterClick.bind(this), this); |
| 52 | 52 |
| 53 this._breakpointManager.addEventListener(WebInspector.BreakpointManager.Even
ts.BreakpointAdded, this._breakpointAdded, this); | 53 this._breakpointManager.addEventListener(WebInspector.BreakpointManager.Even
ts.BreakpointAdded, this._breakpointAdded, this); |
| 54 this._breakpointManager.addEventListener(WebInspector.BreakpointManager.Even
ts.BreakpointRemoved, this._breakpointRemoved, this); | 54 this._breakpointManager.addEventListener(WebInspector.BreakpointManager.Even
ts.BreakpointRemoved, this._breakpointRemoved, this); |
| 55 | 55 |
| 56 this.uiSourceCode().addEventListener(WebInspector.UISourceCode.Events.Source
MappingChanged, this._onSourceMappingChanged, this); | 56 this.uiSourceCode().addEventListener(WebInspector.UISourceCode.Events.Source
MappingChanged, this._onSourceMappingChanged, this); |
| 57 this.uiSourceCode().addEventListener(WebInspector.UISourceCode.Events.Workin
gCopyChanged, this._workingCopyChanged, this); | 57 this.uiSourceCode().addEventListener(WebInspector.UISourceCode.Events.Workin
gCopyChanged, this._workingCopyChanged, this); |
| 58 this.uiSourceCode().addEventListener(WebInspector.UISourceCode.Events.Workin
gCopyCommitted, this._workingCopyCommitted, this); | 58 this.uiSourceCode().addEventListener(WebInspector.UISourceCode.Events.Workin
gCopyCommitted, this._workingCopyCommitted, this); |
| 59 this.uiSourceCode().addEventListener(WebInspector.UISourceCode.Events.TitleC
hanged, this._showBlackboxInfobarIfNeeded, this); | 59 this.uiSourceCode().addEventListener(WebInspector.UISourceCode.Events.TitleC
hanged, this._showBlackboxInfobarIfNeeded, this); |
| 60 | 60 |
| 61 /** @type {!Map.<!WebInspector.Target, !WebInspector.ResourceScriptFile>}*/ | 61 /** @type {!Map.<!WebInspector.Target, !WebInspector.ResourceScriptFile>}*/ |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 WebInspector.ConsoleModel.evaluateCommandInConsole(currentExecutionC
ontext, expression); | 242 WebInspector.ConsoleModel.evaluateCommandInConsole(currentExecutionC
ontext, expression); |
| 243 }, | 243 }, |
| 244 | 244 |
| 245 /** | 245 /** |
| 246 * @override | 246 * @override |
| 247 */ | 247 */ |
| 248 wasShown: function() | 248 wasShown: function() |
| 249 { | 249 { |
| 250 WebInspector.UISourceCodeFrame.prototype.wasShown.call(this); | 250 WebInspector.UISourceCodeFrame.prototype.wasShown.call(this); |
| 251 if (this._executionLocation && this.loaded) { | 251 if (this._executionLocation && this.loaded) { |
| 252 // We need CodeMirrorTextEditor to be initialized prior to this call
. @see crbug.com/499889 | 252 // We need SourcesTextEditor to be initialized prior to this call. @
see crbug.com/499889 |
| 253 setImmediate(this._generateValuesInSource.bind(this)); | 253 setImmediate(this._generateValuesInSource.bind(this)); |
| 254 } | 254 } |
| 255 }, | 255 }, |
| 256 | 256 |
| 257 /** | 257 /** |
| 258 * @override | 258 * @override |
| 259 */ | 259 */ |
| 260 willHide: function() | 260 willHide: function() |
| 261 { | 261 { |
| 262 WebInspector.UISourceCodeFrame.prototype.willHide.call(this); | 262 WebInspector.UISourceCodeFrame.prototype.willHide.call(this); |
| 263 this._popoverHelper.hidePopover(); | 263 this._popoverHelper.hidePopover(); |
| 264 }, | 264 }, |
| 265 | 265 |
| 266 onUISourceCodeContentChanged: function() | 266 onUISourceCodeContentChanged: function() |
| 267 { | 267 { |
| 268 this._removeAllBreakpoints(); | 268 this._removeAllBreakpoints(); |
| 269 WebInspector.UISourceCodeFrame.prototype.onUISourceCodeContentChanged.ca
ll(this); | 269 WebInspector.UISourceCodeFrame.prototype.onUISourceCodeContentChanged.ca
ll(this); |
| 270 }, | 270 }, |
| 271 | 271 |
| 272 /** |
| 273 * @override |
| 274 */ |
| 272 onTextChanged: function(oldRange, newRange) | 275 onTextChanged: function(oldRange, newRange) |
| 273 { | 276 { |
| 274 this._scriptsPanel.updateLastModificationTime(); | 277 this._scriptsPanel.updateLastModificationTime(); |
| 275 WebInspector.UISourceCodeFrame.prototype.onTextChanged.call(this, oldRan
ge, newRange); | 278 WebInspector.UISourceCodeFrame.prototype.onTextChanged.call(this, oldRan
ge, newRange); |
| 276 if (this._compiler) | 279 if (this._compiler) |
| 277 this._compiler.scheduleCompile(); | 280 this._compiler.scheduleCompile(); |
| 278 }, | 281 }, |
| 279 | 282 |
| 280 /** | 283 /** |
| 281 * @override | 284 * @override |
| (...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 701 * @param {!WebInspector.UILocation} uiLocation | 704 * @param {!WebInspector.UILocation} uiLocation |
| 702 */ | 705 */ |
| 703 setExecutionLocation: function(uiLocation) | 706 setExecutionLocation: function(uiLocation) |
| 704 { | 707 { |
| 705 this._executionLocation = uiLocation; | 708 this._executionLocation = uiLocation; |
| 706 if (!this.loaded) | 709 if (!this.loaded) |
| 707 return; | 710 return; |
| 708 | 711 |
| 709 this.textEditor.setExecutionLocation(uiLocation.lineNumber, uiLocation.c
olumnNumber); | 712 this.textEditor.setExecutionLocation(uiLocation.lineNumber, uiLocation.c
olumnNumber); |
| 710 if (this.isShowing()) { | 713 if (this.isShowing()) { |
| 711 // We need CodeMirrorTextEditor to be initialized prior to this call
. @see crbug.com/506566 | 714 // We need SourcesTextEditor to be initialized prior to this call. @
see crbug.com/506566 |
| 712 setImmediate(this._generateValuesInSource.bind(this)); | 715 setImmediate(this._generateValuesInSource.bind(this)); |
| 713 } | 716 } |
| 714 }, | 717 }, |
| 715 | 718 |
| 716 _generateValuesInSource: function() | 719 _generateValuesInSource: function() |
| 717 { | 720 { |
| 718 if (!WebInspector.moduleSetting("inlineVariableValues").get()) | 721 if (!WebInspector.moduleSetting("inlineVariableValues").get()) |
| 719 return; | 722 return; |
| 720 var executionContext = WebInspector.context.flavor(WebInspector.Executio
nContext); | 723 var executionContext = WebInspector.context.flavor(WebInspector.Executio
nContext); |
| 721 if (!executionContext) | 724 if (!executionContext) |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1051 }, | 1054 }, |
| 1052 | 1055 |
| 1053 /** | 1056 /** |
| 1054 * @param {!WebInspector.Event} event | 1057 * @param {!WebInspector.Event} event |
| 1055 */ | 1058 */ |
| 1056 _handleGutterClick: function(event) | 1059 _handleGutterClick: function(event) |
| 1057 { | 1060 { |
| 1058 if (this._muted) | 1061 if (this._muted) |
| 1059 return; | 1062 return; |
| 1060 | 1063 |
| 1061 var eventData = /** @type {!WebInspector.CodeMirrorTextEditor.GutterClic
kEventData} */ (event.data); | 1064 var eventData = /** @type {!WebInspector.SourcesTextEditor.GutterClickEv
entData} */ (event.data); |
| 1062 var lineNumber = eventData.lineNumber; | 1065 var lineNumber = eventData.lineNumber; |
| 1063 var eventObject = eventData.event; | 1066 var eventObject = eventData.event; |
| 1064 | 1067 |
| 1065 if (eventObject.button !== 0 || eventObject.altKey || eventObject.ctrlKe
y || eventObject.metaKey) | 1068 if (eventObject.button !== 0 || eventObject.altKey || eventObject.ctrlKe
y || eventObject.metaKey) |
| 1066 return; | 1069 return; |
| 1067 | 1070 |
| 1068 this._toggleBreakpoint(lineNumber, eventObject.shiftKey); | 1071 this._toggleBreakpoint(lineNumber, eventObject.shiftKey); |
| 1069 eventObject.consume(true); | 1072 eventObject.consume(true); |
| 1070 }, | 1073 }, |
| 1071 | 1074 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1130 this.uiSourceCode().removeEventListener(WebInspector.UISourceCode.Events
.WorkingCopyChanged, this._workingCopyChanged, this); | 1133 this.uiSourceCode().removeEventListener(WebInspector.UISourceCode.Events
.WorkingCopyChanged, this._workingCopyChanged, this); |
| 1131 this.uiSourceCode().removeEventListener(WebInspector.UISourceCode.Events
.WorkingCopyCommitted, this._workingCopyCommitted, this); | 1134 this.uiSourceCode().removeEventListener(WebInspector.UISourceCode.Events
.WorkingCopyCommitted, this._workingCopyCommitted, this); |
| 1132 this.uiSourceCode().removeEventListener(WebInspector.UISourceCode.Events
.TitleChanged, this._showBlackboxInfobarIfNeeded, this); | 1135 this.uiSourceCode().removeEventListener(WebInspector.UISourceCode.Events
.TitleChanged, this._showBlackboxInfobarIfNeeded, this); |
| 1133 WebInspector.moduleSetting("skipStackFramesPattern").removeChangeListene
r(this._showBlackboxInfobarIfNeeded, this); | 1136 WebInspector.moduleSetting("skipStackFramesPattern").removeChangeListene
r(this._showBlackboxInfobarIfNeeded, this); |
| 1134 WebInspector.moduleSetting("skipContentScripts").removeChangeListener(th
is._showBlackboxInfobarIfNeeded, this); | 1137 WebInspector.moduleSetting("skipContentScripts").removeChangeListener(th
is._showBlackboxInfobarIfNeeded, this); |
| 1135 WebInspector.UISourceCodeFrame.prototype.dispose.call(this); | 1138 WebInspector.UISourceCodeFrame.prototype.dispose.call(this); |
| 1136 }, | 1139 }, |
| 1137 | 1140 |
| 1138 __proto__: WebInspector.UISourceCodeFrame.prototype | 1141 __proto__: WebInspector.UISourceCodeFrame.prototype |
| 1139 } | 1142 } |
| OLD | NEW |