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

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

Issue 77283005: DevTools: refactor outline dialogs to run callback on item selection (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 1 month 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 | « no previous file | Source/devtools/front_end/SourcesPanel.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/FilteredItemSelectionDialog.js
diff --git a/Source/devtools/front_end/FilteredItemSelectionDialog.js b/Source/devtools/front_end/FilteredItemSelectionDialog.js
index 512126a9202ce54838c7af69c82fa0b495827e28..76693e6157a876fd814c756bca92e10f860591f4 100644
--- a/Source/devtools/front_end/FilteredItemSelectionDialog.js
+++ b/Source/devtools/front_end/FilteredItemSelectionDialog.js
@@ -483,25 +483,28 @@ WebInspector.SelectionDialogContentProvider.prototype = {
* @extends {WebInspector.SelectionDialogContentProvider}
* @param {WebInspector.View} view
* @param {WebInspector.ContentProvider} contentProvider
+ * @param {function(number, number)} selectItemCallback
*/
-WebInspector.JavaScriptOutlineDialog = function(view, contentProvider)
+WebInspector.JavaScriptOutlineDialog = function(view, contentProvider, selectItemCallback)
{
WebInspector.SelectionDialogContentProvider.call(this);
this._functionItems = [];
this._view = view;
+ this._selectItemCallback = selectItemCallback;
contentProvider.requestContent(this._contentAvailable.bind(this));
}
/**
* @param {WebInspector.View} view
* @param {WebInspector.ContentProvider} contentProvider
+ * @param {function(number, number)} selectItemCallback
*/
-WebInspector.JavaScriptOutlineDialog.show = function(view, contentProvider)
+WebInspector.JavaScriptOutlineDialog.show = function(view, contentProvider, selectItemCallback)
{
if (WebInspector.Dialog.currentInstance())
return null;
- var filteredItemSelectionDialog = new WebInspector.FilteredItemSelectionDialog(new WebInspector.JavaScriptOutlineDialog(view, contentProvider));
+ var filteredItemSelectionDialog = new WebInspector.FilteredItemSelectionDialog(new WebInspector.JavaScriptOutlineDialog(view, contentProvider, selectItemCallback));
WebInspector.Dialog.show(view.element, filteredItemSelectionDialog);
}
@@ -580,8 +583,7 @@ WebInspector.JavaScriptOutlineDialog.prototype = {
{
var lineNumber = this._functionItems[itemIndex].line;
if (!isNaN(lineNumber) && lineNumber >= 0)
- this._view.highlightPosition(lineNumber, this._functionItems[itemIndex].column);
- this._view.focus();
+ this._selectItemCallback(lineNumber, this._functionItems[itemIndex].column);
},
dispose: function()
« no previous file with comments | « no previous file | Source/devtools/front_end/SourcesPanel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698