Commit 698c843e authored by gambard's avatar gambard Committed by Commit bot

Add a inner text parameter to ContextMenuParams

This CL adds a parameter to ContextMenuParams, the inner text of a link on
which a context menu is opened.

BUG=591365

Review-Url: https://codereview.chromium.org/2379653002
Cr-Commit-Position: refs/heads/master@{#423814}
parent 66b5e8b3
......@@ -38,6 +38,10 @@ struct ContextMenuParams {
// The location in |view| to present the menu.
CGPoint location;
// The text associated with the link. It is either nil or nonempty (it can not
// be empty).
base::scoped_nsobject<NSString> link_text;
};
} // namespace web
......
......@@ -188,7 +188,8 @@ goog.require('__crWeb.message');
// Found a link.
return {
href: element.href,
referrerPolicy: getReferrerPolicy_(element)
referrerPolicy: getReferrerPolicy_(element),
innerText: element.innerText
};
}
......
......@@ -4290,6 +4290,10 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5;
params.referrer_policy =
web::ReferrerPolicyFromString(base::SysNSStringToUTF8(referrerPolicy));
}
NSString* innerText = element[@"innerText"];
if ([innerText length] > 0) {
params.link_text.reset([innerText copy]);
}
return params;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment