Commit 1d0fe8a8 authored by samli@chromium.org's avatar samli@chromium.org

Devtools UI: Add shortcut for activating/deactivating breakpoints

This adds a Ctrl+F8 (Mac Cmd+F8) shortcut for toggling breakpoints
functionality.

BUG=525879

Review URL: https://codereview.chromium.org/1302323005

git-svn-id: svn://svn.chromium.org/blink/trunk@201442 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 97fd1782
......@@ -352,7 +352,7 @@ WebInspector.Main.prototype = {
_registerForwardedShortcuts: function()
{
/** @const */ var forwardedActions = ["main.reload", "main.hard-reload", "main.toggle-dock"];
/** @const */ var forwardedActions = ["main.reload", "main.hard-reload", "main.toggle-dock", "debugger.toggle-breakpoints-active"];
var actionKeys = WebInspector.shortcutRegistry.keysForActions(forwardedActions).map(WebInspector.KeyboardShortcut.keyCodeAndModifiersFromKey);
actionKeys.push({keyCode: WebInspector.KeyboardShortcut.Keys.F8.code});
......
......@@ -692,7 +692,7 @@ WebInspector.SourcesPanel.prototype = {
rawLocation.continueToLocation();
},
_toggleBreakpointsClicked: function(event)
_toggleBreakpointsActive: function()
{
WebInspector.breakpointManager.setBreakpointsActive(!WebInspector.breakpointManager.breakpointsActive());
},
......@@ -753,9 +753,8 @@ WebInspector.SourcesPanel.prototype = {
debugToolbar.appendSeparator();
// Toggle Breakpoints
this._toggleBreakpointsButton = new WebInspector.ToolbarButton(WebInspector.UIString("Deactivate breakpoints"), "breakpoint-toolbar-item");
this._toggleBreakpointsButton = WebInspector.ToolbarButton.createActionButton("debugger.toggle-breakpoints-active");
this._toggleBreakpointsButton.setToggled(false);
this._toggleBreakpointsButton.addEventListener("click", this._toggleBreakpointsClicked, this);
debugToolbar.appendToolbarItem(this._toggleBreakpointsButton);
// Pause on Exception
......@@ -1417,7 +1416,9 @@ WebInspector.SourcesPanel.DebuggingActionDelegate.prototype = {
case "debugger.run-snippet":
panel._runSnippet();
break;
case "debugger.toggle-breakpoints-active":
panel._toggleBreakpointsActive();
break;
}
}
}
......
......@@ -125,6 +125,23 @@
}
]
},
{
"type": "@WebInspector.ActionDelegate",
"actionId": "debugger.toggle-breakpoints-active",
"iconClass": "breakpoint-toolbar-item",
"className": "WebInspector.SourcesPanel.DebuggingActionDelegate",
"contextTypes": ["WebInspector.SourcesPanel"],
"bindings": [
{
"platform": "windows,linux",
"shortcut": "Ctrl+F8"
},
{
"platform": "mac",
"shortcut": "Meta+F8"
}
]
},
{
"type": "context-menu-item",
"location": "mainMenu/navigate",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment