OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 * Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
5 */ | 5 */ |
6 | 6 |
7 /** | 7 /** |
8 * @unrestricted | 8 * @unrestricted |
9 */ | 9 */ |
10 Sources.OpenResourceDialog = class extends Sources.FilteredUISourceCodeListDeleg ate { | 10 Sources.OpenResourceDialog = class extends Sources.FilteredUISourceCodeListDeleg ate { |
pfeldman
2017/02/07 02:10:03
This is no longer a dialog, lets call it Sources.O
einbinder
2017/02/28 23:59:07
Done.
| |
11 /** | 11 constructor() { |
12 * @param {!Sources.SourcesView} sourcesView | 12 super(Sources.SourcesView.defaultUISourceCodeScores()); |
13 * @param {!Map.<!Workspace.UISourceCode, number>} defaultScores | |
14 */ | |
15 constructor(sourcesView, defaultScores) { | |
16 super(defaultScores); | |
17 this._sourcesView = sourcesView; | |
18 this.populate(); | 13 this.populate(); |
19 } | 14 } |
20 | 15 |
21 /** | 16 /** |
22 * @param {!Sources.SourcesView} sourcesView | |
23 * @param {string} query | |
24 * @param {!Map.<!Workspace.UISourceCode, number>} defaultScores | |
25 * @param {!Array<string>} history | |
26 */ | |
27 static show(sourcesView, query, defaultScores, history) { | |
28 var dialog = new Sources.OpenResourceDialog(sourcesView, defaultScores); | |
29 if (InspectorFrontendHost.isUnderTest()) | |
30 Sources.OpenResourceDialog._instanceForTest = dialog; | |
31 var filteredItemSelectionDialog = new QuickOpen.FilteredListWidget(dialog, h istory); | |
32 filteredItemSelectionDialog.showAsDialog(); | |
33 filteredItemSelectionDialog.setQuery(query); | |
34 } | |
35 | |
36 /** | |
37 * @override | 17 * @override |
38 * @param {?Workspace.UISourceCode} uiSourceCode | 18 * @param {?Workspace.UISourceCode} uiSourceCode |
39 * @param {number=} lineNumber | 19 * @param {number=} lineNumber |
40 * @param {number=} columnNumber | 20 * @param {number=} columnNumber |
41 */ | 21 */ |
42 uiSourceCodeSelected(uiSourceCode, lineNumber, columnNumber) { | 22 uiSourceCodeSelected(uiSourceCode, lineNumber, columnNumber) { |
43 if (!uiSourceCode) | 23 if (!uiSourceCode) |
44 uiSourceCode = this._sourcesView.currentUISourceCode(); | |
45 if (!uiSourceCode) | |
46 return; | 24 return; |
47 this._sourcesView.showSourceLocation(uiSourceCode, lineNumber, columnNumber) ; | 25 Common.Revealer.reveal(uiSourceCode.uiLocation((lineNumber || 0), columnNumb er)); |
48 } | 26 } |
49 | 27 |
50 /** | 28 /** |
51 * @override | |
52 * @param {string} query | |
53 * @return {boolean} | |
54 */ | |
55 shouldShowMatchingItems(query) { | |
56 return !query.startsWith(':'); | |
57 } | |
58 | |
59 /** | |
60 * @override | 29 * @override |
61 * @param {!Workspace.Project} project | 30 * @param {!Workspace.Project} project |
62 * @return {boolean} | 31 * @return {boolean} |
63 */ | 32 */ |
64 filterProject(project) { | 33 filterProject(project) { |
65 return !project.isServiceProject(); | 34 return !project.isServiceProject(); |
66 } | 35 } |
67 | 36 |
68 /** | 37 /** |
69 * @override | 38 * @override |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
122 } | 91 } |
123 | 92 |
124 /** | 93 /** |
125 * @override | 94 * @override |
126 * @return {boolean} | 95 * @return {boolean} |
127 */ | 96 */ |
128 renderAsTwoRows() { | 97 renderAsTwoRows() { |
129 return true; | 98 return true; |
130 } | 99 } |
131 }; | 100 }; |
OLD | NEW |