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

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

Issue 2851483003: DevTools: only show one source map infobar at a time (Closed)
Patch Set: DevTools: only show one source map infobar at a time Created 3 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1187 matching lines...) Expand 10 before | Expand all | Expand 10 after
1198 var oldScriptFile = this._scriptFileForDebuggerModel.get(debuggerModel); 1198 var oldScriptFile = this._scriptFileForDebuggerModel.get(debuggerModel);
1199 var newScriptFile = Bindings.debuggerWorkspaceBinding.scriptFile(this._debug gerSourceCode, debuggerModel); 1199 var newScriptFile = Bindings.debuggerWorkspaceBinding.scriptFile(this._debug gerSourceCode, debuggerModel);
1200 this._scriptFileForDebuggerModel.delete(debuggerModel); 1200 this._scriptFileForDebuggerModel.delete(debuggerModel);
1201 if (oldScriptFile) { 1201 if (oldScriptFile) {
1202 oldScriptFile.removeEventListener(Bindings.ResourceScriptFile.Events.DidMe rgeToVM, this._didMergeToVM, this); 1202 oldScriptFile.removeEventListener(Bindings.ResourceScriptFile.Events.DidMe rgeToVM, this._didMergeToVM, this);
1203 oldScriptFile.removeEventListener( 1203 oldScriptFile.removeEventListener(
1204 Bindings.ResourceScriptFile.Events.DidDivergeFromVM, this._didDivergeF romVM, this); 1204 Bindings.ResourceScriptFile.Events.DidDivergeFromVM, this._didDivergeF romVM, this);
1205 if (this._muted && !this.uiSourceCode().isDirty()) 1205 if (this._muted && !this.uiSourceCode().isDirty())
1206 this._restoreBreakpointsIfConsistentScripts(); 1206 this._restoreBreakpointsIfConsistentScripts();
1207 } 1207 }
1208 if (newScriptFile) 1208 if (!newScriptFile)
1209 this._scriptFileForDebuggerModel.set(debuggerModel, newScriptFile); 1209 return;
1210 this._scriptFileForDebuggerModel.set(debuggerModel, newScriptFile);
1211 newScriptFile.addEventListener(Bindings.ResourceScriptFile.Events.DidMergeTo VM, this._didMergeToVM, this);
1212 newScriptFile.addEventListener(Bindings.ResourceScriptFile.Events.DidDiverge FromVM, this._didDivergeFromVM, this);
1213 if (this.loaded)
1214 newScriptFile.checkMapping();
1215 this._showSourceMapInfobar(newScriptFile.hasSourceMapURL());
1216 }
1210 1217
1211 if (newScriptFile) { 1218 /**
1212 newScriptFile.addEventListener(Bindings.ResourceScriptFile.Events.DidMerge ToVM, this._didMergeToVM, this); 1219 * @param {boolean} show
1213 newScriptFile.addEventListener(Bindings.ResourceScriptFile.Events.DidDiver geFromVM, this._didDivergeFromVM, this); 1220 */
1214 if (this.loaded) 1221 _showSourceMapInfobar(show) {
1215 newScriptFile.checkMapping(); 1222 if (this._sourceMapInfobar) {
1216 if (newScriptFile.hasSourceMapURL()) { 1223 if (!show) {
1217 var sourceMapInfobar = UI.Infobar.create( 1224 this._sourceMapInfobar.dispose();
1218 UI.Infobar.Type.Info, Common.UIString('Source Map detected.'), 1225 delete this._sourceMapInfobar;
1219 Common.settings.createSetting('sourceMapInfobarDisabled', false));
1220 if (sourceMapInfobar) {
1221 sourceMapInfobar.createDetailsRowMessage(Common.UIString(
1222 'Associated files should be added to the file tree. You can debug these resolved source files as regular JavaScript files.'));
1223 sourceMapInfobar.createDetailsRowMessage(Common.UIString(
1224 'Associated files are available via file tree or %s.',
1225 UI.shortcutRegistry.shortcutTitleForAction('quickOpen.show')));
1226 this.attachInfobars([sourceMapInfobar]);
1227 }
1228 } 1226 }
1227 return;
1228 }
1229 this._sourceMapInfobar = UI.Infobar.create(
1230 UI.Infobar.Type.Info, Common.UIString('Source Map detected.'),
1231 Common.settings.createSetting('sourceMapInfobarDisabled', false));
1232 if (this._sourceMapInfobar) {
1233 this._sourceMapInfobar.createDetailsRowMessage(Common.UIString(
1234 'Associated files should be added to the file tree. You can debug thes e resolved source files as regular JavaScript files.'));
1235 this._sourceMapInfobar.createDetailsRowMessage(Common.UIString(
1236 'Associated files are available via file tree or %s.',
1237 UI.shortcutRegistry.shortcutTitleForAction('quickOpen.show')));
1238 this._sourceMapInfobar.setCloseCallback(() => delete this._sourceMapInfoba r);
1239 this.attachInfobars([this._sourceMapInfobar]);
1229 } 1240 }
1230 } 1241 }
1231 1242
1232 /** 1243 /**
1233 * @override 1244 * @override
1234 */ 1245 */
1235 onTextEditorContentSet() { 1246 onTextEditorContentSet() {
1236 super.onTextEditorContentSet(); 1247 super.onTextEditorContentSet();
1237 if (this._executionLocation) 1248 if (this._executionLocation)
1238 this.setExecutionLocation(this._executionLocation); 1249 this.setExecutionLocation(this._executionLocation);
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
1488 return; 1499 return;
1489 this.bookmark.clear(); 1500 this.bookmark.clear();
1490 this.bookmark = null; 1501 this.bookmark = null;
1491 } 1502 }
1492 }; 1503 };
1493 1504
1494 Sources.JavaScriptSourceFrame.BreakpointDecoration.bookmarkSymbol = Symbol('book mark'); 1505 Sources.JavaScriptSourceFrame.BreakpointDecoration.bookmarkSymbol = Symbol('book mark');
1495 Sources.JavaScriptSourceFrame.BreakpointDecoration._elementSymbolForTest = Symbo l('element'); 1506 Sources.JavaScriptSourceFrame.BreakpointDecoration._elementSymbolForTest = Symbo l('element');
1496 1507
1497 Sources.JavaScriptSourceFrame.continueToLocationDecorationSymbol = Symbol('bookm ark'); 1508 Sources.JavaScriptSourceFrame.continueToLocationDecorationSymbol = Symbol('bookm ark');
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698