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

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

Issue 548323002: DevTools: Blackbox content scripts - frontend. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: added a test Created 6 years, 3 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 | Annotate | Revision Log
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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 this._scriptFileForTarget = new Map(); 66 this._scriptFileForTarget = new Map();
67 this._registerShortcuts(); 67 this._registerShortcuts();
68 var targets = WebInspector.targetManager.targets(); 68 var targets = WebInspector.targetManager.targets();
69 for (var i = 0; i < targets.length; ++i) { 69 for (var i = 0; i < targets.length; ++i) {
70 var scriptFile = WebInspector.debuggerWorkspaceBinding.scriptFile(uiSour ceCode, targets[i]); 70 var scriptFile = WebInspector.debuggerWorkspaceBinding.scriptFile(uiSour ceCode, targets[i]);
71 if (scriptFile) 71 if (scriptFile)
72 this._updateScriptFile(targets[i]); 72 this._updateScriptFile(targets[i]);
73 } 73 }
74 74
75 WebInspector.settings.skipStackFramesPattern.addChangeListener(this._showBla ckboxInfobarIfNeeded, this); 75 WebInspector.settings.skipStackFramesPattern.addChangeListener(this._showBla ckboxInfobarIfNeeded, this);
76 WebInspector.settings.skipContentScripts.addChangeListener(this._showBlackbo xInfobarIfNeeded, this);
76 this._showBlackboxInfobarIfNeeded(); 77 this._showBlackboxInfobarIfNeeded();
77 } 78 }
78 79
79 WebInspector.JavaScriptSourceFrame.prototype = { 80 WebInspector.JavaScriptSourceFrame.prototype = {
80 _updateInfobars: function() 81 _updateInfobars: function()
81 { 82 {
82 this.attachInfobars([this._blackboxInfobar, this._divergedInfobar]); 83 this.attachInfobars([this._blackboxInfobar, this._divergedInfobar]);
83 }, 84 },
84 85
85 _showDivergedInfobar: function() 86 _showDivergedInfobar: function()
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 return; 120 return;
120 this._divergedInfobar.dispose(); 121 this._divergedInfobar.dispose();
121 delete this._divergedInfobar; 122 delete this._divergedInfobar;
122 }, 123 },
123 124
124 _showBlackboxInfobarIfNeeded: function() 125 _showBlackboxInfobarIfNeeded: function()
125 { 126 {
126 if (this._uiSourceCode.contentType() !== WebInspector.resourceTypes.Scri pt) 127 if (this._uiSourceCode.contentType() !== WebInspector.resourceTypes.Scri pt)
127 return; 128 return;
128 var url = this._uiSourceCode.url; 129 var url = this._uiSourceCode.url;
129 if (!WebInspector.BlackboxSupport.isBlackboxedURL(url)) { 130 var isContentScript = this._uiSourceCode.project().type() === WebInspect or.projectTypes.ContentScripts;
131 if (!WebInspector.BlackboxSupport.isBlackboxed(url, isContentScript)) {
130 this._hideBlackboxInfobar(); 132 this._hideBlackboxInfobar();
131 return; 133 return;
132 } 134 }
133 135
134 if (this._blackboxInfobar) 136 if (this._blackboxInfobar)
135 this._blackboxInfobar.dispose(); 137 this._blackboxInfobar.dispose();
136 138
137 var infobar = new WebInspector.UISourceCodeFrame.Infobar(WebInspector.UI String("This script is blackboxed in debugger")); 139 var infobar = new WebInspector.UISourceCodeFrame.Infobar(WebInspector.UI String("This script is blackboxed in debugger"));
138 this._blackboxInfobar = infobar; 140 this._blackboxInfobar = infobar;
139 141
140 infobar.createDetailsRowMessage(WebInspector.UIString("Debugger will ski p stepping through this script, and will not stop on exceptions")); 142 infobar.createDetailsRowMessage(WebInspector.UIString("Debugger will ski p stepping through this script, and will not stop on exceptions"));
141 infobar.createDetailsRowMessage(); 143 infobar.createDetailsRowMessage();
142 infobar.createDetailsRowMessage(WebInspector.UIString("Possible ways to cancel this behavior are:")); 144 infobar.createDetailsRowMessage(WebInspector.UIString("Possible ways to cancel this behavior are:"));
143 145
144 infobar.createDetailsRowMessage(" - ").createTextChild(WebInspector.UISt ring("Press \"%s\" button in settings", WebInspector.manageBlackboxingButtonLabe l())); 146 infobar.createDetailsRowMessage(" - ").createTextChild(WebInspector.UISt ring("Press \"%s\" button in settings", WebInspector.manageBlackboxingButtonLabe l()));
145 var unblackboxLink = infobar.createDetailsRowMessage(" - ").createChild( "span", "source-frame-infobar-link"); 147 var unblackboxLink = infobar.createDetailsRowMessage(" - ").createChild( "span", "source-frame-infobar-link");
146 unblackboxLink.textContent = WebInspector.UIString("Unblackbox this scri pt"); 148 unblackboxLink.textContent = WebInspector.UIString("Unblackbox this scri pt");
147 unblackboxLink.addEventListener("click", unblackbox, false); 149 unblackboxLink.addEventListener("click", unblackbox, false);
148 150
149 function unblackbox() 151 function unblackbox()
150 { 152 {
151 WebInspector.BlackboxSupport.unblackboxURL(url); 153 WebInspector.BlackboxSupport.unblackbox(url, isContentScript);
152 } 154 }
153 155
154 this._updateInfobars(); 156 this._updateInfobars();
155 }, 157 },
156 158
157 _hideBlackboxInfobar: function() 159 _hideBlackboxInfobar: function()
158 { 160 {
159 if (!this._blackboxInfobar) 161 if (!this._blackboxInfobar)
160 return; 162 return;
161 this._blackboxInfobar.dispose(); 163 this._blackboxInfobar.dispose();
(...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after
905 this._breakpointManager.removeEventListener(WebInspector.BreakpointManag er.Events.BreakpointAdded, this._breakpointAdded, this); 907 this._breakpointManager.removeEventListener(WebInspector.BreakpointManag er.Events.BreakpointAdded, this._breakpointAdded, this);
906 this._breakpointManager.removeEventListener(WebInspector.BreakpointManag er.Events.BreakpointRemoved, this._breakpointRemoved, this); 908 this._breakpointManager.removeEventListener(WebInspector.BreakpointManag er.Events.BreakpointRemoved, this._breakpointRemoved, this);
907 WebInspector.presentationConsoleMessageHelper.removeConsoleMessageEventL istener(WebInspector.PresentationConsoleMessageHelper.Events.ConsoleMessageAdded , this._uiSourceCode, this._consoleMessageAdded, this); 909 WebInspector.presentationConsoleMessageHelper.removeConsoleMessageEventL istener(WebInspector.PresentationConsoleMessageHelper.Events.ConsoleMessageAdded , this._uiSourceCode, this._consoleMessageAdded, this);
908 WebInspector.presentationConsoleMessageHelper.removeConsoleMessageEventL istener(WebInspector.PresentationConsoleMessageHelper.Events.ConsoleMessageRemov ed, this._uiSourceCode, this._consoleMessageRemoved, this); 910 WebInspector.presentationConsoleMessageHelper.removeConsoleMessageEventL istener(WebInspector.PresentationConsoleMessageHelper.Events.ConsoleMessageRemov ed, this._uiSourceCode, this._consoleMessageRemoved, this);
909 WebInspector.presentationConsoleMessageHelper.removeConsoleMessageEventL istener(WebInspector.PresentationConsoleMessageHelper.Events.ConsoleMessagesClea red, this._uiSourceCode, this._consoleMessagesCleared, this); 911 WebInspector.presentationConsoleMessageHelper.removeConsoleMessageEventL istener(WebInspector.PresentationConsoleMessageHelper.Events.ConsoleMessagesClea red, this._uiSourceCode, this._consoleMessagesCleared, this);
910 this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events. SourceMappingChanged, this._onSourceMappingChanged, this); 912 this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events. SourceMappingChanged, this._onSourceMappingChanged, this);
911 this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events. WorkingCopyChanged, this._workingCopyChanged, this); 913 this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events. WorkingCopyChanged, this._workingCopyChanged, this);
912 this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events. WorkingCopyCommitted, this._workingCopyCommitted, this); 914 this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events. WorkingCopyCommitted, this._workingCopyCommitted, this);
913 this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events. TitleChanged, this._showBlackboxInfobarIfNeeded, this); 915 this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events. TitleChanged, this._showBlackboxInfobarIfNeeded, this);
914 WebInspector.settings.skipStackFramesPattern.removeChangeListener(this._ showBlackboxInfobarIfNeeded, this); 916 WebInspector.settings.skipStackFramesPattern.removeChangeListener(this._ showBlackboxInfobarIfNeeded, this);
917 WebInspector.settings.skipContentScripts.removeChangeListener(this._show BlackboxInfobarIfNeeded, this);
915 WebInspector.UISourceCodeFrame.prototype.dispose.call(this); 918 WebInspector.UISourceCodeFrame.prototype.dispose.call(this);
916 }, 919 },
917 920
918 __proto__: WebInspector.UISourceCodeFrame.prototype 921 __proto__: WebInspector.UISourceCodeFrame.prototype
919 } 922 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/sources/CallStackSidebarPane.js ('k') | Source/devtools/front_end/sources/SourcesPanel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698