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

Unified Diff: Source/web/ContextMenuClientImpl.cpp

Issue 1128933011: Start passing Title text with the context menu data. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Switch to using Title attribute first Created 5 years, 7 months 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 | public/web/WebContextMenuData.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/ContextMenuClientImpl.cpp
diff --git a/Source/web/ContextMenuClientImpl.cpp b/Source/web/ContextMenuClientImpl.cpp
index d470c88777afbf964dbad004d9d3aa68d4549a52..47256210e4466878931b3c25587c1d21938d0a34 100644
--- a/Source/web/ContextMenuClientImpl.cpp
+++ b/Source/web/ContextMenuClientImpl.cpp
@@ -221,6 +221,15 @@ void ContextMenuClientImpl::showContextMenu(const ContextMenu* defaultMenu)
// all else.
data.linkURL = r.absoluteLinkURL();
+ if (r.innerNode()->isHTMLElement()) {
+ HTMLElement* htmlElement = toHTMLElement(r.innerNode());
+ if (!htmlElement->title().isEmpty()) {
+ data.titleText = htmlElement->title();
+ } else {
+ data.titleText = htmlElement->altText();
+ }
+ }
+
if (isHTMLCanvasElement(r.innerNode())) {
data.mediaType = WebContextMenuData::MediaTypeCanvas;
data.hasImageContents = true;
« no previous file with comments | « no previous file | public/web/WebContextMenuData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698