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

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

Issue 2679483002: DevTools: Create extensible QuickOpen control (Closed)
Patch Set: Created 3 years, 10 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/SourcesView.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/SourcesView.js b/third_party/WebKit/Source/devtools/front_end/sources/SourcesView.js
index 8f39d886e0eac9dcde3761cf3a684657bf9c0547..ec2842d174c8d6e6f037c63b9f8b90149516a904 100644
--- a/third_party/WebKit/Source/devtools/front_end/sources/SourcesView.js
+++ b/third_party/WebKit/Source/devtools/front_end/sources/SourcesView.js
@@ -602,26 +602,12 @@ Sources.SourcesView = class extends UI.VBox {
}
/**
- * @param {string=} query
- */
- showOpenResourceDialog(query) {
- var uiSourceCodes = this._editorContainer.historyUISourceCodes();
- /** @type {!Map.<!Workspace.UISourceCode, number>} */
- var defaultScores = new Map();
- for (var i = 1; i < uiSourceCodes.length; ++i) // Skip current element
- defaultScores.set(uiSourceCodes[i], uiSourceCodes.length - i);
- if (!this._openResourceDialogHistory)
- this._openResourceDialogHistory = [];
- Sources.OpenResourceDialog.show(this, query || '', defaultScores, this._openResourceDialogHistory);
- }
-
- /**
* @param {!Event=} event
* @return {boolean}
*/
_showGoToLineDialog(event) {
pfeldman 2017/02/07 02:10:03 Extract this into an action in its own class (Sour
einbinder 2017/02/28 23:59:07 Would it use flavor(SourcesView) to check if the e
if (this._editorContainer.currentFile())
- this.showOpenResourceDialog(':');
+ QuickOpen.QuickOpen.show(':');
return true;
}
@@ -674,6 +660,21 @@ Sources.SourcesView = class extends UI.VBox {
toggleBreakpointsActiveState(active) {
this._editorContainer.view.element.classList.toggle('breakpoints-deactivated', !active);
}
+
+ /**
+ * @return {!Map.<!Workspace.UISourceCode, number>}
+ */
+ static defaultUISourceCodeScores() {
pfeldman 2017/02/07 02:10:03 Declare static members first
einbinder 2017/02/28 23:59:07 Done.
+ /** @type {!Map.<!Workspace.UISourceCode, number>} */
+ var defaultScores = new Map();
+ var sourcesView = UI.context.flavor(Sources.SourcesView);
pfeldman 2017/02/07 02:10:03 Don't abuse context - all setters and getters of t
einbinder 2017/02/28 23:59:07 A singleton feels weird because it operates on a v
+ if (sourcesView) {
+ var uiSourceCodes = sourcesView._editorContainer.historyUISourceCodes();
+ for (var i = 1; i < uiSourceCodes.length; ++i) // Skip current element
+ defaultScores.set(uiSourceCodes[i], uiSourceCodes.length - i);
+ }
+ return defaultScores;
+ }
};
/** @enum {symbol} */

Powered by Google App Engine
This is Rietveld 408576698