From c9bbc038258ac3e557add14ef9ebc5863fc014c3 Mon Sep 17 00:00:00 2001 From: dglazkov Date: Wed, 8 Jul 2015 10:59:48 -0700 Subject: [PATCH] Make ContextMenuParamsBuilder use the new link text data. a) Remove the code that was trying to do things that should be done on the other side of the WebKit API. b) Start using the newly-plumbed WebContextMenuData member instead. R=jochen,jam BUG=506727 Review URL: https://codereview.chromium.org/1209213010 Cr-Commit-Position: refs/heads/master@{#337857} --- content/renderer/context_menu_params_builder.cc | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/content/renderer/context_menu_params_builder.cc b/content/renderer/context_menu_params_builder.cc index 74211f546753..49670381458b 100644 --- a/content/renderer/context_menu_params_builder.cc +++ b/content/renderer/context_menu_params_builder.cc @@ -4,16 +4,11 @@ #include "content/renderer/context_menu_params_builder.h" -#include "base/logging.h" #include "content/common/ssl_status_serialization.h" #include "content/public/common/context_menu_params.h" #include "content/public/renderer/content_renderer_client.h" -#include "content/renderer/dom_utils.h" #include "content/renderer/history_serialization.h" #include "content/renderer/menu_item_builder.h" -#include "third_party/WebKit/public/web/WebElement.h" -#include "third_party/WebKit/public/web/WebInputElement.h" -#include "third_party/WebKit/public/web/WebNode.h" namespace content { @@ -64,17 +59,7 @@ ContextMenuParams ContextMenuParamsBuilder::Build( SingleHistoryItemToPageState(data.frameHistoryItem); } - if (!params.link_url.is_empty()) { - blink::WebNode selectedNode = DomUtils::ExtractParentAnchorNode(data.node); - blink::WebElement selectedElement = selectedNode.to(); - if (!selectedElement.isNull() && selectedNode.isLink()) { - params.link_text = selectedElement.textContent(); - } else { - LOG(ERROR) << "Creating a ContextMenuParams for a node that has a link" - << "url but is not an ElementNode or does not have an" - << "ancestor that is a link."; - } - } + params.link_text = data.linkText; // Deserialize the SSL info. if (!data.securityInfo.isEmpty()) { -- 2.11.4.GIT