OLD | NEW |
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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 * @this {Sources.SourcesView} | 100 * @this {Sources.SourcesView} |
101 * @param {!Array.<!UI.KeyboardShortcut.Descriptor>} shortcuts | 101 * @param {!Array.<!UI.KeyboardShortcut.Descriptor>} shortcuts |
102 * @param {function(!Event=):boolean} handler | 102 * @param {function(!Event=):boolean} handler |
103 */ | 103 */ |
104 function registerShortcut(shortcuts, handler) { | 104 function registerShortcut(shortcuts, handler) { |
105 registerShortcutDelegate(shortcuts, handler); | 105 registerShortcutDelegate(shortcuts, handler); |
106 this._registerShortcuts(shortcuts, handler); | 106 this._registerShortcuts(shortcuts, handler); |
107 } | 107 } |
108 | 108 |
109 registerShortcut.call( | 109 registerShortcut.call( |
110 this, Components.ShortcutsScreen.SourcesPanelShortcuts.JumpToPreviousLoc
ation, | 110 this, UI.ShortcutsScreen.SourcesPanelShortcuts.JumpToPreviousLocation, |
111 this._onJumpToPreviousLocation.bind(this)); | 111 this._onJumpToPreviousLocation.bind(this)); |
112 registerShortcut.call( | 112 registerShortcut.call( |
113 this, Components.ShortcutsScreen.SourcesPanelShortcuts.JumpToNextLocatio
n, | 113 this, UI.ShortcutsScreen.SourcesPanelShortcuts.JumpToNextLocation, this.
_onJumpToNextLocation.bind(this)); |
114 this._onJumpToNextLocation.bind(this)); | |
115 registerShortcut.call( | 114 registerShortcut.call( |
116 this, Components.ShortcutsScreen.SourcesPanelShortcuts.CloseEditorTab, t
his._onCloseEditorTab.bind(this)); | 115 this, UI.ShortcutsScreen.SourcesPanelShortcuts.CloseEditorTab, this._onC
loseEditorTab.bind(this)); |
| 116 registerShortcut.call(this, UI.ShortcutsScreen.SourcesPanelShortcuts.GoToLin
e, this._showGoToLineDialog.bind(this)); |
117 registerShortcut.call( | 117 registerShortcut.call( |
118 this, Components.ShortcutsScreen.SourcesPanelShortcuts.GoToLine, this._s
howGoToLineDialog.bind(this)); | 118 this, UI.ShortcutsScreen.SourcesPanelShortcuts.GoToMember, this._showOut
lineDialog.bind(this)); |
119 registerShortcut.call( | 119 registerShortcut.call( |
120 this, Components.ShortcutsScreen.SourcesPanelShortcuts.GoToMember, this.
_showOutlineDialog.bind(this)); | 120 this, UI.ShortcutsScreen.SourcesPanelShortcuts.ToggleBreakpoint, this._t
oggleBreakpoint.bind(this)); |
121 registerShortcut.call( | 121 registerShortcut.call(this, UI.ShortcutsScreen.SourcesPanelShortcuts.Save, t
his._save.bind(this)); |
122 this, Components.ShortcutsScreen.SourcesPanelShortcuts.ToggleBreakpoint,
this._toggleBreakpoint.bind(this)); | 122 registerShortcut.call(this, UI.ShortcutsScreen.SourcesPanelShortcuts.SaveAll
, this._saveAll.bind(this)); |
123 registerShortcut.call(this, Components.ShortcutsScreen.SourcesPanelShortcuts
.Save, this._save.bind(this)); | |
124 registerShortcut.call(this, Components.ShortcutsScreen.SourcesPanelShortcuts
.SaveAll, this._saveAll.bind(this)); | |
125 } | 123 } |
126 | 124 |
127 /** | 125 /** |
128 * @return {!UI.Toolbar} | 126 * @return {!UI.Toolbar} |
129 */ | 127 */ |
130 leftToolbar() { | 128 leftToolbar() { |
131 return this._editorContainer.leftToolbar(); | 129 return this._editorContainer.leftToolbar(); |
132 } | 130 } |
133 | 131 |
134 /** | 132 /** |
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
768 * @return {boolean} | 766 * @return {boolean} |
769 */ | 767 */ |
770 handleAction(context, actionId) { | 768 handleAction(context, actionId) { |
771 var sourcesView = UI.context.flavor(Sources.SourcesView); | 769 var sourcesView = UI.context.flavor(Sources.SourcesView); |
772 if (!sourcesView) | 770 if (!sourcesView) |
773 return false; | 771 return false; |
774 sourcesView._editorContainer.closeAllFiles(); | 772 sourcesView._editorContainer.closeAllFiles(); |
775 return true; | 773 return true; |
776 } | 774 } |
777 }; | 775 }; |
OLD | NEW |