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

Unified Diff: Source/devtools/front_end/SourcesPanel.js

Issue 202043002: DevTools: Use open resource dialog for go to line feature in sources panel. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebaselined Created 6 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
« no previous file with comments | « Source/devtools/front_end/ShortcutsScreen.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/SourcesPanel.js
diff --git a/Source/devtools/front_end/SourcesPanel.js b/Source/devtools/front_end/SourcesPanel.js
index 772386671b0a7699597f1c208509b09c373577f9..fba5ba6ace557ea3e3e42ff271ded6f986f5b501 100644
--- a/Source/devtools/front_end/SourcesPanel.js
+++ b/Source/devtools/front_end/SourcesPanel.js
@@ -66,16 +66,6 @@ WebInspector.SourcesPanel = function(workspaceForTest)
this._workspace = workspaceForTest || WebInspector.workspace;
- /**
- * @return {!WebInspector.View}
- * @this {WebInspector.SourcesPanel}
- */
- function viewGetter()
- {
- return this;
- }
- WebInspector.GoToLineDialog.install(this, viewGetter.bind(this));
-
var helpSection = WebInspector.shortcutsScreen.section(WebInspector.UIString("Sources Panel"));
this.debugToolbar = this._createDebugToolbar();
this._debugToolbarDrawer = this._createDebugToolbarDrawer();
@@ -149,6 +139,7 @@ WebInspector.SourcesPanel = function(workspaceForTest)
this.registerShortcuts(WebInspector.ShortcutsScreen.SourcesPanelShortcuts.CloseEditorTab, this._onCloseEditorTab.bind(this));
this.sidebarPanes.callstack.registerShortcuts(this.registerShortcuts.bind(this));
+ this.registerShortcuts(WebInspector.ShortcutsScreen.SourcesPanelShortcuts.GoToLine, this._showGoToLineDialog.bind(this));
this.registerShortcuts(WebInspector.ShortcutsScreen.SourcesPanelShortcuts.GoToMember, this._showOutlineDialog.bind(this));
this.registerShortcuts(WebInspector.ShortcutsScreen.SourcesPanelShortcuts.ToggleBreakpoint, this._toggleBreakpoint.bind(this));
@@ -1242,10 +1233,10 @@ WebInspector.SourcesPanel.prototype = {
switch (uiSourceCode.contentType()) {
case WebInspector.resourceTypes.Document:
case WebInspector.resourceTypes.Script:
- WebInspector.JavaScriptOutlineDialog.show(this.visibleView, uiSourceCode, this.highlightPosition.bind(this));
+ WebInspector.JavaScriptOutlineDialog.show(this.visibleView, uiSourceCode, this.showUISourceCode.bind(this, uiSourceCode));
return true;
case WebInspector.resourceTypes.Stylesheet:
- WebInspector.StyleSheetOutlineDialog.show(this.visibleView, uiSourceCode, this.highlightPosition.bind(this));
+ WebInspector.StyleSheetOutlineDialog.show(this.visibleView, uiSourceCode, this.showUISourceCode.bind(this, uiSourceCode));
return true;
}
return false;
@@ -1438,14 +1429,32 @@ WebInspector.SourcesPanel.prototype = {
contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Show function definition" : "Show Function Definition"), revealFunction.bind(this));
},
- showGoToSourceDialog: function()
+ /**
+ * @param {string=} query
+ */
+ _showOpenResourceDialog: function(query)
{
var uiSourceCodes = this._editorContainer.historyUISourceCodes();
/** @type {!Map.<!WebInspector.UISourceCode, number>} */
var defaultScores = new Map();
for (var i = 1; i < uiSourceCodes.length; ++i) // Skip current element
defaultScores.put(uiSourceCodes[i], uiSourceCodes.length - i);
- WebInspector.OpenResourceDialog.show(this, this.editorView.mainElement(), undefined, defaultScores);
+ WebInspector.OpenResourceDialog.show(this, this.editorView.mainElement(), query, defaultScores);
+ },
+
+ /**
+ * @param {?Event=} event
+ * @return {boolean}
+ */
+ _showGoToLineDialog: function(event)
+ {
+ this._showOpenResourceDialog(":");
+ return true;
+ },
+
+ showGoToSourceDialog: function()
+ {
+ this._showOpenResourceDialog();
},
_dockSideChanged: function()
@@ -1524,28 +1533,6 @@ WebInspector.SourcesPanel.prototype = {
},
/**
- * @return {boolean}
- */
- canHighlightPosition: function()
- {
- return !!this.currentSourceFrame();
- },
-
- /**
- * @param {number} line
- * @param {number=} column
- */
- highlightPosition: function(line, column)
- {
- var sourceFrame = this.currentSourceFrame();
- if (!sourceFrame)
- return;
- this._historyManager.updateCurrentState();
- sourceFrame.highlightPosition(line, column);
- this._historyManager.pushNewState();
- },
-
- /**
* @param {string} id
* @param {!WebInspector.SidebarPane} pane
*/
« no previous file with comments | « Source/devtools/front_end/ShortcutsScreen.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698