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

Unified Diff: content/renderer/context_menu_params_builder.cc

Issue 1142923002: Add a "Save password" item to the context menu. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.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
Index: content/renderer/context_menu_params_builder.cc
diff --git a/content/renderer/context_menu_params_builder.cc b/content/renderer/context_menu_params_builder.cc
index 1e4df2e7a4667cf934cdc5c3f481af7ca2757115..18e141c73ae2d334d6cbef9bc004dc368cedd50f 100644
--- a/content/renderer/context_menu_params_builder.cc
+++ b/content/renderer/context_menu_params_builder.cc
@@ -12,6 +12,7 @@
#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 {
@@ -83,6 +84,12 @@ ContextMenuParams ContextMenuParamsBuilder::Build(
&params.security_info.signed_certificate_timestamp_ids);
}
+ // Find out if this node is a password field.
msramek 2015/05/19 09:42:08 Is it OK to add a field to ContextMenuParams that
Mike West 2015/05/19 10:11:22 I'd suggest adding the logic to Blink first (you'l
msramek 2015/05/19 12:39:48 Done in https://codereview.chromium.org/1137733004
+ params.is_password_field =
+ data.node.isElementNode() &&
+ data.node.toConst<blink::WebElement>().hasHTMLTagName("input") &&
+ data.node.toConst<blink::WebInputElement>().isPasswordField();
+
return params;
}

Powered by Google App Engine
This is Rietveld 408576698