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

Unified Diff: Source/devtools/front_end/SourcesPanel.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
Index: Source/devtools/front_end/SourcesPanel.js
diff --git a/Source/devtools/front_end/SourcesPanel.js b/Source/devtools/front_end/SourcesPanel.js
index 1300cc229133b4408e2256e72677be547eb72d9e..4abe6c9f526ddd1977b1f1cc044965530c05d32b 100644
--- a/Source/devtools/front_end/SourcesPanel.js
+++ b/Source/devtools/front_end/SourcesPanel.js
@@ -1198,10 +1198,10 @@ WebInspector.SourcesPanel.prototype = {
switch (uiSourceCode.contentType()) {
case WebInspector.resourceTypes.Document:
case WebInspector.resourceTypes.Script:
- WebInspector.JavaScriptOutlineDialog.show(this.visibleView, uiSourceCode);
+ WebInspector.JavaScriptOutlineDialog.show(this.visibleView, uiSourceCode, this.highlightPosition.bind(this));
return true;
case WebInspector.resourceTypes.Stylesheet:
- WebInspector.StyleSheetOutlineDialog.show(this.visibleView, uiSourceCode);
+ WebInspector.StyleSheetOutlineDialog.show(this.visibleView, uiSourceCode, this.highlightPosition.bind(this));
return true;
}
return false;
@@ -1545,6 +1545,22 @@ WebInspector.SourcesPanel.prototype = {
this.sidebarPanes.watchExpressions.expand();
},
+ canHighlightPosition: function()
+ {
+ return this.visibleView && this.visibleView.canHighlightPosition();
+ },
+
+ /**
+ * @param {number} line
+ * @param {number=} column
+ */
+ highlightPosition: function(line, column)
+ {
+ if (!this.canHighlightPosition())
+ return;
+ this.visibleView.highlightPosition(line, column);
+ },
+
/**
* @param {string} id
* @param {WebInspector.SidebarPane} pane
« no previous file with comments | « Source/devtools/front_end/FilteredItemSelectionDialog.js ('k') | Source/devtools/front_end/StyleSheetOutlineDialog.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698