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

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

Issue 203603006: DevTools: Make GoToLineDialog work based on sourceFrame and remove (can)highlightPosition methods f… (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/Dialog.js ('k') | Source/devtools/front_end/NetworkItemView.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/GoToLineDialog.js
diff --git a/Source/devtools/front_end/GoToLineDialog.js b/Source/devtools/front_end/GoToLineDialog.js
index ff0b7a76657dc5d0b43dba9df2c30293ef92ab93..33052dc78689e1035beb6dbb717890cc97b0cd62 100644
--- a/Source/devtools/front_end/GoToLineDialog.js
+++ b/Source/devtools/front_end/GoToLineDialog.js
@@ -31,8 +31,9 @@
/**
* @constructor
* @extends {WebInspector.DialogDelegate}
+ * @param {!WebInspector.SourceFrame} sourceFrame
*/
-WebInspector.GoToLineDialog = function(view)
+WebInspector.GoToLineDialog = function(sourceFrame)
{
WebInspector.DialogDelegate.call(this);
@@ -49,30 +50,30 @@ WebInspector.GoToLineDialog = function(view)
this._goButton.textContent = WebInspector.UIString("Go");
this._goButton.addEventListener("click", this._onGoClick.bind(this), false);
- this._view = view;
+ this._sourceFrame = sourceFrame;
}
/**
* @param {!WebInspector.Panel} panel
- * @param {function():?WebInspector.View} viewGetter
+ * @param {function():?WebInspector.SourceFrame} sourceFrameGetter
*/
-WebInspector.GoToLineDialog.install = function(panel, viewGetter)
+WebInspector.GoToLineDialog.install = function(panel, sourceFrameGetter)
{
var goToLineShortcut = WebInspector.GoToLineDialog.createShortcut();
- panel.registerShortcuts([goToLineShortcut], WebInspector.GoToLineDialog._show.bind(null, viewGetter));
+ panel.registerShortcuts([goToLineShortcut], WebInspector.GoToLineDialog._show.bind(null, sourceFrameGetter));
}
/**
- * @param {function():?WebInspector.View} viewGetter
+ * @param {function():?WebInspector.SourceFrame} sourceFrameGetter
* @param {?Event=} event
* @return {boolean}
*/
-WebInspector.GoToLineDialog._show = function(viewGetter, event)
+WebInspector.GoToLineDialog._show = function(sourceFrameGetter, event)
{
- var sourceView = viewGetter();
- if (!sourceView || !sourceView.canHighlightPosition())
+ var sourceFrame = sourceFrameGetter();
+ if (!sourceFrame)
return false;
- WebInspector.Dialog.show(sourceView.element, new WebInspector.GoToLineDialog(sourceView));
+ WebInspector.Dialog.show(sourceFrame.element, new WebInspector.GoToLineDialog(sourceFrame));
return true;
}
@@ -102,7 +103,7 @@ WebInspector.GoToLineDialog.prototype = {
var value = this._input.value;
var lineNumber = parseInt(value, 10) - 1;
if (!isNaN(lineNumber) && lineNumber >= 0)
- this._view.highlightPosition(lineNumber);
+ this._sourceFrame.revealPosition(lineNumber, 0, true);
},
onEnter: function()
« no previous file with comments | « Source/devtools/front_end/Dialog.js ('k') | Source/devtools/front_end/NetworkItemView.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698