| OLD | NEW |
| (Empty) |
| 1 /* | |
| 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | |
| 3 * | |
| 4 * Redistribution and use in source and binary forms, with or without | |
| 5 * modification, are permitted provided that the following conditions | |
| 6 * are met: | |
| 7 * 1. Redistributions of source code must retain the above copyright | |
| 8 * notice, this list of conditions and the following disclaimer. | |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | |
| 10 * notice, this list of conditions and the following disclaimer in the | |
| 11 * documentation and/or other materials provided with the distribution. | |
| 12 * | |
| 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY | |
| 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
| 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
| 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR | |
| 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | |
| 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | |
| 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | |
| 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | |
| 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
| 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
| 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
| 24 */ | |
| 25 | |
| 26 WebInspector.BreakpointsSidebarPane = function() | |
| 27 { | |
| 28 WebInspector.SidebarPane.call(this, WebInspector.UIString("Breakpoints")); | |
| 29 | |
| 30 this.breakpoints = []; | |
| 31 | |
| 32 this.emptyElement = document.createElement("div"); | |
| 33 this.emptyElement.className = "info"; | |
| 34 this.emptyElement.textContent = WebInspector.UIString("No Breakpoints"); | |
| 35 | |
| 36 this.bodyElement.appendChild(this.emptyElement); | |
| 37 } | |
| 38 | |
| 39 WebInspector.BreakpointsSidebarPane.prototype = { | |
| 40 addBreakpoint: function(breakpoint) | |
| 41 { | |
| 42 this.breakpoints.push(breakpoint); | |
| 43 breakpoint.addEventListener("enabled", this._breakpointEnableChanged, th
is); | |
| 44 breakpoint.addEventListener("disabled", this._breakpointEnableChanged, t
his); | |
| 45 | |
| 46 // FIXME: add to the breakpoints UI. | |
| 47 | |
| 48 if (!InspectorController.debuggerEnabled() || !breakpoint.sourceID) | |
| 49 return; | |
| 50 | |
| 51 if (breakpoint.enabled) | |
| 52 InspectorController.addBreakpoint(breakpoint.sourceID, breakpoint.li
ne); | |
| 53 }, | |
| 54 | |
| 55 removeBreakpoint: function(breakpoint) | |
| 56 { | |
| 57 this.breakpoints.remove(breakpoint); | |
| 58 breakpoint.removeEventListener("enabled", null, this); | |
| 59 breakpoint.removeEventListener("disabled", null, this); | |
| 60 | |
| 61 // FIXME: remove from the breakpoints UI. | |
| 62 | |
| 63 if (!InspectorController.debuggerEnabled() || !breakpoint.sourceID) | |
| 64 return; | |
| 65 | |
| 66 InspectorController.removeBreakpoint(breakpoint.sourceID, breakpoint.lin
e); | |
| 67 }, | |
| 68 | |
| 69 _breakpointEnableChanged: function(event) | |
| 70 { | |
| 71 var breakpoint = event.target; | |
| 72 | |
| 73 // FIXME: change the breakpoint checkbox state in the UI. | |
| 74 | |
| 75 if (!InspectorController.debuggerEnabled() || !breakpoint.sourceID) | |
| 76 return; | |
| 77 | |
| 78 if (breakpoint.enabled) | |
| 79 InspectorController.addBreakpoint(breakpoint.sourceID, breakpoint.li
ne); | |
| 80 else | |
| 81 InspectorController.removeBreakpoint(breakpoint.sourceID, breakpoint
.line); | |
| 82 } | |
| 83 } | |
| 84 | |
| 85 WebInspector.BreakpointsSidebarPane.prototype.__proto__ = WebInspector.SidebarPa
ne.prototype; | |
| OLD | NEW |