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

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

Issue 2783233005: DevTools: Move JavaScript and CSS outline into QuickOpen (Closed)
Patch Set: Created 3 years, 8 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 registerShortcut.call( 126 registerShortcut.call(
127 this, UI.ShortcutsScreen.SourcesPanelShortcuts.JumpToPreviousLocation, 127 this, UI.ShortcutsScreen.SourcesPanelShortcuts.JumpToPreviousLocation,
128 this._onJumpToPreviousLocation.bind(this)); 128 this._onJumpToPreviousLocation.bind(this));
129 registerShortcut.call( 129 registerShortcut.call(
130 this, UI.ShortcutsScreen.SourcesPanelShortcuts.JumpToNextLocation, this. _onJumpToNextLocation.bind(this)); 130 this, UI.ShortcutsScreen.SourcesPanelShortcuts.JumpToNextLocation, this. _onJumpToNextLocation.bind(this));
131 registerShortcut.call( 131 registerShortcut.call(
132 this, UI.ShortcutsScreen.SourcesPanelShortcuts.CloseEditorTab, this._onC loseEditorTab.bind(this)); 132 this, UI.ShortcutsScreen.SourcesPanelShortcuts.CloseEditorTab, this._onC loseEditorTab.bind(this));
133 registerShortcut.call( 133 registerShortcut.call(
134 this, UI.ShortcutsScreen.SourcesPanelShortcuts.GoToLine, this._showGoToL ineQuickOpen.bind(this)); 134 this, UI.ShortcutsScreen.SourcesPanelShortcuts.GoToLine, this._showGoToL ineQuickOpen.bind(this));
135 registerShortcut.call( 135 registerShortcut.call(
136 this, UI.ShortcutsScreen.SourcesPanelShortcuts.GoToMember, this._showOut lineDialog.bind(this)); 136 this, UI.ShortcutsScreen.SourcesPanelShortcuts.GoToMember, this._showOut lineQuickOpen.bind(this));
137 registerShortcut.call( 137 registerShortcut.call(
138 this, UI.ShortcutsScreen.SourcesPanelShortcuts.ToggleBreakpoint, this._t oggleBreakpoint.bind(this)); 138 this, UI.ShortcutsScreen.SourcesPanelShortcuts.ToggleBreakpoint, this._t oggleBreakpoint.bind(this));
139 registerShortcut.call(this, UI.ShortcutsScreen.SourcesPanelShortcuts.Save, t his._save.bind(this)); 139 registerShortcut.call(this, UI.ShortcutsScreen.SourcesPanelShortcuts.Save, t his._save.bind(this));
140 registerShortcut.call(this, UI.ShortcutsScreen.SourcesPanelShortcuts.SaveAll , this._saveAll.bind(this)); 140 registerShortcut.call(this, UI.ShortcutsScreen.SourcesPanelShortcuts.SaveAll , this._saveAll.bind(this));
141 } 141 }
142 142
143 /** 143 /**
144 * @return {!UI.Toolbar} 144 * @return {!UI.Toolbar}
145 */ 145 */
146 leftToolbar() { 146 leftToolbar() {
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 var sourceFrame = this.currentSourceFrame(); 591 var sourceFrame = this.currentSourceFrame();
592 if (!sourceFrame) { 592 if (!sourceFrame) {
593 console.assert(sourceFrame); 593 console.assert(sourceFrame);
594 return; 594 return;
595 } 595 }
596 sourceFrame.replaceAllWith(searchConfig, replacement); 596 sourceFrame.replaceAllWith(searchConfig, replacement);
597 } 597 }
598 598
599 /** 599 /**
600 * @param {!Event=} event 600 * @param {!Event=} event
601 * @return {boolean}
602 */ 601 */
603 _showOutlineDialog(event) { 602 _showOutlineQuickOpen(event) {
604 var uiSourceCode = this._editorContainer.currentFile(); 603 QuickOpen.QuickOpen.show('@');
605 if (!uiSourceCode)
606 return false;
607
608 if (uiSourceCode.contentType().hasScripts()) {
609 Sources.JavaScriptOutlineDialog.show(uiSourceCode, this.showSourceLocation .bind(this, uiSourceCode));
610 return true;
611 }
612
613 if (uiSourceCode.contentType().isStyleSheet()) {
614 Sources.StyleSheetOutlineDialog.show(uiSourceCode, this.showSourceLocation .bind(this, uiSourceCode));
615 return true;
616 }
617
618 // We don't want default browser shortcut to be executed, so pretend to hand le this event.
619 return true; 604 return true;
620 } 605 }
621 606
622 /** 607 /**
623 * @param {!Event=} event 608 * @param {!Event=} event
624 * @return {boolean} 609 * @return {boolean}
625 */ 610 */
626 _showGoToLineQuickOpen(event) { 611 _showGoToLineQuickOpen(event) {
627 if (this._editorContainer.currentFile()) 612 if (this._editorContainer.currentFile())
628 QuickOpen.QuickOpen.show(':'); 613 QuickOpen.QuickOpen.show(':');
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
770 * @return {boolean} 755 * @return {boolean}
771 */ 756 */
772 handleAction(context, actionId) { 757 handleAction(context, actionId) {
773 var sourcesView = UI.context.flavor(Sources.SourcesView); 758 var sourcesView = UI.context.flavor(Sources.SourcesView);
774 if (!sourcesView) 759 if (!sourcesView)
775 return false; 760 return false;
776 sourcesView._editorContainer.closeAllFiles(); 761 sourcesView._editorContainer.closeAllFiles();
777 return true; 762 return true;
778 } 763 }
779 }; 764 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698