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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 /** 4 /**
5 * @implements {Sources.TabbedEditorContainerDelegate} 5 * @implements {Sources.TabbedEditorContainerDelegate}
6 * @implements {UI.Searchable} 6 * @implements {UI.Searchable}
7 * @implements {UI.Replaceable} 7 * @implements {UI.Replaceable}
8 * @unrestricted 8 * @unrestricted
9 */ 9 */
10 Sources.SourcesView = class extends UI.VBox { 10 Sources.SourcesView = class extends UI.VBox {
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 this._onJumpToPreviousLocation.bind(this)); 146 this._onJumpToPreviousLocation.bind(this));
147 registerShortcut.call( 147 registerShortcut.call(
148 this, UI.ShortcutsScreen.SourcesPanelShortcuts.JumpToNextLocation, this. _onJumpToNextLocation.bind(this)); 148 this, UI.ShortcutsScreen.SourcesPanelShortcuts.JumpToNextLocation, this. _onJumpToNextLocation.bind(this));
149 registerShortcut.call( 149 registerShortcut.call(
150 this, UI.ShortcutsScreen.SourcesPanelShortcuts.CloseEditorTab, this._onC loseEditorTab.bind(this)); 150 this, UI.ShortcutsScreen.SourcesPanelShortcuts.CloseEditorTab, this._onC loseEditorTab.bind(this));
151 registerShortcut.call( 151 registerShortcut.call(
152 this, UI.ShortcutsScreen.SourcesPanelShortcuts.GoToLine, this._showGoToL ineQuickOpen.bind(this)); 152 this, UI.ShortcutsScreen.SourcesPanelShortcuts.GoToLine, this._showGoToL ineQuickOpen.bind(this));
153 registerShortcut.call( 153 registerShortcut.call(
154 this, UI.ShortcutsScreen.SourcesPanelShortcuts.GoToMember, this._showOut lineQuickOpen.bind(this)); 154 this, UI.ShortcutsScreen.SourcesPanelShortcuts.GoToMember, this._showOut lineQuickOpen.bind(this));
155 registerShortcut.call( 155 registerShortcut.call(
156 this, UI.ShortcutsScreen.SourcesPanelShortcuts.ToggleBreakpoint, this._t oggleBreakpoint.bind(this)); 156 this, UI.ShortcutsScreen.SourcesPanelShortcuts.ToggleBreakpoint,
157 this._toggleBreakpoint.bind(this, false /* onlyDisable */));
158 registerShortcut.call(
159 this, UI.ShortcutsScreen.SourcesPanelShortcuts.ToggleBreakpointEnabled,
160 this._toggleBreakpoint.bind(this, true /* onlyDisable */));
157 registerShortcut.call(this, UI.ShortcutsScreen.SourcesPanelShortcuts.Save, t his._save.bind(this)); 161 registerShortcut.call(this, UI.ShortcutsScreen.SourcesPanelShortcuts.Save, t his._save.bind(this));
158 registerShortcut.call(this, UI.ShortcutsScreen.SourcesPanelShortcuts.SaveAll , this._saveAll.bind(this)); 162 registerShortcut.call(this, UI.ShortcutsScreen.SourcesPanelShortcuts.SaveAll , this._saveAll.bind(this));
159 } 163 }
160 164
161 /** 165 /**
162 * @return {!UI.Toolbar} 166 * @return {!UI.Toolbar}
163 */ 167 */
164 leftToolbar() { 168 leftToolbar() {
165 return this._editorContainer.leftToolbar(); 169 return this._editorContainer.leftToolbar();
166 } 170 }
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after
653 * @param {?UI.Widget} sourceFrame 657 * @param {?UI.Widget} sourceFrame
654 */ 658 */
655 _saveSourceFrame(sourceFrame) { 659 _saveSourceFrame(sourceFrame) {
656 if (!(sourceFrame instanceof SourceFrame.UISourceCodeFrame)) 660 if (!(sourceFrame instanceof SourceFrame.UISourceCodeFrame))
657 return; 661 return;
658 var uiSourceCodeFrame = /** @type {!SourceFrame.UISourceCodeFrame} */ (sourc eFrame); 662 var uiSourceCodeFrame = /** @type {!SourceFrame.UISourceCodeFrame} */ (sourc eFrame);
659 uiSourceCodeFrame.commitEditing(); 663 uiSourceCodeFrame.commitEditing();
660 } 664 }
661 665
662 /** 666 /**
667 * @param {boolean} onlyDisable
663 * @return {boolean} 668 * @return {boolean}
664 */ 669 */
665 _toggleBreakpoint() { 670 _toggleBreakpoint(onlyDisable) {
666 var sourceFrame = this.currentSourceFrame(); 671 var sourceFrame = this.currentSourceFrame();
667 if (!sourceFrame) 672 if (!sourceFrame)
668 return false; 673 return false;
669 674
670 if (sourceFrame instanceof Sources.JavaScriptSourceFrame) { 675 if (sourceFrame instanceof Sources.JavaScriptSourceFrame) {
671 var javaScriptSourceFrame = /** @type {!Sources.JavaScriptSourceFrame} */ (sourceFrame); 676 var javaScriptSourceFrame = /** @type {!Sources.JavaScriptSourceFrame} */ (sourceFrame);
672 javaScriptSourceFrame.toggleBreakpointOnCurrentLine(); 677 javaScriptSourceFrame.toggleBreakpointOnCurrentLine(onlyDisable);
673 return true; 678 return true;
674 } 679 }
675 return false; 680 return false;
676 } 681 }
677 682
678 /** 683 /**
679 * @param {boolean} active 684 * @param {boolean} active
680 */ 685 */
681 toggleBreakpointsActiveState(active) { 686 toggleBreakpointsActiveState(active) {
682 this._editorContainer.view.element.classList.toggle('breakpoints-deactivated ', !active); 687 this._editorContainer.view.element.classList.toggle('breakpoints-deactivated ', !active);
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
773 * @return {boolean} 778 * @return {boolean}
774 */ 779 */
775 handleAction(context, actionId) { 780 handleAction(context, actionId) {
776 var sourcesView = UI.context.flavor(Sources.SourcesView); 781 var sourcesView = UI.context.flavor(Sources.SourcesView);
777 if (!sourcesView) 782 if (!sourcesView)
778 return false; 783 return false;
779 sourcesView._editorContainer.closeAllFiles(); 784 sourcesView._editorContainer.closeAllFiles();
780 return true; 785 return true;
781 } 786 }
782 }; 787 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698