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 /** | 5 /** |
6 * @constructor | 6 * @constructor |
7 * @implements {WebInspector.TabbedEditorContainerDelegate} | 7 * @implements {WebInspector.TabbedEditorContainerDelegate} |
8 * @implements {WebInspector.Searchable} | 8 * @implements {WebInspector.Searchable} |
9 * @implements {WebInspector.Replaceable} | 9 * @implements {WebInspector.Replaceable} |
10 * @extends {WebInspector.VBox} | 10 * @extends {WebInspector.VBox} |
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
644 */ | 644 */ |
645 _showOutlineDialog: function(event) | 645 _showOutlineDialog: function(event) |
646 { | 646 { |
647 var uiSourceCode = this._editorContainer.currentFile(); | 647 var uiSourceCode = this._editorContainer.currentFile(); |
648 if (!uiSourceCode) | 648 if (!uiSourceCode) |
649 return false; | 649 return false; |
650 | 650 |
651 switch (uiSourceCode.contentType()) { | 651 switch (uiSourceCode.contentType()) { |
652 case WebInspector.resourceTypes.Document: | 652 case WebInspector.resourceTypes.Document: |
653 case WebInspector.resourceTypes.Script: | 653 case WebInspector.resourceTypes.Script: |
654 WebInspector.JavaScriptOutlineDialog.show(this, uiSourceCode, this.s
howSourceLocation.bind(this, uiSourceCode)); | 654 WebInspector.JavaScriptOutlineDialog.show(uiSourceCode, this.showSou
rceLocation.bind(this, uiSourceCode)); |
655 return true; | 655 return true; |
656 case WebInspector.resourceTypes.Stylesheet: | 656 case WebInspector.resourceTypes.Stylesheet: |
657 WebInspector.StyleSheetOutlineDialog.show(this, uiSourceCode, this.s
howSourceLocation.bind(this, uiSourceCode)); | 657 WebInspector.StyleSheetOutlineDialog.show(uiSourceCode, this.showSou
rceLocation.bind(this, uiSourceCode)); |
658 return true; | 658 return true; |
659 default: | 659 default: |
660 // We don't want default browser shortcut to be executed, so pretend
to handle this event. | 660 // We don't want default browser shortcut to be executed, so pretend
to handle this event. |
661 return true; | 661 return true; |
662 } | 662 } |
663 }, | 663 }, |
664 | 664 |
665 /** | 665 /** |
666 * @param {string=} query | 666 * @param {string=} query |
667 */ | 667 */ |
668 showOpenResourceDialog: function(query) | 668 showOpenResourceDialog: function(query) |
669 { | 669 { |
670 var uiSourceCodes = this._editorContainer.historyUISourceCodes(); | 670 var uiSourceCodes = this._editorContainer.historyUISourceCodes(); |
671 /** @type {!Map.<!WebInspector.UISourceCode, number>} */ | 671 /** @type {!Map.<!WebInspector.UISourceCode, number>} */ |
672 var defaultScores = new Map(); | 672 var defaultScores = new Map(); |
673 for (var i = 1; i < uiSourceCodes.length; ++i) // Skip current element | 673 for (var i = 1; i < uiSourceCodes.length; ++i) // Skip current element |
674 defaultScores.set(uiSourceCodes[i], uiSourceCodes.length - i); | 674 defaultScores.set(uiSourceCodes[i], uiSourceCodes.length - i); |
675 WebInspector.OpenResourceDialog.show(this, this.element, query, defaultS
cores); | 675 WebInspector.OpenResourceDialog.show(this, query, defaultScores); |
676 }, | 676 }, |
677 | 677 |
678 /** | 678 /** |
679 * @param {!Event=} event | 679 * @param {!Event=} event |
680 * @return {boolean} | 680 * @return {boolean} |
681 */ | 681 */ |
682 _showGoToLineDialog: function(event) | 682 _showGoToLineDialog: function(event) |
683 { | 683 { |
684 if (this._currentUISourceCode) | 684 if (this._currentUISourceCode) |
685 this.showOpenResourceDialog(":"); | 685 this.showOpenResourceDialog(":"); |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
816 var sourcesView = WebInspector.context.flavor(WebInspector.SourcesView); | 816 var sourcesView = WebInspector.context.flavor(WebInspector.SourcesView); |
817 var currentUISourceCode = sourcesView.currentUISourceCode(); | 817 var currentUISourceCode = sourcesView.currentUISourceCode(); |
818 if (!currentUISourceCode) | 818 if (!currentUISourceCode) |
819 return; | 819 return; |
820 var nextUISourceCode = WebInspector.SourcesView.SwitchFileActionDelegate
._nextFile(currentUISourceCode); | 820 var nextUISourceCode = WebInspector.SourcesView.SwitchFileActionDelegate
._nextFile(currentUISourceCode); |
821 if (!nextUISourceCode) | 821 if (!nextUISourceCode) |
822 return; | 822 return; |
823 sourcesView.showSourceLocation(nextUISourceCode); | 823 sourcesView.showSourceLocation(nextUISourceCode); |
824 } | 824 } |
825 } | 825 } |
OLD | NEW |