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 |
index feb5fdc0c6ef356ae1066be1d96ac1e651ab80d8..47394db82df4222b24c447aa21c8d55eee113f17 100644 |
--- a/third_party/WebKit/Source/devtools/front_end/sources/OpenResourceDialog.js |
+++ b/third_party/WebKit/Source/devtools/front_end/sources/OpenResourceDialog.js |
@@ -3,140 +3,131 @@ |
* Use of this source code is governed by a BSD-style license that can be |
* found in the LICENSE file. |
*/ |
- |
/** |
- * @constructor |
- * @extends {WebInspector.FilteredUISourceCodeListDelegate} |
- * @param {!WebInspector.SourcesView} sourcesView |
- * @param {!Map.<!WebInspector.UISourceCode, number>} defaultScores |
- * @param {!Array<string>} history |
+ * @unrestricted |
*/ |
-WebInspector.OpenResourceDialog = function(sourcesView, defaultScores, history) |
-{ |
- WebInspector.FilteredUISourceCodeListDelegate.call(this, defaultScores, history); |
+WebInspector.OpenResourceDialog = class extends WebInspector.FilteredUISourceCodeListDelegate { |
+ /** |
+ * @param {!WebInspector.SourcesView} sourcesView |
+ * @param {!Map.<!WebInspector.UISourceCode, number>} defaultScores |
+ * @param {!Array<string>} history |
+ */ |
+ constructor(sourcesView, defaultScores, history) { |
+ super(defaultScores, history); |
this._sourcesView = sourcesView; |
this.populate(); |
-}; |
- |
-WebInspector.OpenResourceDialog.prototype = { |
+ } |
- /** |
- * @override |
- * @param {?WebInspector.UISourceCode} uiSourceCode |
- * @param {number=} lineNumber |
- * @param {number=} columnNumber |
- */ |
- uiSourceCodeSelected: function(uiSourceCode, lineNumber, columnNumber) |
- { |
- if (!uiSourceCode) |
- uiSourceCode = this._sourcesView.currentUISourceCode(); |
- if (!uiSourceCode) |
- return; |
- this._sourcesView.showSourceLocation(uiSourceCode, lineNumber, columnNumber); |
- }, |
+ /** |
+ * @param {!WebInspector.SourcesView} sourcesView |
+ * @param {string} query |
+ * @param {!Map.<!WebInspector.UISourceCode, number>} defaultScores |
+ * @param {!Array<string>} history |
+ */ |
+ static show(sourcesView, query, defaultScores, history) { |
+ WebInspector.OpenResourceDialog._instanceForTest = |
+ new WebInspector.OpenResourceDialog(sourcesView, defaultScores, history); |
+ var filteredItemSelectionDialog = |
+ new WebInspector.FilteredListWidget(WebInspector.OpenResourceDialog._instanceForTest); |
+ filteredItemSelectionDialog.showAsDialog(); |
+ filteredItemSelectionDialog.setQuery(query); |
+ } |
- /** |
- * @override |
- * @param {string} query |
- * @return {boolean} |
- */ |
- shouldShowMatchingItems: function(query) |
- { |
- return !query.startsWith(":"); |
- }, |
+ /** |
+ * @override |
+ * @param {?WebInspector.UISourceCode} uiSourceCode |
+ * @param {number=} lineNumber |
+ * @param {number=} columnNumber |
+ */ |
+ uiSourceCodeSelected(uiSourceCode, lineNumber, columnNumber) { |
+ if (!uiSourceCode) |
+ uiSourceCode = this._sourcesView.currentUISourceCode(); |
+ if (!uiSourceCode) |
+ return; |
+ this._sourcesView.showSourceLocation(uiSourceCode, lineNumber, columnNumber); |
+ } |
- /** |
- * @override |
- * @param {!WebInspector.Project} project |
- * @return {boolean} |
- */ |
- filterProject: function(project) |
- { |
- return !WebInspector.Project.isServiceProject(project); |
- }, |
+ /** |
+ * @override |
+ * @param {string} query |
+ * @return {boolean} |
+ */ |
+ shouldShowMatchingItems(query) { |
+ return !query.startsWith(':'); |
+ } |
- /** |
- * @override |
- * @return {boolean} |
- */ |
- renderAsTwoRows: function() |
- { |
- return true; |
- }, |
+ /** |
+ * @override |
+ * @param {!WebInspector.Project} project |
+ * @return {boolean} |
+ */ |
+ filterProject(project) { |
+ return !WebInspector.Project.isServiceProject(project); |
+ } |
- __proto__: WebInspector.FilteredUISourceCodeListDelegate.prototype |
+ /** |
+ * @override |
+ * @return {boolean} |
+ */ |
+ renderAsTwoRows() { |
+ return true; |
+ } |
}; |
-/** |
- * @param {!WebInspector.SourcesView} sourcesView |
- * @param {string} query |
- * @param {!Map.<!WebInspector.UISourceCode, number>} defaultScores |
- * @param {!Array<string>} history |
- */ |
-WebInspector.OpenResourceDialog.show = function(sourcesView, query, defaultScores, history) |
-{ |
- WebInspector.OpenResourceDialog._instanceForTest = new WebInspector.OpenResourceDialog(sourcesView, defaultScores, history); |
- var filteredItemSelectionDialog = new WebInspector.FilteredListWidget(WebInspector.OpenResourceDialog._instanceForTest); |
- filteredItemSelectionDialog.showAsDialog(); |
- filteredItemSelectionDialog.setQuery(query); |
-}; |
/** |
- * @constructor |
- * @extends {WebInspector.FilteredUISourceCodeListDelegate} |
- * @param {!Array.<string>} types |
- * @param {function(?WebInspector.UISourceCode)} callback |
+ * @unrestricted |
*/ |
-WebInspector.SelectUISourceCodeForProjectTypesDialog = function(types, callback) |
-{ |
- WebInspector.FilteredUISourceCodeListDelegate.call(this); |
+WebInspector.SelectUISourceCodeForProjectTypesDialog = class extends WebInspector.FilteredUISourceCodeListDelegate { |
+ /** |
+ * @param {!Array.<string>} types |
+ * @param {function(?WebInspector.UISourceCode)} callback |
+ */ |
+ constructor(types, callback) { |
+ super(); |
this._types = types; |
this._callback = callback; |
this.populate(); |
-}; |
+ } |
-WebInspector.SelectUISourceCodeForProjectTypesDialog.prototype = { |
- /** |
- * @override |
- * @param {?WebInspector.UISourceCode} uiSourceCode |
- * @param {number=} lineNumber |
- * @param {number=} columnNumber |
- */ |
- uiSourceCodeSelected: function(uiSourceCode, lineNumber, columnNumber) |
- { |
- this._callback(uiSourceCode); |
- }, |
+ /** |
+ * @param {string} name |
+ * @param {!Array.<string>} types |
+ * @param {function(?WebInspector.UISourceCode)} callback |
+ */ |
+ static show(name, types, callback) { |
+ var filteredItemSelectionDialog = |
+ new WebInspector.FilteredListWidget(new WebInspector.SelectUISourceCodeForProjectTypesDialog(types, callback)); |
+ filteredItemSelectionDialog.showAsDialog(); |
+ filteredItemSelectionDialog.setQuery(name); |
+ } |
- /** |
- * @override |
- * @param {!WebInspector.Project} project |
- * @return {boolean} |
- */ |
- filterProject: function(project) |
- { |
- return this._types.indexOf(project.type()) !== -1; |
- }, |
+ /** |
+ * @override |
+ * @param {?WebInspector.UISourceCode} uiSourceCode |
+ * @param {number=} lineNumber |
+ * @param {number=} columnNumber |
+ */ |
+ uiSourceCodeSelected(uiSourceCode, lineNumber, columnNumber) { |
+ this._callback(uiSourceCode); |
+ } |
- /** |
- * @override |
- * @return {boolean} |
- */ |
- renderAsTwoRows: function() |
- { |
- return true; |
- }, |
+ /** |
+ * @override |
+ * @param {!WebInspector.Project} project |
+ * @return {boolean} |
+ */ |
+ filterProject(project) { |
+ return this._types.indexOf(project.type()) !== -1; |
+ } |
- __proto__: WebInspector.FilteredUISourceCodeListDelegate.prototype |
+ /** |
+ * @override |
+ * @return {boolean} |
+ */ |
+ renderAsTwoRows() { |
+ return true; |
+ } |
}; |
-/** |
- * @param {string} name |
- * @param {!Array.<string>} types |
- * @param {function(?WebInspector.UISourceCode)} callback |
- */ |
-WebInspector.SelectUISourceCodeForProjectTypesDialog.show = function(name, types, callback) |
-{ |
- var filteredItemSelectionDialog = new WebInspector.FilteredListWidget(new WebInspector.SelectUISourceCodeForProjectTypesDialog(types, callback)); |
- filteredItemSelectionDialog.showAsDialog(); |
- filteredItemSelectionDialog.setQuery(name); |
-}; |
+ |