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

Unified Diff: Source/web/ContextMenuClientImpl.cpp

Issue 1137733004: Add an "input field type" entry to WebContextMenuData. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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 c0047ec9b457de7ff8ad39f145d835ed555adf01..96e43db764e362535df8d571a9ff8f59a0594388 100644
--- a/Source/web/ContextMenuClientImpl.cpp
+++ b/Source/web/ContextMenuClientImpl.cpp
@@ -395,6 +395,19 @@ void ContextMenuClientImpl::showContextMenu(const ContextMenu* defaultMenu)
data.referrerPolicy = WebReferrerPolicyNever;
}
+ // Find the input field type.
+ if (isHTMLInputElement(r.innerNode())) {
+ HTMLInputElement* element = toHTMLInputElement(r.innerNode());
+ if (element->type() == InputTypeNames::password)
Mike West 2015/05/19 12:58:35 Should we also take the `autocomplete` attribute i
msramek 2015/05/19 15:42:44 I thought about it a bit, and I would say that not
+ data.inputFieldType = WebContextMenuData::InputFieldTypePassword;
+ else if (element->isTextField())
+ data.inputFieldType = WebContextMenuData::InputFieldTypePlainText;
+ else
+ data.inputFieldType = WebContextMenuData::InputFieldTypeOther;
+ } else {
+ data.inputFieldType = WebContextMenuData::InputFieldTypeNone;
+ }
+
data.node = r.innerNodeOrImageMapImage();
WebLocalFrameImpl* selectedWebFrame = WebLocalFrameImpl::fromFrame(selectedFrame);
« 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