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 27 matching lines...) Expand all Loading... |
38 this.listElement = document.createElement("ol"); | 38 this.listElement = document.createElement("ol"); |
39 this.listElement.className = "breakpoint-list"; | 39 this.listElement.className = "breakpoint-list"; |
40 | 40 |
41 this.emptyElement = document.createElement("div"); | 41 this.emptyElement = document.createElement("div"); |
42 this.emptyElement.className = "info"; | 42 this.emptyElement.className = "info"; |
43 this.emptyElement.textContent = WebInspector.UIString("No Breakpoints"); | 43 this.emptyElement.textContent = WebInspector.UIString("No Breakpoints"); |
44 | 44 |
45 this.bodyElement.appendChild(this.emptyElement); | 45 this.bodyElement.appendChild(this.emptyElement); |
46 | 46 |
47 this._items = new Map(); | 47 this._items = new Map(); |
| 48 |
| 49 var breakpointLocations = this._breakpointManager.allBreakpointLocations(); |
| 50 for (var i = 0; i < breakpointLocations.length; ++i) |
| 51 this._addBreakpoint(breakpointLocations[i].breakpoint, breakpointLocatio
ns[i].uiLocation); |
| 52 |
48 this._breakpointManager.addEventListener(WebInspector.BreakpointManager.Even
ts.BreakpointAdded, this._breakpointAdded, this); | 53 this._breakpointManager.addEventListener(WebInspector.BreakpointManager.Even
ts.BreakpointAdded, this._breakpointAdded, this); |
49 this._breakpointManager.addEventListener(WebInspector.BreakpointManager.Even
ts.BreakpointRemoved, this._breakpointRemoved, this); | 54 this._breakpointManager.addEventListener(WebInspector.BreakpointManager.Even
ts.BreakpointRemoved, this._breakpointRemoved, this); |
50 } | 55 } |
51 | 56 |
52 WebInspector.JavaScriptBreakpointsSidebarPane.prototype = { | 57 WebInspector.JavaScriptBreakpointsSidebarPane.prototype = { |
53 /** | 58 /** |
54 * @param {WebInspector.Event} event | 59 * @param {WebInspector.Event} event |
55 */ | 60 */ |
56 _breakpointAdded: function(event) | 61 _breakpointAdded: function(event) |
57 { | 62 { |
58 this._breakpointRemoved(event); | 63 this._breakpointRemoved(event); |
59 | 64 |
60 var breakpoint = /** @type {WebInspector.BreakpointManager.Breakpoint} *
/ event.data.breakpoint; | 65 var breakpoint = /** @type {WebInspector.BreakpointManager.Breakpoint} *
/ event.data.breakpoint; |
61 var uiLocation = /** @type {WebInspector.UILocation} */ event.data.uiLoc
ation; | 66 var uiLocation = /** @type {WebInspector.UILocation} */ event.data.uiLoc
ation; |
| 67 this._addBreakpoint(breakpoint, uiLocation); |
| 68 }, |
62 | 69 |
| 70 /** |
| 71 * @param {WebInspector.BreakpointManager.Breakpoint} breakpoint |
| 72 * @param {WebInspector.UILocation} uiLocation |
| 73 */ |
| 74 _addBreakpoint: function(breakpoint, uiLocation) |
| 75 { |
63 var element = document.createElement("li"); | 76 var element = document.createElement("li"); |
64 element.addStyleClass("cursor-pointer"); | 77 element.addStyleClass("cursor-pointer"); |
65 element.addEventListener("contextmenu", this._breakpointContextMenu.bind
(this, breakpoint), true); | 78 element.addEventListener("contextmenu", this._breakpointContextMenu.bind
(this, breakpoint), true); |
66 element.addEventListener("click", this._breakpointClicked.bind(this, uiL
ocation), false); | 79 element.addEventListener("click", this._breakpointClicked.bind(this, uiL
ocation), false); |
67 | 80 |
68 var checkbox = document.createElement("input"); | 81 var checkbox = document.createElement("input"); |
69 checkbox.className = "checkbox-elem"; | 82 checkbox.className = "checkbox-elem"; |
70 checkbox.type = "checkbox"; | 83 checkbox.type = "checkbox"; |
71 checkbox.checked = breakpoint.enabled(); | 84 checkbox.checked = breakpoint.enabled(); |
72 checkbox.addEventListener("click", this._breakpointCheckboxClicked.bind(
this, breakpoint), false); | 85 checkbox.addEventListener("click", this._breakpointCheckboxClicked.bind(
this, breakpoint), false); |
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
619 var breakpoints = WebInspector.settings.eventListenerBreakpoints.get(); | 632 var breakpoints = WebInspector.settings.eventListenerBreakpoints.get(); |
620 for (var i = 0; i < breakpoints.length; ++i) { | 633 for (var i = 0; i < breakpoints.length; ++i) { |
621 var breakpoint = breakpoints[i]; | 634 var breakpoint = breakpoints[i]; |
622 if (breakpoint && typeof breakpoint.eventName === "string") | 635 if (breakpoint && typeof breakpoint.eventName === "string") |
623 this._setBreakpoint(breakpoint.eventName); | 636 this._setBreakpoint(breakpoint.eventName); |
624 } | 637 } |
625 } | 638 } |
626 } | 639 } |
627 | 640 |
628 WebInspector.EventListenerBreakpointsSidebarPane.prototype.__proto__ = WebInspec
tor.SidebarPane.prototype; | 641 WebInspector.EventListenerBreakpointsSidebarPane.prototype.__proto__ = WebInspec
tor.SidebarPane.prototype; |
OLD | NEW |