Web Inspector: Feature Request: Able to remove all breakpoints.
authorloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 19 Dec 2011 13:07:49 +0000 (13:07 +0000)
committerloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 19 Dec 2011 13:07:49 +0000 (13:07 +0000)
https://bugs.webkit.org/show_bug.cgi?id=63055

Reviewed by Pavel Feldman.

* English.lproj/localizedStrings.js:
* inspector/front-end/BreakpointManager.js:
(WebInspector.BreakpointManager.prototype.removeAllBreakpoints):
* inspector/front-end/BreakpointsSidebarPane.js:
(WebInspector.JavaScriptBreakpointsSidebarPane):
(WebInspector.JavaScriptBreakpointsSidebarPane.prototype._breakpointContextMenu):
(WebInspector.JavaScriptBreakpointsSidebarPane.prototype._contextMenu):
* inspector/front-end/DebuggerPresentationModel.js:
(WebInspector.DebuggerPresentationModel.prototype.removeAllBreakpoints):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@103229 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/English.lproj/localizedStrings.js
Source/WebCore/inspector/front-end/BreakpointManager.js
Source/WebCore/inspector/front-end/BreakpointsSidebarPane.js
Source/WebCore/inspector/front-end/DebuggerPresentationModel.js

index 7ff829b95a334c40250e7bfebc75716d762d36f0..0bf1cedcc6dbb15ebdc4e4597dc56bcc617ae858 100644 (file)
@@ -1,3 +1,20 @@
+2011-12-19  Ilya Tikhonovsky  <loislo@chromium.org>
+
+        Web Inspector: Feature Request: Able to remove all breakpoints.
+        https://bugs.webkit.org/show_bug.cgi?id=63055
+
+        Reviewed by Pavel Feldman.
+
+        * English.lproj/localizedStrings.js:
+        * inspector/front-end/BreakpointManager.js:
+        (WebInspector.BreakpointManager.prototype.removeAllBreakpoints):
+        * inspector/front-end/BreakpointsSidebarPane.js:
+        (WebInspector.JavaScriptBreakpointsSidebarPane):
+        (WebInspector.JavaScriptBreakpointsSidebarPane.prototype._breakpointContextMenu):
+        (WebInspector.JavaScriptBreakpointsSidebarPane.prototype._contextMenu):
+        * inspector/front-end/DebuggerPresentationModel.js:
+        (WebInspector.DebuggerPresentationModel.prototype.removeAllBreakpoints):
+
 2011-12-19  Benjamin Poulain  <benjamin@webkit.org>
 
         Build fix for ScrollingCoordinatorMac.mm when building on a case sensitive system
index 87775a17b9d00d1b551f2601531b897173908b35..05e1af68cd2f367a1bfcb025f123e3a44c3f17a8 100644 (file)
Binary files a/Source/WebCore/English.lproj/localizedStrings.js and b/Source/WebCore/English.lproj/localizedStrings.js differ
index 7439f900868d58743fba85bc5424d0f01ea1bfa2..848c298267b1580b9fd5d97463785f825ff1c23e 100644 (file)
@@ -112,10 +112,25 @@ WebInspector.BreakpointManager.prototype = {
         var breakpoint = this._breakpoint(uiSourceCode.id, lineNumber);
         if (!breakpoint)
             return;
+        this._removeBreakpoint(breakpoint);
+    },
+
+    /**
+     * @param {WebInspector.Breakpoint} breakpoint
+     */
+    _removeBreakpoint: function(breakpoint)
+    {
         this._deleteBreakpointFromUI(breakpoint);
         this._removeBreakpointFromDebugger(breakpoint);
     },
 
+    /**
+     */
+    removeAllBreakpoints: function()
+    {
+        this._forEachBreakpoint(this._removeBreakpoint.bind(this));
+    },
+
     /**
      * @param {WebInspector.Breakpoint} breakpoint
      * @param {WebInspector.RawSourceCode.SourceMapping} sourceMapping
index e427e02cec46f44a6419deb4ed5c79ce223a71a7..a518347eb28e94c27f20d73a3d420c7691eb46e0 100644 (file)
@@ -42,6 +42,7 @@ WebInspector.JavaScriptBreakpointsSidebarPane = function(model, showSourceLineDe
     this.emptyElement.textContent = WebInspector.UIString("No Breakpoints");
 
     this.bodyElement.appendChild(this.emptyElement);
+    this.bodyElement.addEventListener("contextmenu", this._contextMenu.bind(this), false);
 
     this._items = {};
 }
@@ -55,7 +56,7 @@ WebInspector.JavaScriptBreakpointsSidebarPane.prototype = {
 
         var element = document.createElement("li");
         element.addStyleClass("cursor-pointer");
-        element.addEventListener("contextmenu", this._contextMenu.bind(this, breakpoint), true);
+        element.addEventListener("contextmenu", this._breakpointContextMenu.bind(this, breakpoint), true);
         element.addEventListener("click", this._breakpointClicked.bind(this, breakpoint), false);
 
         var checkbox = document.createElement("input");
@@ -144,16 +145,26 @@ WebInspector.JavaScriptBreakpointsSidebarPane.prototype = {
         this._model.setBreakpointEnabled(breakpoint.uiSourceCode, breakpoint.lineNumber, event.target.checked);
     },
 
-    _contextMenu: function(breakpoint, event)
+    _breakpointContextMenu: function(breakpoint, event)
     {
         var contextMenu = new WebInspector.ContextMenu();
 
         var removeHandler = this._model.removeBreakpoint.bind(this._model, breakpoint.uiSourceCode, breakpoint.lineNumber);
         contextMenu.appendItem(WebInspector.UIString("Remove Breakpoint"), removeHandler);
+        var removeAllTitle = WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Remove all JavaScript breakpoints" : "Remove All JavaScript Breakpoints");
+        contextMenu.appendItem(removeAllTitle, this._model.removeAllBreakpoints.bind(this._model));
 
         contextMenu.show(event);
     },
 
+    _contextMenu: function(event)
+    {
+        var contextMenu = new WebInspector.ContextMenu();
+        var removeAllTitle = WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Remove all JavaScript breakpoints" : "Remove All JavaScript Breakpoints");
+        contextMenu.appendItem(removeAllTitle, this._model.removeAllBreakpoints.bind(this._model));
+        contextMenu.show(event);
+    },
+
     _addListElement: function(element, beforeElement)
     {
         if (beforeElement)
index a7942b7c5180f0cf6a9812ccfc729bb04540d2a5..28897ae669a9fa5671362a7791155d4e38cd6aa2 100644 (file)
@@ -470,6 +470,13 @@ WebInspector.DebuggerPresentationModel.prototype = {
         this._breakpointManager.removeBreakpoint(uiSourceCode, lineNumber);
     },
 
+    /**
+     */
+    removeAllBreakpoints: function()
+    {
+        this._breakpointManager.removeAllBreakpoints();
+    },
+
     /**
      * @param {WebInspector.UISourceCode} uiSourceCode
      * @param {number} lineNumber