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

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

Issue 1427653002: DevTools: move ui messages from SourceFrame to UISourceCodeFrame (step1) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebaselined Created 5 years, 1 month 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 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 { 408 {
409 var warningLevel = WebInspector.Console.MessageLevel.Warning; 409 var warningLevel = WebInspector.Console.MessageLevel.Warning;
410 if (!errorData) { 410 if (!errorData) {
411 if (error) 411 if (error)
412 WebInspector.console.addMessage(WebInspector.UIString("LiveE dit failed: %s", error), warningLevel); 412 WebInspector.console.addMessage(WebInspector.UIString("LiveE dit failed: %s", error), warningLevel);
413 return; 413 return;
414 } 414 }
415 var compileError = errorData.compileError; 415 var compileError = errorData.compileError;
416 if (compileError) { 416 if (compileError) {
417 var messageText = WebInspector.UIString("LiveEdit compile failed : %s", compileError.message); 417 var messageText = WebInspector.UIString("LiveEdit compile failed : %s", compileError.message);
418 var message = new WebInspector.SourceFrameMessage(messageText, W ebInspector.SourceFrameMessage.Level.Error, compileError.lineNumber - 1, compile Error.columnNumber + 1); 418 var message = new WebInspector.UISourceCode.Message(WebInspector .UISourceCode.Message.Level.Error, messageText, compileError.lineNumber - 1, com pileError.columnNumber + 1);
419 this.addMessageToSource(message); 419 this.addMessageToSource(message);
420 } else { 420 } else {
421 WebInspector.console.addMessage(WebInspector.UIString("Unknown L iveEdit error: %s; %s", JSON.stringify(errorData), error), warningLevel); 421 WebInspector.console.addMessage(WebInspector.UIString("Unknown L iveEdit error: %s; %s", JSON.stringify(errorData), error), warningLevel);
422 } 422 }
423 } 423 }
424 424
425 this._scriptsPanel.setIgnoreExecutionLineEvents(true); 425 this._scriptsPanel.setIgnoreExecutionLineEvents(true);
426 this._hasCommittedLiveEdit = true; 426 this._hasCommittedLiveEdit = true;
427 var scriptFiles = this._scriptFileForTarget.valuesArray(); 427 var scriptFiles = this._scriptFileForTarget.valuesArray();
428 for (var i = 0; i < scriptFiles.length; ++i) 428 for (var i = 0; i < scriptFiles.length; ++i)
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after
978 978
979 _consoleMessageRemoved: function(event) 979 _consoleMessageRemoved: function(event)
980 { 980 {
981 var message = /** @type {!WebInspector.PresentationConsoleMessage} */ (e vent.data); 981 var message = /** @type {!WebInspector.PresentationConsoleMessage} */ (e vent.data);
982 if (this.loaded) 982 if (this.loaded)
983 this.removeMessageFromSource(this._sourceFrameMessage(message)); 983 this.removeMessageFromSource(this._sourceFrameMessage(message));
984 }, 984 },
985 985
986 /** 986 /**
987 * @param {!WebInspector.PresentationConsoleMessage} message 987 * @param {!WebInspector.PresentationConsoleMessage} message
988 * @return {!WebInspector.SourceFrameMessage} 988 * @return {!WebInspector.UISourceCode.Message}
989 */ 989 */
990 _sourceFrameMessage: function(message) 990 _sourceFrameMessage: function(message)
991 { 991 {
992 return WebInspector.SourceFrameMessage.fromConsoleMessage(message.origin alMessage, message.lineNumber(), message.columnNumber()); 992 return WebInspector.UISourceCodeFrame.uiMessageFromConsoleMessage(messag e.originalMessage, message.lineNumber(), message.columnNumber());
993 }, 993 },
994 994
995 _consoleMessagesCleared: function(event) 995 _consoleMessagesCleared: function(event)
996 { 996 {
997 this.clearMessages(); 997 this.clearMessages();
998 }, 998 },
999 999
1000 /** 1000 /**
1001 * @param {!WebInspector.Event} event 1001 * @param {!WebInspector.Event} event
1002 */ 1002 */
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
1042 if (newScriptFile) { 1042 if (newScriptFile) {
1043 newScriptFile.addEventListener(WebInspector.ResourceScriptFile.Event s.DidMergeToVM, this._didMergeToVM, this); 1043 newScriptFile.addEventListener(WebInspector.ResourceScriptFile.Event s.DidMergeToVM, this._didMergeToVM, this);
1044 newScriptFile.addEventListener(WebInspector.ResourceScriptFile.Event s.DidDivergeFromVM, this._didDivergeFromVM, this); 1044 newScriptFile.addEventListener(WebInspector.ResourceScriptFile.Event s.DidDivergeFromVM, this._didDivergeFromVM, this);
1045 if (this.loaded) 1045 if (this.loaded)
1046 newScriptFile.checkMapping(); 1046 newScriptFile.checkMapping();
1047 } 1047 }
1048 }, 1048 },
1049 1049
1050 onTextEditorContentLoaded: function() 1050 onTextEditorContentLoaded: function()
1051 { 1051 {
1052 WebInspector.UISourceCodeFrame.prototype.onTextEditorContentLoaded.call( this);
1052 if (this._executionLocation) 1053 if (this._executionLocation)
1053 this.setExecutionLocation(this._executionLocation); 1054 this.setExecutionLocation(this._executionLocation);
1054 1055
1055 var breakpointLocations = this._breakpointManager.breakpointLocationsFor UISourceCode(this._uiSourceCode); 1056 var breakpointLocations = this._breakpointManager.breakpointLocationsFor UISourceCode(this._uiSourceCode);
1056 for (var i = 0; i < breakpointLocations.length; ++i) 1057 for (var i = 0; i < breakpointLocations.length; ++i)
1057 this._breakpointAdded({data:breakpointLocations[i]}); 1058 this._breakpointAdded({data:breakpointLocations[i]});
1058 1059
1059 var messages = WebInspector.presentationConsoleMessageHelper.consoleMess ages(this._uiSourceCode); 1060 var messages = WebInspector.presentationConsoleMessageHelper.consoleMess ages(this._uiSourceCode);
1060 for (var message of messages) 1061 for (var message of messages)
1061 this.addMessageToSource(this._sourceFrameMessage(message)); 1062 this.addMessageToSource(this._sourceFrameMessage(message));
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
1147 this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events. WorkingCopyChanged, this._workingCopyChanged, this); 1148 this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events. WorkingCopyChanged, this._workingCopyChanged, this);
1148 this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events. WorkingCopyCommitted, this._workingCopyCommitted, this); 1149 this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events. WorkingCopyCommitted, this._workingCopyCommitted, this);
1149 this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events. TitleChanged, this._showBlackboxInfobarIfNeeded, this); 1150 this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events. TitleChanged, this._showBlackboxInfobarIfNeeded, this);
1150 WebInspector.moduleSetting("skipStackFramesPattern").removeChangeListene r(this._showBlackboxInfobarIfNeeded, this); 1151 WebInspector.moduleSetting("skipStackFramesPattern").removeChangeListene r(this._showBlackboxInfobarIfNeeded, this);
1151 WebInspector.moduleSetting("skipContentScripts").removeChangeListener(th is._showBlackboxInfobarIfNeeded, this); 1152 WebInspector.moduleSetting("skipContentScripts").removeChangeListener(th is._showBlackboxInfobarIfNeeded, this);
1152 WebInspector.UISourceCodeFrame.prototype.dispose.call(this); 1153 WebInspector.UISourceCodeFrame.prototype.dispose.call(this);
1153 }, 1154 },
1154 1155
1155 __proto__: WebInspector.UISourceCodeFrame.prototype 1156 __proto__: WebInspector.UISourceCodeFrame.prototype
1156 } 1157 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698