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 { |
11 /** | 11 /** |
12 * @param {!Sources.SourcesView} sourcesView | 12 * @param {!Sources.SourcesView} sourcesView |
13 * @param {!Map.<!Workspace.UISourceCode, number>} defaultScores | 13 * @param {!Map.<!Workspace.UISourceCode, number>} defaultScores |
14 * @param {!Array<string>} history | 14 * @param {!Array<string>} history |
15 */ | 15 */ |
16 constructor(sourcesView, defaultScores, history) { | 16 constructor(sourcesView, defaultScores, history) { |
17 super(defaultScores, history); | 17 super(defaultScores, history); |
18 this._sourcesView = sourcesView; | 18 this._sourcesView = sourcesView; |
19 this.populate(); | 19 this.populate(); |
20 } | 20 } |
21 | 21 |
22 /** | 22 /** |
23 * @param {!Sources.SourcesView} sourcesView | 23 * @param {!Sources.SourcesView} sourcesView |
24 * @param {string} query | 24 * @param {string} query |
25 * @param {!Map.<!Workspace.UISourceCode, number>} defaultScores | 25 * @param {!Map.<!Workspace.UISourceCode, number>} defaultScores |
26 * @param {!Array<string>} history | 26 * @param {!Array<string>} history |
27 */ | 27 */ |
28 static show(sourcesView, query, defaultScores, history) { | 28 static show(sourcesView, query, defaultScores, history) { |
29 var dialog = new Sources.OpenResourceDialog(sourcesView, defaultScores, hist
ory); | 29 var dialog = new Sources.OpenResourceDialog(sourcesView, defaultScores, hist
ory); |
30 Sources.OpenResourceDialog._instanceForTest = dialog; | 30 if (InspectorFrontendHost.isUnderTest()) |
| 31 Sources.OpenResourceDialog._instanceForTest = dialog; |
31 var filteredItemSelectionDialog = new UI.FilteredListWidget(dialog); | 32 var filteredItemSelectionDialog = new UI.FilteredListWidget(dialog); |
32 filteredItemSelectionDialog.showAsDialog(); | 33 filteredItemSelectionDialog.showAsDialog(); |
33 filteredItemSelectionDialog.setQuery(query); | 34 filteredItemSelectionDialog.setQuery(query); |
34 } | 35 } |
35 | 36 |
36 /** | 37 /** |
37 * @override | 38 * @override |
38 * @param {?Workspace.UISourceCode} uiSourceCode | 39 * @param {?Workspace.UISourceCode} uiSourceCode |
39 * @param {number=} lineNumber | 40 * @param {number=} lineNumber |
40 * @param {number=} columnNumber | 41 * @param {number=} columnNumber |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 } | 123 } |
123 | 124 |
124 /** | 125 /** |
125 * @override | 126 * @override |
126 * @return {boolean} | 127 * @return {boolean} |
127 */ | 128 */ |
128 renderAsTwoRows() { | 129 renderAsTwoRows() { |
129 return true; | 130 return true; |
130 } | 131 } |
131 }; | 132 }; |
OLD | NEW |