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

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

Issue 2238883004: DevTools: Split off SourcesTextEditor from CodeMirrorTextEditor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge and move decorations to CMTE Created 4 years, 4 months 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) 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
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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 delete this._blackboxInfobar; 190 delete this._blackboxInfobar;
191 }, 191 },
192 192
193 /** 193 /**
194 * @override 194 * @override
195 */ 195 */
196 wasShown: function() 196 wasShown: function()
197 { 197 {
198 WebInspector.UISourceCodeFrame.prototype.wasShown.call(this); 198 WebInspector.UISourceCodeFrame.prototype.wasShown.call(this);
199 if (this._executionLocation && this.loaded) { 199 if (this._executionLocation && this.loaded) {
200 // We need CodeMirrorTextEditor to be initialized prior to this call . @see crbug.com/499889 200 // We need SourcesTextEditor to be initialized prior to this call. @ see crbug.com/499889
201 setImmediate(this._generateValuesInSource.bind(this)); 201 setImmediate(this._generateValuesInSource.bind(this));
202 } 202 }
203 }, 203 },
204 204
205 /** 205 /**
206 * @override 206 * @override
207 */ 207 */
208 willHide: function() 208 willHide: function()
209 { 209 {
210 WebInspector.UISourceCodeFrame.prototype.willHide.call(this); 210 WebInspector.UISourceCodeFrame.prototype.willHide.call(this);
211 this._popoverHelper.hidePopover(); 211 this._popoverHelper.hidePopover();
212 }, 212 },
213 213
214 onUISourceCodeContentChanged: function() 214 onUISourceCodeContentChanged: function()
215 { 215 {
216 this._removeAllBreakpoints(); 216 this._removeAllBreakpoints();
217 WebInspector.UISourceCodeFrame.prototype.onUISourceCodeContentChanged.ca ll(this); 217 WebInspector.UISourceCodeFrame.prototype.onUISourceCodeContentChanged.ca ll(this);
218 }, 218 },
219 219
220 /**
221 * @override
222 */
220 onTextChanged: function(oldRange, newRange) 223 onTextChanged: function(oldRange, newRange)
221 { 224 {
222 this._scriptsPanel.updateLastModificationTime(); 225 this._scriptsPanel.updateLastModificationTime();
223 WebInspector.UISourceCodeFrame.prototype.onTextChanged.call(this, oldRan ge, newRange); 226 WebInspector.UISourceCodeFrame.prototype.onTextChanged.call(this, oldRan ge, newRange);
224 if (this._compiler) 227 if (this._compiler)
225 this._compiler.scheduleCompile(); 228 this._compiler.scheduleCompile();
226 }, 229 },
227 230
228 /** 231 /**
229 * @override 232 * @override
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
638 * @param {!WebInspector.UILocation} uiLocation 641 * @param {!WebInspector.UILocation} uiLocation
639 */ 642 */
640 setExecutionLocation: function(uiLocation) 643 setExecutionLocation: function(uiLocation)
641 { 644 {
642 this._executionLocation = uiLocation; 645 this._executionLocation = uiLocation;
643 if (!this.loaded) 646 if (!this.loaded)
644 return; 647 return;
645 648
646 this.textEditor.setExecutionLocation(uiLocation.lineNumber, uiLocation.c olumnNumber); 649 this.textEditor.setExecutionLocation(uiLocation.lineNumber, uiLocation.c olumnNumber);
647 if (this.isShowing()) { 650 if (this.isShowing()) {
648 // We need CodeMirrorTextEditor to be initialized prior to this call . @see crbug.com/506566 651 // We need SourcesTextEditor to be initialized prior to this call. @ see crbug.com/506566
649 setImmediate(this._generateValuesInSource.bind(this)); 652 setImmediate(this._generateValuesInSource.bind(this));
650 } 653 }
651 }, 654 },
652 655
653 _generateValuesInSource: function() 656 _generateValuesInSource: function()
654 { 657 {
655 if (!WebInspector.moduleSetting("inlineVariableValues").get()) 658 if (!WebInspector.moduleSetting("inlineVariableValues").get())
656 return; 659 return;
657 var executionContext = WebInspector.context.flavor(WebInspector.Executio nContext); 660 var executionContext = WebInspector.context.flavor(WebInspector.Executio nContext);
658 if (!executionContext) 661 if (!executionContext)
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
987 }, 990 },
988 991
989 /** 992 /**
990 * @param {!WebInspector.Event} event 993 * @param {!WebInspector.Event} event
991 */ 994 */
992 _handleGutterClick: function(event) 995 _handleGutterClick: function(event)
993 { 996 {
994 if (this._muted) 997 if (this._muted)
995 return; 998 return;
996 999
997 var eventData = /** @type {!WebInspector.CodeMirrorTextEditor.GutterClic kEventData} */ (event.data); 1000 var eventData = /** @type {!WebInspector.SourcesTextEditor.GutterClickEv entData} */ (event.data);
998 var lineNumber = eventData.lineNumber; 1001 var lineNumber = eventData.lineNumber;
999 var eventObject = eventData.event; 1002 var eventObject = eventData.event;
1000 1003
1001 if (eventObject.button !== 0 || eventObject.altKey || eventObject.ctrlKe y || eventObject.metaKey) 1004 if (eventObject.button !== 0 || eventObject.altKey || eventObject.ctrlKe y || eventObject.metaKey)
1002 return; 1005 return;
1003 1006
1004 this._toggleBreakpoint(lineNumber, eventObject.shiftKey); 1007 this._toggleBreakpoint(lineNumber, eventObject.shiftKey);
1005 eventObject.consume(true); 1008 eventObject.consume(true);
1006 }, 1009 },
1007 1010
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
1066 this.uiSourceCode().removeEventListener(WebInspector.UISourceCode.Events .WorkingCopyChanged, this._workingCopyChanged, this); 1069 this.uiSourceCode().removeEventListener(WebInspector.UISourceCode.Events .WorkingCopyChanged, this._workingCopyChanged, this);
1067 this.uiSourceCode().removeEventListener(WebInspector.UISourceCode.Events .WorkingCopyCommitted, this._workingCopyCommitted, this); 1070 this.uiSourceCode().removeEventListener(WebInspector.UISourceCode.Events .WorkingCopyCommitted, this._workingCopyCommitted, this);
1068 this.uiSourceCode().removeEventListener(WebInspector.UISourceCode.Events .TitleChanged, this._showBlackboxInfobarIfNeeded, this); 1071 this.uiSourceCode().removeEventListener(WebInspector.UISourceCode.Events .TitleChanged, this._showBlackboxInfobarIfNeeded, this);
1069 WebInspector.moduleSetting("skipStackFramesPattern").removeChangeListene r(this._showBlackboxInfobarIfNeeded, this); 1072 WebInspector.moduleSetting("skipStackFramesPattern").removeChangeListene r(this._showBlackboxInfobarIfNeeded, this);
1070 WebInspector.moduleSetting("skipContentScripts").removeChangeListener(th is._showBlackboxInfobarIfNeeded, this); 1073 WebInspector.moduleSetting("skipContentScripts").removeChangeListener(th is._showBlackboxInfobarIfNeeded, this);
1071 WebInspector.UISourceCodeFrame.prototype.dispose.call(this); 1074 WebInspector.UISourceCodeFrame.prototype.dispose.call(this);
1072 }, 1075 },
1073 1076
1074 __proto__: WebInspector.UISourceCodeFrame.prototype 1077 __proto__: WebInspector.UISourceCodeFrame.prototype
1075 } 1078 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698