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

Unified Diff: Source/devtools/front_end/ResourcesPanel.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/NetworkPanel.js ('k') | Source/devtools/front_end/SourceFrame.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/ResourcesPanel.js
diff --git a/Source/devtools/front_end/ResourcesPanel.js b/Source/devtools/front_end/ResourcesPanel.js
index 5da417a91d86bbc59fde87099815737731e1abe2..5f3c4bc84a20efbbec9e030ce3dd450a1457ec69 100644
--- a/Source/devtools/front_end/ResourcesPanel.js
+++ b/Source/devtools/front_end/ResourcesPanel.js
@@ -102,14 +102,17 @@ WebInspector.ResourcesPanel = function(database)
this.sidebarElement().addEventListener("mouseout", this._onmouseout.bind(this), false);
/**
- * @return {!WebInspector.View}
* @this {WebInspector.ResourcesPanel}
+ * @return {?WebInspector.SourceFrame}
*/
- function viewGetter()
+ function sourceFrameGetter()
{
- return this.visibleView;
+ var view = this.visibleView;
+ if (view && view instanceof WebInspector.SourceFrame)
+ return /** @type {!WebInspector.SourceFrame} */ (view);
+ return null;
}
- WebInspector.GoToLineDialog.install(this, viewGetter.bind(this));
+ WebInspector.GoToLineDialog.install(this, sourceFrameGetter.bind(this));
if (WebInspector.resourceTreeModel.cachedResourcesLoaded())
this._cachedResourcesLoaded();
@@ -425,9 +428,9 @@ WebInspector.ResourcesPanel.prototype = {
resourceTreeElement.revealAndSelect(true);
if (typeof line === "number") {
- var view = this._resourceViewForResource(resource);
- if (view.canHighlightPosition())
- view.highlightPosition(line, column);
+ var resourceSourceFrame = this._resourceSourceFrameViewForResource(resource);
+ if (resourceSourceFrame)
+ resourceSourceFrame.revealPosition(line, column, true);
}
return true;
},
@@ -442,6 +445,10 @@ WebInspector.ResourcesPanel.prototype = {
this._innerShowView(view);
},
+ /**
+ * @param {!WebInspector.Resource} resource
+ * @return {?WebInspector.View}
+ */
_resourceViewForResource: function(resource)
{
if (WebInspector.ResourceView.hasTextContent(resource)) {
@@ -454,6 +461,18 @@ WebInspector.ResourcesPanel.prototype = {
},
/**
+ * @param {!WebInspector.Resource} resource
+ * @return {?WebInspector.ResourceSourceFrame}
+ */
+ _resourceSourceFrameViewForResource: function(resource)
+ {
+ var resourceView = this._resourceViewForResource(resource);
+ if (resourceView && resourceView instanceof WebInspector.ResourceSourceFrame)
+ return /** @type {!WebInspector.ResourceSourceFrame} */ (resourceView);
+ return null;
+ },
+
+ /**
* @param {!WebInspector.Database} database
* @param {string=} tableName
*/
« no previous file with comments | « Source/devtools/front_end/NetworkPanel.js ('k') | Source/devtools/front_end/SourceFrame.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698