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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sources/OpenResourceDialog.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/OpenResourceDialog.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/OpenResourceDialog.js b/third_party/WebKit/Source/devtools/front_end/sources/OpenResourceDialog.js
deleted file mode 100644
index 3a32f4ed97587b9d31fb49d4c820338eb0f7bf41..0000000000000000000000000000000000000000
--- a/third_party/WebKit/Source/devtools/front_end/sources/OpenResourceDialog.js
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Copyright (c) 2012 The Chromium Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * 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;
- }
-
- /**
- * @param {!Sources.SourcesView} sourcesView
- * @param {string} query
- * @param {!Map.<!Workspace.UISourceCode, number>} defaultScores
- * @param {!Array<string>} history
- */
- 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);
- }
-
- /**
- * @override
- * @param {?Workspace.UISourceCode} uiSourceCode
- * @param {number=} lineNumber
- * @param {number=} columnNumber
- */
- uiSourceCodeSelected(uiSourceCode, lineNumber, columnNumber) {
- 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(':');
- }
-
- /**
- * @override
- * @param {!Workspace.Project} project
- * @return {boolean}
- */
- filterProject(project) {
- return !project.isServiceProject();
- }
-
- /**
- * @override
- * @return {boolean}
- */
- renderAsTwoRows() {
- return true;
- }
-};
-
-
-/**
- * @unrestricted
- */
-Sources.SelectUISourceCodeForProjectTypesDialog = class extends Sources.FilteredUISourceCodeListProvider {
- /**
- * @param {!Array.<string>} types
- * @param {function(?Workspace.UISourceCode)} callback
- */
- constructor(types, callback) {
- super();
- this._types = types;
- this._callback = callback;
- }
-
- /**
- * @param {string} name
- * @param {!Array.<string>} types
- * @param {function(?Workspace.UISourceCode)} callback
- */
- static show(name, types, callback) {
- var filteredItemSelectionDialog =
- new QuickOpen.FilteredListWidget(new Sources.SelectUISourceCodeForProjectTypesDialog(types, callback));
- filteredItemSelectionDialog.showAsDialog();
- filteredItemSelectionDialog.setQuery(name);
- }
-
- /**
- * @override
- * @param {?Workspace.UISourceCode} uiSourceCode
- * @param {number=} lineNumber
- * @param {number=} columnNumber
- */
- uiSourceCodeSelected(uiSourceCode, lineNumber, columnNumber) {
- this._callback(uiSourceCode);
- }
-
- /**
- * @override
- * @param {!Workspace.Project} project
- * @return {boolean}
- */
- filterProject(project) {
- return this._types.indexOf(project.type()) !== -1;
- }
-
- /**
- * @override
- * @return {boolean}
- */
- renderAsTwoRows() {
- return true;
- }
-};

Powered by Google App Engine
This is Rietveld 408576698