Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(949)

Unified Diff: third_party/WebKit/Source/devtools/front_end/sources/SourcesView.js

Issue 2977753002: DevTools: align keyboard shortcut with mouse action to toggle breakpoint enabled (Closed)
Patch Set: Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/sources/SourcesView.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/SourcesView.js b/third_party/WebKit/Source/devtools/front_end/sources/SourcesView.js
index a0e19b859621e450da6dd4c968547ac40315bb7b..a648cce498794a453ed7dd6fc027915072c9f1ab 100644
--- a/third_party/WebKit/Source/devtools/front_end/sources/SourcesView.js
+++ b/third_party/WebKit/Source/devtools/front_end/sources/SourcesView.js
@@ -153,7 +153,11 @@ Sources.SourcesView = class extends UI.VBox {
registerShortcut.call(
this, UI.ShortcutsScreen.SourcesPanelShortcuts.GoToMember, this._showOutlineQuickOpen.bind(this));
registerShortcut.call(
- this, UI.ShortcutsScreen.SourcesPanelShortcuts.ToggleBreakpoint, this._toggleBreakpoint.bind(this));
+ this, UI.ShortcutsScreen.SourcesPanelShortcuts.ToggleBreakpoint,
+ this._toggleBreakpoint.bind(this, false /* onlyDisable */));
+ registerShortcut.call(
+ this, UI.ShortcutsScreen.SourcesPanelShortcuts.ToggleBreakpointEnabled,
+ this._toggleBreakpoint.bind(this, true /* onlyDisable */));
registerShortcut.call(this, UI.ShortcutsScreen.SourcesPanelShortcuts.Save, this._save.bind(this));
registerShortcut.call(this, UI.ShortcutsScreen.SourcesPanelShortcuts.SaveAll, this._saveAll.bind(this));
}
@@ -660,16 +664,17 @@ Sources.SourcesView = class extends UI.VBox {
}
/**
+ * @param {boolean} onlyDisable
* @return {boolean}
*/
- _toggleBreakpoint() {
+ _toggleBreakpoint(onlyDisable) {
var sourceFrame = this.currentSourceFrame();
if (!sourceFrame)
return false;
if (sourceFrame instanceof Sources.JavaScriptSourceFrame) {
var javaScriptSourceFrame = /** @type {!Sources.JavaScriptSourceFrame} */ (sourceFrame);
- javaScriptSourceFrame.toggleBreakpointOnCurrentLine();
+ javaScriptSourceFrame.toggleBreakpointOnCurrentLine(onlyDisable);
return true;
}
return false;

Powered by Google App Engine
This is Rietveld 408576698