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

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

Issue 2510193003: [DevTools] Move link click and context menu handling to Linkifier. (Closed)
Patch Set: fixed comments 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
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 261dddbc9433ed6dd9053c57667336e6d13947b7..d246a1029ce5818e037c36392133eb6ea1f37d70 100644
--- a/third_party/WebKit/Source/devtools/front_end/main/Main.js
+++ b/third_party/WebKit/Source/devtools/front_end/main/Main.js
@@ -348,52 +348,6 @@ Main.Main = class {
Workspace.workspace.addEventListener(Workspace.Workspace.Events.UISourceCodeAdded, listener);
}
- _documentClick(event) {
- var target = event.target;
- if (target.shadowRoot)
- target = event.deepElementFromPoint();
- if (!target)
- return;
-
- var anchor = target.enclosingNodeOrSelfWithNodeName('a');
- if (!anchor || !anchor.href)
- return;
-
- // Prevent the link from navigating, since we don't do any navigation by following links normally.
- event.consume(true);
-
- if (anchor.preventFollow)
- return;
-
- function followLink() {
- if (UI.isBeingEdited(target))
- return;
- if (Components.openAnchorLocationRegistry.dispatch({url: anchor.href, lineNumber: anchor.lineNumber}))
- return;
-
- var uiSourceCode = Workspace.workspace.uiSourceCodeForURL(anchor.href);
- if (uiSourceCode) {
- Common.Revealer.reveal(uiSourceCode.uiLocation(anchor.lineNumber || 0, anchor.columnNumber || 0));
- return;
- }
-
- var resource = Bindings.resourceForURL(anchor.href);
- if (resource) {
- Common.Revealer.reveal(resource);
- return;
- }
-
- var request = SDK.NetworkLog.requestForURL(anchor.href);
- if (request) {
- Common.Revealer.reveal(request);
- return;
- }
- InspectorFrontendHost.openInNewTab(anchor.href);
- }
-
- followLink();
- }
-
_registerShortcuts() {
var shortcut = UI.KeyboardShortcut;
var section = Components.shortcutsScreen.section(Common.UIString('All Panels'));
@@ -497,7 +451,6 @@ Main.Main = class {
document.addEventListener('cut', this._redispatchClipboardEvent.bind(this), false);
document.addEventListener('paste', this._redispatchClipboardEvent.bind(this), false);
document.addEventListener('contextmenu', this._contextMenuEventFired.bind(this), true);
- document.addEventListener('click', this._documentClick.bind(this), false);
}
/**

Powered by Google App Engine
This is Rietveld 408576698