| 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 12 matching lines...) Expand all Loading... |
| 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 /** | 26 /** |
| 27 * @constructor | 27 * @constructor |
| 28 * @extends {WebInspector.SidebarPane} | 28 * @extends {WebInspector.SidebarPane} |
| 29 */ | 29 */ |
| 30 WebInspector.CallStackSidebarPane = function() | 30 WebInspector.CallStackSidebarPane = function() |
| 31 { | 31 { |
| 32 WebInspector.SidebarPane.call(this, WebInspector.UIString("Call Stack")); | 32 WebInspector.SidebarPane.call(this, WebInspector.UIString("Call Stack")); |
| 33 this.bodyElement.addEventListener("keydown", this._keyDown.bind(this), true)
; | 33 this.element.addEventListener("keydown", this._keyDown.bind(this), true); |
| 34 this.bodyElement.tabIndex = 0; | 34 this.element.tabIndex = 0; |
| 35 this.callFrameList = new WebInspector.UIList(); | 35 this.callFrameList = new WebInspector.UIList(); |
| 36 this.callFrameList.show(this.bodyElement); | 36 this.callFrameList.show(this.element); |
| 37 | 37 |
| 38 var asyncCheckbox = this.titleElement.appendChild(WebInspector.SettingsUI.cr
eateSettingCheckbox(WebInspector.UIString("Async"), WebInspector.moduleSetting("
enableAsyncStackTraces"), true, WebInspector.UIString("Capture async stack trace
s"))); | |
| 39 asyncCheckbox.classList.add("scripts-callstack-async"); | |
| 40 asyncCheckbox.addEventListener("click", consumeEvent, false); | |
| 41 WebInspector.moduleSetting("enableAsyncStackTraces").addChangeListener(this.
_asyncStackTracesStateChanged, this); | 38 WebInspector.moduleSetting("enableAsyncStackTraces").addChangeListener(this.
_asyncStackTracesStateChanged, this); |
| 42 WebInspector.moduleSetting("skipStackFramesPattern").addChangeListener(this.
_blackboxingStateChanged, this); | 39 WebInspector.moduleSetting("skipStackFramesPattern").addChangeListener(this.
_blackboxingStateChanged, this); |
| 43 } | 40 } |
| 44 | 41 |
| 45 /** @enum {string} */ | 42 /** @enum {string} */ |
| 46 WebInspector.CallStackSidebarPane.Events = { | 43 WebInspector.CallStackSidebarPane.Events = { |
| 47 CallFrameSelected: "CallFrameSelected", | 44 CallFrameSelected: "CallFrameSelected", |
| 48 RevealHiddenCallFrames: "RevealHiddenCallFrames" | 45 RevealHiddenCallFrames: "RevealHiddenCallFrames" |
| 49 } | 46 } |
| 50 | 47 |
| 51 WebInspector.CallStackSidebarPane.prototype = { | 48 WebInspector.CallStackSidebarPane.prototype = { |
| 52 /** | 49 /** |
| 53 * @param {?WebInspector.DebuggerPausedDetails} details | 50 * @param {?WebInspector.DebuggerPausedDetails} details |
| 54 */ | 51 */ |
| 55 update: function(details) | 52 update: function(details) |
| 56 { | 53 { |
| 57 this.callFrameList.detach(); | 54 this.callFrameList.detach(); |
| 58 this.callFrameList.clear(); | 55 this.callFrameList.clear(); |
| 59 this.bodyElement.removeChildren(); | 56 this.element.removeChildren(); |
| 60 | 57 |
| 61 if (!details) { | 58 if (!details) { |
| 62 var infoElement = this.bodyElement.createChild("div", "callstack-inf
o"); | 59 var infoElement = this.element.createChild("div", "callstack-info"); |
| 63 infoElement.textContent = WebInspector.UIString("Not Paused"); | 60 infoElement.textContent = WebInspector.UIString("Not Paused"); |
| 64 return; | 61 return; |
| 65 } | 62 } |
| 66 | 63 |
| 67 this.callFrameList.show(this.bodyElement); | 64 this.callFrameList.show(this.element); |
| 68 this._debuggerModel = details.debuggerModel; | 65 this._debuggerModel = details.debuggerModel; |
| 69 var callFrames = details.callFrames; | 66 var callFrames = details.callFrames; |
| 70 var asyncStackTrace = details.asyncStackTrace; | 67 var asyncStackTrace = details.asyncStackTrace; |
| 71 | 68 |
| 72 delete this._statusMessageElement; | 69 delete this._statusMessageElement; |
| 73 delete this._hiddenCallFramesMessageElement; | 70 delete this._hiddenCallFramesMessageElement; |
| 74 /** @type {!Array.<!WebInspector.CallStackSidebarPane.CallFrame>} */ | 71 /** @type {!Array.<!WebInspector.CallStackSidebarPane.CallFrame>} */ |
| 75 this.callFrames = []; | 72 this.callFrames = []; |
| 76 this._hiddenCallFrames = 0; | 73 this._hiddenCallFrames = 0; |
| 77 | 74 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 92 if (this._hiddenCallFrames) { | 89 if (this._hiddenCallFrames) { |
| 93 var element = createElementWithClass("div", "hidden-callframes-messa
ge"); | 90 var element = createElementWithClass("div", "hidden-callframes-messa
ge"); |
| 94 if (this._hiddenCallFrames === 1) | 91 if (this._hiddenCallFrames === 1) |
| 95 element.textContent = WebInspector.UIString("1 stack frame is hi
dden (black-boxed)."); | 92 element.textContent = WebInspector.UIString("1 stack frame is hi
dden (black-boxed)."); |
| 96 else | 93 else |
| 97 element.textContent = WebInspector.UIString("%d stack frames are
hidden (black-boxed).", this._hiddenCallFrames); | 94 element.textContent = WebInspector.UIString("%d stack frames are
hidden (black-boxed).", this._hiddenCallFrames); |
| 98 element.createTextChild(" "); | 95 element.createTextChild(" "); |
| 99 var showAllLink = element.createChild("span", "link"); | 96 var showAllLink = element.createChild("span", "link"); |
| 100 showAllLink.textContent = WebInspector.UIString("Show"); | 97 showAllLink.textContent = WebInspector.UIString("Show"); |
| 101 showAllLink.addEventListener("click", this._revealHiddenCallFrames.b
ind(this), false); | 98 showAllLink.addEventListener("click", this._revealHiddenCallFrames.b
ind(this), false); |
| 102 this.bodyElement.insertBefore(element, this.bodyElement.firstChild); | 99 this.element.insertBefore(element, this.element.firstChild); |
| 103 this._hiddenCallFramesMessageElement = element; | 100 this._hiddenCallFramesMessageElement = element; |
| 104 } | 101 } |
| 105 }, | 102 }, |
| 106 | 103 |
| 107 /** | 104 /** |
| 108 * @param {!Array.<!WebInspector.DebuggerModel.CallFrame>} callFrames | 105 * @param {!Array.<!WebInspector.DebuggerModel.CallFrame>} callFrames |
| 109 * @param {!WebInspector.UIList.Item=} asyncCallFrameItem | 106 * @param {!WebInspector.UIList.Item=} asyncCallFrameItem |
| 110 */ | 107 */ |
| 111 _appendSidebarCallFrames: function(callFrames, asyncCallFrameItem) | 108 _appendSidebarCallFrames: function(callFrames, asyncCallFrameItem) |
| 112 { | 109 { |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 registerShortcutDelegate(WebInspector.ShortcutsScreen.SourcesPanelShortc
uts.NextCallFrame, this._selectNextCallFrameOnStack.bind(this)); | 381 registerShortcutDelegate(WebInspector.ShortcutsScreen.SourcesPanelShortc
uts.NextCallFrame, this._selectNextCallFrameOnStack.bind(this)); |
| 385 registerShortcutDelegate(WebInspector.ShortcutsScreen.SourcesPanelShortc
uts.PrevCallFrame, this._selectPreviousCallFrameOnStack.bind(this)); | 382 registerShortcutDelegate(WebInspector.ShortcutsScreen.SourcesPanelShortc
uts.PrevCallFrame, this._selectPreviousCallFrameOnStack.bind(this)); |
| 386 }, | 383 }, |
| 387 | 384 |
| 388 /** | 385 /** |
| 389 * @param {!Element|string} status | 386 * @param {!Element|string} status |
| 390 */ | 387 */ |
| 391 setStatus: function(status) | 388 setStatus: function(status) |
| 392 { | 389 { |
| 393 if (!this._statusMessageElement) | 390 if (!this._statusMessageElement) |
| 394 this._statusMessageElement = this.bodyElement.createChild("div", "ca
llstack-info status"); | 391 this._statusMessageElement = this.element.createChild("div", "callst
ack-info status"); |
| 395 if (typeof status === "string") { | 392 if (typeof status === "string") { |
| 396 this._statusMessageElement.textContent = status; | 393 this._statusMessageElement.textContent = status; |
| 397 } else { | 394 } else { |
| 398 this._statusMessageElement.removeChildren(); | 395 this._statusMessageElement.removeChildren(); |
| 399 this._statusMessageElement.appendChild(status); | 396 this._statusMessageElement.appendChild(status); |
| 400 } | 397 } |
| 401 }, | 398 }, |
| 402 | 399 |
| 403 _keyDown: function(event) | 400 _keyDown: function(event) |
| 404 { | 401 { |
| (...skipping 26 matching lines...) Expand all Loading... |
| 431 */ | 428 */ |
| 432 _update: function(uiLocation) | 429 _update: function(uiLocation) |
| 433 { | 430 { |
| 434 var text = uiLocation.linkText(); | 431 var text = uiLocation.linkText(); |
| 435 this.setSubtitle(text.trimMiddle(30)); | 432 this.setSubtitle(text.trimMiddle(30)); |
| 436 this.subtitleElement.title = text; | 433 this.subtitleElement.title = text; |
| 437 }, | 434 }, |
| 438 | 435 |
| 439 __proto__: WebInspector.UIList.Item.prototype | 436 __proto__: WebInspector.UIList.Item.prototype |
| 440 } | 437 } |
| OLD | NEW |