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

Unified Diff: third_party/WebKit/Source/devtools/front_end/main/Main.js

Issue 2500233002: DevTools: move revealSourceLine handler from Networkmapping to Main (Closed)
Patch Set: rebaseline Created 4 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 | « third_party/WebKit/Source/devtools/front_end/bindings/NetworkMapping.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/main/Main.js
diff --git a/third_party/WebKit/Source/devtools/front_end/main/Main.js b/third_party/WebKit/Source/devtools/front_end/main/Main.js
index b0fcf5d4e0e9630d664c82a89be59c6c5e9710e6..502d60b35e6ce148b47b4e53239cfe4a2685909e 100644
--- a/third_party/WebKit/Source/devtools/front_end/main/Main.js
+++ b/third_party/WebKit/Source/devtools/front_end/main/Main.js
@@ -250,6 +250,9 @@ Main.Main = class {
InspectorFrontendHostAPI.Events.EnterInspectElementMode,
toggleSearchNodeAction.execute.bind(toggleSearchNodeAction), this);
}
+ InspectorFrontendHost.events.addEventListener(
+ InspectorFrontendHostAPI.Events.RevealSourceLine, this._revealSourceLine, this);
+
UI.inspectorView.createToolbars();
InspectorFrontendHost.loadCompleted();
@@ -318,6 +321,34 @@ Main.Main = class {
}
}
+ /**
+ * @param {!Common.Event} event
+ */
+ _revealSourceLine(event) {
+ var url = /** @type {string} */ (event.data['url']);
+ var lineNumber = /** @type {number} */ (event.data['lineNumber']);
+ var columnNumber = /** @type {number} */ (event.data['columnNumber']);
+
+ var uiSourceCode = Workspace.workspace.uiSourceCodeForURL(url);
+ if (uiSourceCode) {
+ Common.Revealer.reveal(uiSourceCode.uiLocation(lineNumber, columnNumber));
+ return;
+ }
+
+ /**
+ * @param {!Common.Event} event
+ */
+ function listener(event) {
+ var uiSourceCode = /** @type {!Workspace.UISourceCode} */ (event.data);
+ if (uiSourceCode.url() === url) {
+ Common.Revealer.reveal(uiSourceCode.uiLocation(lineNumber, columnNumber));
+ Workspace.workspace.removeEventListener(Workspace.Workspace.Events.UISourceCodeAdded, listener);
+ }
+ }
+
+ Workspace.workspace.addEventListener(Workspace.Workspace.Events.UISourceCodeAdded, listener);
+ }
+
_documentClick(event) {
var target = event.target;
if (target.shadowRoot)
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/bindings/NetworkMapping.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698