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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sources/OpenFileQuickOpen.js

Issue 2679483002: DevTools: Create extensible QuickOpen control (Closed)
Patch Set: merge Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/sources/OpenFileQuickOpen.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/OpenResourceDialog.js b/third_party/WebKit/Source/devtools/front_end/sources/OpenFileQuickOpen.js
similarity index 61%
rename from third_party/WebKit/Source/devtools/front_end/sources/OpenResourceDialog.js
rename to third_party/WebKit/Source/devtools/front_end/sources/OpenFileQuickOpen.js
index 3a32f4ed97587b9d31fb49d4c820338eb0f7bf41..0dc5924beda080eba2a369f900e9156e454d41b7 100644
--- a/third_party/WebKit/Source/devtools/front_end/sources/OpenResourceDialog.js
+++ b/third_party/WebKit/Source/devtools/front_end/sources/OpenFileQuickOpen.js
@@ -4,32 +4,13 @@
* found in the LICENSE file.
*/
-/**
- * @unrestricted
- */
-Sources.OpenResourceDialog = class extends Sources.FilteredUISourceCodeListProvider {
- /**
- * @param {!Sources.SourcesView} sourcesView
- * @param {!Map.<!Workspace.UISourceCode, number>} defaultScores
- */
- constructor(sourcesView, defaultScores) {
- super(defaultScores);
- this._sourcesView = sourcesView;
- }
-
+Sources.OpenFileQuickOpen = class extends Sources.FilteredUISourceCodeListProvider {
/**
- * @param {!Sources.SourcesView} sourcesView
- * @param {string} query
- * @param {!Map.<!Workspace.UISourceCode, number>} defaultScores
- * @param {!Array<string>} history
+ * @override
*/
- static show(sourcesView, query, defaultScores, history) {
- var dialog = new Sources.OpenResourceDialog(sourcesView, defaultScores);
- if (InspectorFrontendHost.isUnderTest())
- Sources.OpenResourceDialog._instanceForTest = dialog;
- var filteredItemSelectionDialog = new QuickOpen.FilteredListWidget(dialog, history);
- filteredItemSelectionDialog.showAsDialog();
- filteredItemSelectionDialog.setQuery(query);
+ attach() {
+ this.setDefaultScores(Sources.SourcesView.defaultUISourceCodeScores());
+ super.attach();
}
/**
@@ -42,19 +23,8 @@ Sources.OpenResourceDialog = class extends Sources.FilteredUISourceCodeListProvi
Host.userMetrics.actionTaken(Host.UserMetrics.Action.SelectFileFromFilePicker);
if (!uiSourceCode)
- uiSourceCode = this._sourcesView.currentUISourceCode();
- if (!uiSourceCode)
return;
- this._sourcesView.showSourceLocation(uiSourceCode, lineNumber, columnNumber);
- }
-
- /**
- * @override
- * @param {string} query
- * @return {boolean}
- */
- shouldShowMatchingItems(query) {
- return !query.startsWith(':');
+ Common.Revealer.reveal(uiSourceCode.uiLocation((lineNumber || 0), columnNumber));
}
/**
@@ -75,10 +45,6 @@ Sources.OpenResourceDialog = class extends Sources.FilteredUISourceCodeListProvi
}
};
-
-/**
- * @unrestricted
- */
Sources.SelectUISourceCodeForProjectTypesDialog = class extends Sources.FilteredUISourceCodeListProvider {
/**
* @param {!Array.<string>} types

Powered by Google App Engine
This is Rietveld 408576698