2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
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.
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.
28 * @param {WebInspector.BreakpointManager} breakpointManager
29 * @extends {WebInspector.SidebarPane}
31 WebInspector.JavaScriptBreakpointsSidebarPane = function(breakpointManager, showSourceLineDelegate)
33 WebInspector.SidebarPane.call(this, WebInspector.UIString("Breakpoints"));
34 this.registerRequiredCSS("breakpointsList.css");
36 this._breakpointManager = breakpointManager;
37 this._showSourceLineDelegate = showSourceLineDelegate;
39 this.listElement = document.createElement("ol");
40 this.listElement.className = "breakpoint-list";
42 this.emptyElement = document.createElement("div");
43 this.emptyElement.className = "info";
44 this.emptyElement.textContent = WebInspector.UIString("No Breakpoints");
46 this.bodyElement.appendChild(this.emptyElement);
48 this._items = new Map();
50 var breakpointLocations = this._breakpointManager.allBreakpointLocations();
51 for (var i = 0; i < breakpointLocations.length; ++i)
52 this._addBreakpoint(breakpointLocations[i].breakpoint, breakpointLocations[i].uiLocation);
54 this._breakpointManager.addEventListener(WebInspector.BreakpointManager.Events.BreakpointAdded, this._breakpointAdded, this);
55 this._breakpointManager.addEventListener(WebInspector.BreakpointManager.Events.BreakpointRemoved, this._breakpointRemoved, this);
57 this.emptyElement.addEventListener("contextmenu", this._emptyElementContextMenu.bind(this), true);
60 WebInspector.JavaScriptBreakpointsSidebarPane.prototype = {
61 _emptyElementContextMenu: function(event)
63 var contextMenu = new WebInspector.ContextMenu(event);
64 var breakpointActive = WebInspector.debuggerModel.breakpointsActive();
65 var breakpointActiveTitle = WebInspector.UIString(breakpointActive ? "Deactivate Breakpoints" : "Activate Breakpoints");
66 contextMenu.appendItem(breakpointActiveTitle, WebInspector.debuggerModel.setBreakpointsActive.bind(WebInspector.debuggerModel, !breakpointActive));
71 * @param {WebInspector.Event} event
73 _breakpointAdded: function(event)
75 this._breakpointRemoved(event);
77 var breakpoint = /** @type {WebInspector.BreakpointManager.Breakpoint} */ (event.data.breakpoint);
78 var uiLocation = /** @type {WebInspector.UILocation} */ (event.data.uiLocation);
79 this._addBreakpoint(breakpoint, uiLocation);
83 * @param {WebInspector.BreakpointManager.Breakpoint} breakpoint
84 * @param {WebInspector.UILocation} uiLocation
86 _addBreakpoint: function(breakpoint, uiLocation)
88 var element = document.createElement("li");
89 element.addStyleClass("cursor-pointer");
90 element.addEventListener("contextmenu", this._breakpointContextMenu.bind(this, breakpoint), true);
91 element.addEventListener("click", this._breakpointClicked.bind(this, uiLocation), false);
93 var checkbox = document.createElement("input");
94 checkbox.className = "checkbox-elem";
95 checkbox.type = "checkbox";
96 checkbox.checked = breakpoint.enabled();
97 checkbox.addEventListener("click", this._breakpointCheckboxClicked.bind(this, breakpoint), false);
98 element.appendChild(checkbox);
100 var labelElement = document.createTextNode(WebInspector.formatLinkText(uiLocation.uiSourceCode.originURL(), uiLocation.lineNumber));
101 element.appendChild(labelElement);
103 var snippetElement = document.createElement("div");
104 snippetElement.className = "source-text monospace";
105 element.appendChild(snippetElement);
108 * @param {?string} content
109 * @param {boolean} contentEncoded
110 * @param {string} mimeType
112 function didRequestContent(content, contentEncoded, mimeType)
114 var lineEndings = content.lineEndings();
115 if (uiLocation.lineNumber < lineEndings.length)
116 snippetElement.textContent = content.substring(lineEndings[uiLocation.lineNumber - 1], lineEndings[uiLocation.lineNumber]);
118 uiLocation.uiSourceCode.requestContent(didRequestContent.bind(this));
120 element._data = uiLocation;
121 var currentElement = this.listElement.firstChild;
122 while (currentElement) {
123 if (currentElement._data && this._compareBreakpoints(currentElement._data, element._data) > 0)
125 currentElement = currentElement.nextSibling;
127 this._addListElement(element, currentElement);
129 var breakpointItem = {};
130 breakpointItem.element = element;
131 breakpointItem.checkbox = checkbox;
132 this._items.put(breakpoint, breakpointItem);
138 * @param {WebInspector.Event} event
140 _breakpointRemoved: function(event)
142 var breakpoint = /** @type {WebInspector.BreakpointManager.Breakpoint} */ (event.data.breakpoint);
143 var uiLocation = /** @type {WebInspector.UILocation} */ (event.data.uiLocation);
144 var breakpointItem = this._items.get(breakpoint);
147 this._items.remove(breakpoint);
148 this._removeListElement(breakpointItem.element);
152 * @param {WebInspector.BreakpointManager.Breakpoint} breakpoint
154 highlightBreakpoint: function(breakpoint)
156 var breakpointItem = this._items.get(breakpoint);
159 breakpointItem.element.addStyleClass("breakpoint-hit");
160 this._highlightedBreakpointItem = breakpointItem;
163 clearBreakpointHighlight: function()
165 if (this._highlightedBreakpointItem) {
166 this._highlightedBreakpointItem.element.removeStyleClass("breakpoint-hit");
167 delete this._highlightedBreakpointItem;
171 _breakpointClicked: function(uiLocation, event)
173 this._showSourceLineDelegate(uiLocation.uiSourceCode, uiLocation.lineNumber);
177 * @param {WebInspector.BreakpointManager.Breakpoint} breakpoint
179 _breakpointCheckboxClicked: function(breakpoint, event)
181 // Breakpoint element has it's own click handler.
183 breakpoint.setEnabled(event.target.checked);
187 * @param {WebInspector.BreakpointManager.Breakpoint} breakpoint
189 _breakpointContextMenu: function(breakpoint, event)
191 var breakpoints = this._items.values();
192 var contextMenu = new WebInspector.ContextMenu(event);
193 contextMenu.appendItem(WebInspector.UIString("Remove Breakpoint"), breakpoint.remove.bind(breakpoint));
194 if (breakpoints.length > 1) {
195 var removeAllTitle = WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Remove all breakpoints" : "Remove All Breakpoints");
196 contextMenu.appendItem(removeAllTitle, this._breakpointManager.removeAllBreakpoints.bind(this._breakpointManager));
199 contextMenu.appendSeparator();
200 var breakpointActive = WebInspector.debuggerModel.breakpointsActive();
201 var breakpointActiveTitle = WebInspector.UIString(breakpointActive ? "Deactivate Breakpoints" : "Activate Breakpoints");
202 contextMenu.appendItem(breakpointActiveTitle, WebInspector.debuggerModel.setBreakpointsActive.bind(WebInspector.debuggerModel, !breakpointActive));
204 function enabledBreakpointCount(breakpoints)
207 for (var i = 0; i < breakpoints.length; ++i) {
208 if (breakpoints[i].checkbox.checked)
213 if (breakpoints.length > 1) {
214 var enableBreakpointCount = enabledBreakpointCount(breakpoints);
215 var enableTitle = WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Enable all breakpoints" : "Enable All Breakpoints");
216 var disableTitle = WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Disable all breakpoints" : "Disable All Breakpoints");
218 contextMenu.appendSeparator();
220 contextMenu.appendItem(enableTitle, this._breakpointManager.toggleAllBreakpoints.bind(this._breakpointManager, true), !(enableBreakpointCount != breakpoints.length));
221 contextMenu.appendItem(disableTitle, this._breakpointManager.toggleAllBreakpoints.bind(this._breakpointManager, false), !(enableBreakpointCount > 1));
227 _addListElement: function(element, beforeElement)
230 this.listElement.insertBefore(element, beforeElement);
232 if (!this.listElement.firstChild) {
233 this.bodyElement.removeChild(this.emptyElement);
234 this.bodyElement.appendChild(this.listElement);
236 this.listElement.appendChild(element);
240 _removeListElement: function(element)
242 this.listElement.removeChild(element);
243 if (!this.listElement.firstChild) {
244 this.bodyElement.removeChild(this.listElement);
245 this.bodyElement.appendChild(this.emptyElement);
249 _compare: function(x, y)
252 return x < y ? -1 : 1;
256 _compareBreakpoints: function(b1, b2)
258 return this._compare(b1.uiSourceCode.originURL(), b2.uiSourceCode.originURL()) || this._compare(b1.lineNumber, b2.lineNumber);
263 this.listElement.removeChildren();
264 if (this.listElement.parentElement) {
265 this.bodyElement.removeChild(this.listElement);
266 this.bodyElement.appendChild(this.emptyElement);
271 __proto__: WebInspector.SidebarPane.prototype
276 * @extends {WebInspector.NativeBreakpointsSidebarPane}
278 WebInspector.XHRBreakpointsSidebarPane = function()
280 WebInspector.NativeBreakpointsSidebarPane.call(this, WebInspector.UIString("XHR Breakpoints"));
282 this._breakpointElements = {};
284 var addButton = document.createElement("button");
285 addButton.className = "pane-title-button add";
286 addButton.addEventListener("click", this._addButtonClicked.bind(this), false);
287 addButton.title = WebInspector.UIString("Add XHR breakpoint");
288 this.titleElement.appendChild(addButton);
290 this.emptyElement.addEventListener("contextmenu", this._emptyElementContextMenu.bind(this), true);
292 this._restoreBreakpoints();
295 WebInspector.XHRBreakpointsSidebarPane.prototype = {
296 _emptyElementContextMenu: function(event)
298 var contextMenu = new WebInspector.ContextMenu(event);
299 contextMenu.appendItem(WebInspector.UIString("Add Breakpoint"), this._addButtonClicked.bind(this));
303 _addButtonClicked: function(event)
310 var inputElementContainer = document.createElement("p");
311 inputElementContainer.className = "breakpoint-condition";
312 var inputElement = document.createElement("span");
313 inputElementContainer.textContent = WebInspector.UIString("Break when URL contains:");
314 inputElement.className = "editing";
315 inputElement.id = "breakpoint-condition-input";
316 inputElementContainer.appendChild(inputElement);
317 this._addListElement(inputElementContainer, this.listElement.firstChild);
319 function finishEditing(accept, e, text)
321 this._removeListElement(inputElementContainer);
323 this._setBreakpoint(text, true);
324 this._saveBreakpoints();
328 var config = new WebInspector.EditingConfig(finishEditing.bind(this, true), finishEditing.bind(this, false));
329 WebInspector.startEditing(inputElement, config);
332 _setBreakpoint: function(url, enabled)
334 if (url in this._breakpointElements)
337 var element = document.createElement("li");
339 element.addEventListener("contextmenu", this._contextMenu.bind(this, url), true);
341 var checkboxElement = document.createElement("input");
342 checkboxElement.className = "checkbox-elem";
343 checkboxElement.type = "checkbox";
344 checkboxElement.checked = enabled;
345 checkboxElement.addEventListener("click", this._checkboxClicked.bind(this, url), false);
346 element._checkboxElement = checkboxElement;
347 element.appendChild(checkboxElement);
349 var labelElement = document.createElement("span");
351 labelElement.textContent = WebInspector.UIString("Any XHR");
353 labelElement.textContent = WebInspector.UIString("URL contains \"%s\"", url);
354 labelElement.addStyleClass("cursor-auto");
355 labelElement.addEventListener("dblclick", this._labelClicked.bind(this, url), false);
356 element.appendChild(labelElement);
358 var currentElement = this.listElement.firstChild;
359 while (currentElement) {
360 if (currentElement._url && currentElement._url < element._url)
362 currentElement = currentElement.nextSibling;
364 this._addListElement(element, currentElement);
365 this._breakpointElements[url] = element;
367 DOMDebuggerAgent.setXHRBreakpoint(url);
370 _removeBreakpoint: function(url)
372 var element = this._breakpointElements[url];
376 this._removeListElement(element);
377 delete this._breakpointElements[url];
378 if (element._checkboxElement.checked)
379 DOMDebuggerAgent.removeXHRBreakpoint(url);
382 _contextMenu: function(url, event)
384 var contextMenu = new WebInspector.ContextMenu(event);
385 function removeBreakpoint()
387 this._removeBreakpoint(url);
388 this._saveBreakpoints();
390 function removeAllBreakpoints()
392 for (var url in this._breakpointElements)
393 this._removeBreakpoint(url);
394 this._saveBreakpoints();
396 var removeAllTitle = WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Remove all breakpoints" : "Remove All Breakpoints");
398 contextMenu.appendItem(WebInspector.UIString("Add Breakpoint"), this._addButtonClicked.bind(this));
399 contextMenu.appendItem(WebInspector.UIString("Remove Breakpoint"), removeBreakpoint.bind(this));
400 contextMenu.appendItem(removeAllTitle, removeAllBreakpoints.bind(this));
404 _checkboxClicked: function(url, event)
406 if (event.target.checked)
407 DOMDebuggerAgent.setXHRBreakpoint(url);
409 DOMDebuggerAgent.removeXHRBreakpoint(url);
410 this._saveBreakpoints();
413 _labelClicked: function(url)
415 var element = this._breakpointElements[url];
416 var inputElement = document.createElement("span");
417 inputElement.className = "breakpoint-condition editing";
418 inputElement.textContent = url;
419 this.listElement.insertBefore(inputElement, element);
420 element.addStyleClass("hidden");
422 function finishEditing(accept, e, text)
424 this._removeListElement(inputElement);
426 this._removeBreakpoint(url);
427 this._setBreakpoint(text, element._checkboxElement.checked);
428 this._saveBreakpoints();
430 element.removeStyleClass("hidden");
433 WebInspector.startEditing(inputElement, new WebInspector.EditingConfig(finishEditing.bind(this, true), finishEditing.bind(this, false)));
436 highlightBreakpoint: function(url)
438 var element = this._breakpointElements[url];
442 element.addStyleClass("breakpoint-hit");
443 this._highlightedElement = element;
446 clearBreakpointHighlight: function()
448 if (this._highlightedElement) {
449 this._highlightedElement.removeStyleClass("breakpoint-hit");
450 delete this._highlightedElement;
454 _saveBreakpoints: function()
456 var breakpoints = [];
457 for (var url in this._breakpointElements)
458 breakpoints.push({ url: url, enabled: this._breakpointElements[url]._checkboxElement.checked });
459 WebInspector.settings.xhrBreakpoints.set(breakpoints);
462 _restoreBreakpoints: function()
464 var breakpoints = WebInspector.settings.xhrBreakpoints.get();
465 for (var i = 0; i < breakpoints.length; ++i) {
466 var breakpoint = breakpoints[i];
467 if (breakpoint && typeof breakpoint.url === "string")
468 this._setBreakpoint(breakpoint.url, breakpoint.enabled);
472 __proto__: WebInspector.NativeBreakpointsSidebarPane.prototype
477 * @extends {WebInspector.SidebarPane}
479 WebInspector.EventListenerBreakpointsSidebarPane = function()
481 WebInspector.SidebarPane.call(this, WebInspector.UIString("Event Listener Breakpoints"));
482 this.registerRequiredCSS("breakpointsList.css");
484 this.categoriesElement = document.createElement("ol");
485 this.categoriesElement.tabIndex = 0;
486 this.categoriesElement.addStyleClass("properties-tree");
487 this.categoriesElement.addStyleClass("event-listener-breakpoints");
488 this.categoriesTreeOutline = new TreeOutline(this.categoriesElement);
489 this.bodyElement.appendChild(this.categoriesElement);
491 this._breakpointItems = {};
492 // FIXME: uncomment following once inspector stops being drop targer in major ports.
493 // Otherwise, inspector page reacts on drop event and tries to load the event data.
494 // this._createCategory(WebInspector.UIString("Drag"), true, ["drag", "drop", "dragstart", "dragend", "dragenter", "dragleave", "dragover"]);
495 this._createCategory(WebInspector.UIString("Animation"), false, ["requestAnimationFrame", "cancelAnimationFrame", "animationFrameFired"]);
496 this._createCategory(WebInspector.UIString("Control"), true, ["resize", "scroll", "zoom", "focus", "blur", "select", "change", "submit", "reset"]);
497 this._createCategory(WebInspector.UIString("Clipboard"), true, ["copy", "cut", "paste", "beforecopy", "beforecut", "beforepaste"]);
498 this._createCategory(WebInspector.UIString("DOM Mutation"), true, ["DOMActivate", "DOMFocusIn", "DOMFocusOut", "DOMAttrModified", "DOMCharacterDataModified", "DOMNodeInserted", "DOMNodeInsertedIntoDocument", "DOMNodeRemoved", "DOMNodeRemovedFromDocument", "DOMSubtreeModified", "DOMContentLoaded"]);
499 this._createCategory(WebInspector.UIString("Device"), true, ["deviceorientation", "devicemotion"]);
500 this._createCategory(WebInspector.UIString("Keyboard"), true, ["keydown", "keyup", "keypress", "input"]);
501 this._createCategory(WebInspector.UIString("Load"), true, ["load", "unload", "abort", "error"]);
502 this._createCategory(WebInspector.UIString("Mouse"), true, ["click", "dblclick", "mousedown", "mouseup", "mouseover", "mousemove", "mouseout", "mousewheel"]);
503 this._createCategory(WebInspector.UIString("Timer"), false, ["setTimer", "clearTimer", "timerFired"]);
504 this._createCategory(WebInspector.UIString("Touch"), true, ["touchstart", "touchmove", "touchend", "touchcancel"]);
506 this._restoreBreakpoints();
509 WebInspector.EventListenerBreakpointsSidebarPane.categotyListener = "listener:";
510 WebInspector.EventListenerBreakpointsSidebarPane.categotyInstrumentation = "instrumentation:";
512 WebInspector.EventListenerBreakpointsSidebarPane.eventNameForUI = function(eventName)
514 if (!WebInspector.EventListenerBreakpointsSidebarPane._eventNamesForUI) {
515 WebInspector.EventListenerBreakpointsSidebarPane._eventNamesForUI = {
516 "instrumentation:setTimer": WebInspector.UIString("Set Timer"),
517 "instrumentation:clearTimer": WebInspector.UIString("Clear Timer"),
518 "instrumentation:timerFired": WebInspector.UIString("Timer Fired"),
519 "instrumentation:requestAnimationFrame": WebInspector.UIString("Request Animation Frame"),
520 "instrumentation:cancelAnimationFrame": WebInspector.UIString("Cancel Animation Frame"),
521 "instrumentation:animationFrameFired": WebInspector.UIString("Animation Frame Fired")
524 return WebInspector.EventListenerBreakpointsSidebarPane._eventNamesForUI[eventName] || eventName.substring(eventName.indexOf(":") + 1);
527 WebInspector.EventListenerBreakpointsSidebarPane.prototype = {
528 _createCategory: function(name, isDOMEvent, eventNames)
530 var categoryItem = {};
531 categoryItem.element = new TreeElement(name);
532 this.categoriesTreeOutline.appendChild(categoryItem.element);
533 categoryItem.element.listItemElement.addStyleClass("event-category");
534 categoryItem.element.selectable = true;
536 categoryItem.checkbox = this._createCheckbox(categoryItem.element);
537 categoryItem.checkbox.addEventListener("click", this._categoryCheckboxClicked.bind(this, categoryItem), true);
539 categoryItem.children = {};
540 for (var i = 0; i < eventNames.length; ++i) {
541 var eventName = (isDOMEvent ? WebInspector.EventListenerBreakpointsSidebarPane.categotyListener : WebInspector.EventListenerBreakpointsSidebarPane.categotyInstrumentation) + eventNames[i];
543 var breakpointItem = {};
544 var title = WebInspector.EventListenerBreakpointsSidebarPane.eventNameForUI(eventName);
545 breakpointItem.element = new TreeElement(title);
546 categoryItem.element.appendChild(breakpointItem.element);
547 var hitMarker = document.createElement("div");
548 hitMarker.className = "breakpoint-hit-marker";
549 breakpointItem.element.listItemElement.appendChild(hitMarker);
550 breakpointItem.element.listItemElement.addStyleClass("source-code");
551 breakpointItem.element.selectable = true;
553 breakpointItem.checkbox = this._createCheckbox(breakpointItem.element);
554 breakpointItem.checkbox.addEventListener("click", this._breakpointCheckboxClicked.bind(this, eventName), true);
555 breakpointItem.parent = categoryItem;
557 this._breakpointItems[eventName] = breakpointItem;
558 categoryItem.children[eventName] = breakpointItem;
562 _createCheckbox: function(treeElement)
564 var checkbox = document.createElement("input");
565 checkbox.className = "checkbox-elem";
566 checkbox.type = "checkbox";
567 treeElement.listItemElement.insertBefore(checkbox, treeElement.listItemElement.firstChild);
571 _categoryCheckboxClicked: function(categoryItem)
573 var checked = categoryItem.checkbox.checked;
574 for (var eventName in categoryItem.children) {
575 var breakpointItem = categoryItem.children[eventName];
576 if (breakpointItem.checkbox.checked === checked)
579 this._setBreakpoint(eventName);
581 this._removeBreakpoint(eventName);
583 this._saveBreakpoints();
586 _breakpointCheckboxClicked: function(eventName, event)
588 if (event.target.checked)
589 this._setBreakpoint(eventName);
591 this._removeBreakpoint(eventName);
592 this._saveBreakpoints();
595 _setBreakpoint: function(eventName)
597 var breakpointItem = this._breakpointItems[eventName];
600 breakpointItem.checkbox.checked = true;
601 if (eventName.startsWith(WebInspector.EventListenerBreakpointsSidebarPane.categotyListener))
602 DOMDebuggerAgent.setEventListenerBreakpoint(eventName.substring(WebInspector.EventListenerBreakpointsSidebarPane.categotyListener.length));
603 else if (eventName.startsWith(WebInspector.EventListenerBreakpointsSidebarPane.categotyInstrumentation))
604 DOMDebuggerAgent.setInstrumentationBreakpoint(eventName.substring(WebInspector.EventListenerBreakpointsSidebarPane.categotyInstrumentation.length));
605 this._updateCategoryCheckbox(breakpointItem.parent);
608 _removeBreakpoint: function(eventName)
610 var breakpointItem = this._breakpointItems[eventName];
613 breakpointItem.checkbox.checked = false;
614 if (eventName.startsWith(WebInspector.EventListenerBreakpointsSidebarPane.categotyListener))
615 DOMDebuggerAgent.removeEventListenerBreakpoint(eventName.substring(WebInspector.EventListenerBreakpointsSidebarPane.categotyListener.length));
616 else if (eventName.startsWith(WebInspector.EventListenerBreakpointsSidebarPane.categotyInstrumentation))
617 DOMDebuggerAgent.removeInstrumentationBreakpoint(eventName.substring(WebInspector.EventListenerBreakpointsSidebarPane.categotyInstrumentation.length));
618 this._updateCategoryCheckbox(breakpointItem.parent);
621 _updateCategoryCheckbox: function(categoryItem)
623 var hasEnabled = false, hasDisabled = false;
624 for (var eventName in categoryItem.children) {
625 var breakpointItem = categoryItem.children[eventName];
626 if (breakpointItem.checkbox.checked)
631 categoryItem.checkbox.checked = hasEnabled;
632 categoryItem.checkbox.indeterminate = hasEnabled && hasDisabled;
635 highlightBreakpoint: function(eventName)
637 var breakpointItem = this._breakpointItems[eventName];
641 breakpointItem.parent.element.expand();
642 breakpointItem.element.listItemElement.addStyleClass("breakpoint-hit");
643 this._highlightedElement = breakpointItem.element.listItemElement;
646 clearBreakpointHighlight: function()
648 if (this._highlightedElement) {
649 this._highlightedElement.removeStyleClass("breakpoint-hit");
650 delete this._highlightedElement;
654 _saveBreakpoints: function()
656 var breakpoints = [];
657 for (var eventName in this._breakpointItems) {
658 if (this._breakpointItems[eventName].checkbox.checked)
659 breakpoints.push({ eventName: eventName });
661 WebInspector.settings.eventListenerBreakpoints.set(breakpoints);
664 _restoreBreakpoints: function()
666 var breakpoints = WebInspector.settings.eventListenerBreakpoints.get();
667 for (var i = 0; i < breakpoints.length; ++i) {
668 var breakpoint = breakpoints[i];
669 if (breakpoint && typeof breakpoint.eventName === "string")
670 this._setBreakpoint(breakpoint.eventName);
674 __proto__: WebInspector.SidebarPane.prototype