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

Unified Diff: third_party/WebKit/Source/devtools/front_end/components/HandlerRegistry.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
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/components/Linkifier.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/components/HandlerRegistry.js
diff --git a/third_party/WebKit/Source/devtools/front_end/components/HandlerRegistry.js b/third_party/WebKit/Source/devtools/front_end/components/HandlerRegistry.js
index a9a4340d1034dc787a6d2f68f9c8a6876002bce6..1dd3d83936d2a428be47259659a729981d42d92f 100644
--- a/third_party/WebKit/Source/devtools/front_end/components/HandlerRegistry.js
+++ b/third_party/WebKit/Source/devtools/front_end/components/HandlerRegistry.js
@@ -154,53 +154,6 @@ Components.HandlerRegistry = class extends Common.Object {
contextMenu.appendItem(Common.UIString.capitalize('Save ^as...'), save.bind(null, true));
}
}
-
- /**
- * @param {!UI.ContextMenu} contextMenu
- * @param {!Object} target
- */
- _appendHrefItems(contextMenu, target) {
- if (!(target instanceof Node))
- return;
- var targetNode = /** @type {!Node} */ (target);
-
- var anchorElement = targetNode.enclosingNodeOrSelfWithClass('webkit-html-resource-link');
- if (!anchorElement)
- return;
-
- var uiLocation = Components.Linkifier.uiLocationByAnchor(anchorElement);
- var resourceURL = uiLocation ? uiLocation.uiSourceCode.contentURL() : anchorElement.href;
- var uiSourceCode = uiLocation ? uiLocation.uiSourceCode :
- (resourceURL ? Workspace.workspace.uiSourceCodeForURL(resourceURL) : null);
- function open() {
- Common.Revealer.reveal(uiSourceCode);
- }
- if (uiSourceCode)
- contextMenu.appendItem('Open', open);
-
- if (!resourceURL)
- return;
- // Add resource-related actions.
- contextMenu.appendItem(UI.openLinkExternallyLabel(), this._openInNewTab.bind(this, resourceURL));
-
- /**
- * @param {string} resourceURL
- */
- function openInResourcesPanel(resourceURL) {
- var resource = Bindings.resourceForURL(resourceURL);
- if (resource)
- Common.Revealer.reveal(resource);
- else
- InspectorFrontendHost.openInNewTab(resourceURL);
- }
- if (!targetNode.enclosingNodeOrSelfWithClassList(['resources', 'panel']) && Bindings.resourceForURL(resourceURL)) {
- contextMenu.appendItem(
- Common.UIString.capitalize('Open ^link in Application ^panel'), openInResourcesPanel.bind(null, resourceURL));
- }
-
- contextMenu.appendItem(
- UI.copyLinkAddressLabel(), InspectorFrontendHost.copyText.bind(InspectorFrontendHost, resourceURL));
- }
};
/** @enum {symbol} */
@@ -253,7 +206,6 @@ Components.HandlerRegistry.ContextMenuProvider = class {
*/
appendApplicableItems(event, contextMenu, target) {
Components.openAnchorLocationRegistry._appendContentProviderItems(contextMenu, target);
- Components.openAnchorLocationRegistry._appendHrefItems(contextMenu, target);
}
};
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/components/Linkifier.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698