| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 this.callFrameList.addItem(asyncCallFrameItem); | 111 this.callFrameList.addItem(asyncCallFrameItem); |
| 112 | 112 |
| 113 var allCallFramesHidden = true; | 113 var allCallFramesHidden = true; |
| 114 for (var i = 0, n = callFrames.length; i < n; ++i) { | 114 for (var i = 0, n = callFrames.length; i < n; ++i) { |
| 115 var callFrame = callFrames[i]; | 115 var callFrame = callFrames[i]; |
| 116 var callFrameItem = new WebInspector.CallStackSidebarPane.CallFrame(
callFrame, asyncCallFrameItem); | 116 var callFrameItem = new WebInspector.CallStackSidebarPane.CallFrame(
callFrame, asyncCallFrameItem); |
| 117 callFrameItem.element.addEventListener("click", this._callFrameSelec
ted.bind(this, callFrameItem), false); | 117 callFrameItem.element.addEventListener("click", this._callFrameSelec
ted.bind(this, callFrameItem), false); |
| 118 callFrameItem.element.addEventListener("contextmenu", this._callFram
eContextMenu.bind(this, callFrameItem), true); | 118 callFrameItem.element.addEventListener("contextmenu", this._callFram
eContextMenu.bind(this, callFrameItem), true); |
| 119 this.callFrames.push(callFrameItem); | 119 this.callFrames.push(callFrameItem); |
| 120 | 120 |
| 121 if (WebInspector.BlackboxSupport.isBlackboxed(callFrame.script.sourc
eURL, callFrame.script.isContentScript())) { | 121 if (WebInspector.blackboxManager.isBlackboxedRawLocation(callFrame.l
ocation())) { |
| 122 callFrameItem.setHidden(true); | 122 callFrameItem.setHidden(true); |
| 123 callFrameItem.setDimmed(true); | 123 callFrameItem.setDimmed(true); |
| 124 ++this._hiddenCallFrames; | 124 ++this._hiddenCallFrames; |
| 125 } else { | 125 } else { |
| 126 this.callFrameList.addItem(callFrameItem); | 126 this.callFrameList.addItem(callFrameItem); |
| 127 allCallFramesHidden = false; | 127 allCallFramesHidden = false; |
| 128 } | 128 } |
| 129 } | 129 } |
| 130 if (allCallFramesHidden && asyncCallFrameItem) { | 130 if (allCallFramesHidden && asyncCallFrameItem) { |
| 131 asyncCallFrameItem.setHidden(true); | 131 asyncCallFrameItem.setHidden(true); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 162 */ | 162 */ |
| 163 _callFrameContextMenu: function(callFrame, event) | 163 _callFrameContextMenu: function(callFrame, event) |
| 164 { | 164 { |
| 165 var contextMenu = new WebInspector.ContextMenu(event); | 165 var contextMenu = new WebInspector.ContextMenu(event); |
| 166 | 166 |
| 167 if (!callFrame._callFrame.isAsync()) | 167 if (!callFrame._callFrame.isAsync()) |
| 168 contextMenu.appendItem(WebInspector.UIString.capitalize("Restart ^fr
ame"), this._restartFrame.bind(this, callFrame)); | 168 contextMenu.appendItem(WebInspector.UIString.capitalize("Restart ^fr
ame"), this._restartFrame.bind(this, callFrame)); |
| 169 | 169 |
| 170 contextMenu.appendItem(WebInspector.UIString.capitalize("Copy ^stack ^tr
ace"), this._copyStackTrace.bind(this)); | 170 contextMenu.appendItem(WebInspector.UIString.capitalize("Copy ^stack ^tr
ace"), this._copyStackTrace.bind(this)); |
| 171 | 171 |
| 172 var isBlackboxed = WebInspector.blackboxManager.isBlackboxedRawLocation(
callFrame._callFrame.location()); |
| 172 var script = callFrame._callFrame.script; | 173 var script = callFrame._callFrame.script; |
| 173 this.appendBlackboxURLContextMenuItems(contextMenu, script.sourceURL, sc
ript.isContentScript()); | 174 this.appendBlackboxURLContextMenuItems(contextMenu, script.sourceURL, sc
ript.isContentScript(), isBlackboxed); |
| 174 | 175 |
| 175 contextMenu.show(); | 176 contextMenu.show(); |
| 176 }, | 177 }, |
| 177 | 178 |
| 178 /** | 179 /** |
| 179 * @param {number} index | 180 * @param {number} index |
| 180 * @param {!Event} event | 181 * @param {!Event} event |
| 181 */ | 182 */ |
| 182 _asyncCallFrameContextMenu: function(index, event) | 183 _asyncCallFrameContextMenu: function(index, event) |
| 183 { | 184 { |
| 184 for (; index < this.callFrames.length; ++index) { | 185 for (; index < this.callFrames.length; ++index) { |
| 185 var callFrame = this.callFrames[index]; | 186 var callFrame = this.callFrames[index]; |
| 186 if (!callFrame.isHidden()) { | 187 if (!callFrame.isHidden()) { |
| 187 this._callFrameContextMenu(callFrame, event); | 188 this._callFrameContextMenu(callFrame, event); |
| 188 break; | 189 break; |
| 189 } | 190 } |
| 190 } | 191 } |
| 191 }, | 192 }, |
| 192 | 193 |
| 193 /** | 194 /** |
| 194 * @param {!WebInspector.ContextMenu} contextMenu | 195 * @param {!WebInspector.ContextMenu} contextMenu |
| 195 * @param {string} url | 196 * @param {string} url |
| 196 * @param {boolean} isContentScript | 197 * @param {boolean} isContentScript |
| 198 * @param {boolean} isBlackboxed |
| 197 */ | 199 */ |
| 198 appendBlackboxURLContextMenuItems: function(contextMenu, url, isContentScrip
t) | 200 appendBlackboxURLContextMenuItems: function(contextMenu, url, isContentScrip
t, isBlackboxed) |
| 199 { | 201 { |
| 200 var blackboxed = WebInspector.BlackboxSupport.isBlackboxed(url, isConten
tScript); | 202 var canBlackBox = WebInspector.blackboxManager.canBlackboxURL(url); |
| 201 var canBlackBox = WebInspector.BlackboxSupport.canBlackboxURL(url); | 203 if (!isBlackboxed && !isContentScript && !canBlackBox) |
| 202 if (!blackboxed && !isContentScript && !canBlackBox) | |
| 203 return; | 204 return; |
| 204 | 205 |
| 205 if (blackboxed) { | 206 if (isBlackboxed) { |
| 206 contextMenu.appendItem(WebInspector.UIString.capitalize("Stop ^black
boxing"), this._handleContextMenuBlackboxURL.bind(this, url, isContentScript, fa
lse)); | 207 contextMenu.appendItem(WebInspector.UIString.capitalize("Stop ^black
boxing"), this._handleContextMenuBlackboxURL.bind(this, url, isContentScript, fa
lse)); |
| 207 } else { | 208 } else { |
| 208 if (canBlackBox) | 209 if (canBlackBox) |
| 209 contextMenu.appendItem(WebInspector.UIString.capitalize("Blackbo
x ^script"), this._handleContextMenuBlackboxURL.bind(this, url, false, true)); | 210 contextMenu.appendItem(WebInspector.UIString.capitalize("Blackbo
x ^script"), this._handleContextMenuBlackboxURL.bind(this, url, false, true)); |
| 210 if (isContentScript) | 211 if (isContentScript) |
| 211 contextMenu.appendItem(WebInspector.UIString.capitalize("Blackbo
x ^all ^content ^scripts"), this._handleContextMenuBlackboxURL.bind(this, url, t
rue, true)); | 212 contextMenu.appendItem(WebInspector.UIString.capitalize("Blackbo
x ^all ^content ^scripts"), this._handleContextMenuBlackboxURL.bind(this, url, t
rue, true)); |
| 212 } | 213 } |
| 213 }, | 214 }, |
| 214 | 215 |
| 215 /** | 216 /** |
| 216 * @param {string} url | 217 * @param {string} url |
| 217 * @param {boolean} isContentScript | 218 * @param {boolean} isContentScript |
| 218 * @param {boolean} blackbox | 219 * @param {boolean} blackbox |
| 219 */ | 220 */ |
| 220 _handleContextMenuBlackboxURL: function(url, isContentScript, blackbox) | 221 _handleContextMenuBlackboxURL: function(url, isContentScript, blackbox) |
| 221 { | 222 { |
| 222 if (blackbox) { | 223 if (blackbox) { |
| 223 if (isContentScript) | 224 if (isContentScript) |
| 224 WebInspector.moduleSetting("skipContentScripts").set(true); | 225 WebInspector.moduleSetting("skipContentScripts").set(true); |
| 225 else | 226 else |
| 226 WebInspector.BlackboxSupport.blackboxURL(url); | 227 WebInspector.blackboxManager.blackboxURL(url); |
| 227 } else { | 228 } else { |
| 228 WebInspector.BlackboxSupport.unblackbox(url, isContentScript); | 229 WebInspector.blackboxManager.unblackbox(url, isContentScript); |
| 229 } | 230 } |
| 230 }, | 231 }, |
| 231 | 232 |
| 232 _blackboxingStateChanged: function() | 233 _blackboxingStateChanged: function() |
| 233 { | 234 { |
| 234 if (!this._debuggerModel) | 235 if (!this._debuggerModel) |
| 235 return; | 236 return; |
| 236 var details = this._debuggerModel.debuggerPausedDetails(); | 237 var details = this._debuggerModel.debuggerPausedDetails(); |
| 237 if (!details) | 238 if (!details) |
| 238 return; | 239 return; |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 */ | 429 */ |
| 429 _update: function(uiLocation) | 430 _update: function(uiLocation) |
| 430 { | 431 { |
| 431 var text = uiLocation.linkText(); | 432 var text = uiLocation.linkText(); |
| 432 this.setSubtitle(text.trimMiddle(30)); | 433 this.setSubtitle(text.trimMiddle(30)); |
| 433 this.subtitleElement.title = text; | 434 this.subtitleElement.title = text; |
| 434 }, | 435 }, |
| 435 | 436 |
| 436 __proto__: WebInspector.UIList.Item.prototype | 437 __proto__: WebInspector.UIList.Item.prototype |
| 437 } | 438 } |
| OLD | NEW |