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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/context_menu_params_builder.h" 5 #include "content/renderer/context_menu_params_builder.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "content/common/ssl_status_serialization.h" 8 #include "content/common/ssl_status_serialization.h"
9 #include "content/public/common/context_menu_params.h" 9 #include "content/public/common/context_menu_params.h"
10 #include "content/public/renderer/content_renderer_client.h" 10 #include "content/public/renderer/content_renderer_client.h"
11 #include "content/renderer/dom_utils.h" 11 #include "content/renderer/dom_utils.h"
12 #include "content/renderer/history_serialization.h" 12 #include "content/renderer/history_serialization.h"
13 #include "content/renderer/menu_item_builder.h" 13 #include "content/renderer/menu_item_builder.h"
14 #include "third_party/WebKit/public/web/WebElement.h" 14 #include "third_party/WebKit/public/web/WebElement.h"
15 #include "third_party/WebKit/public/web/WebInputElement.h"
15 #include "third_party/WebKit/public/web/WebNode.h" 16 #include "third_party/WebKit/public/web/WebNode.h"
16 17
17 namespace content { 18 namespace content {
18 19
19 // static 20 // static
20 ContextMenuParams ContextMenuParamsBuilder::Build( 21 ContextMenuParams ContextMenuParamsBuilder::Build(
21 const blink::WebContextMenuData& data) { 22 const blink::WebContextMenuData& data) {
22 ContextMenuParams params; 23 ContextMenuParams params;
23 params.media_type = data.mediaType; 24 params.media_type = data.mediaType;
24 params.x = data.mousePosition.x; 25 params.x = data.mousePosition.x;
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 77
77 // Deserialize the SSL info. 78 // Deserialize the SSL info.
78 if (!data.securityInfo.isEmpty()) { 79 if (!data.securityInfo.isEmpty()) {
79 DeserializeSecurityInfo(data.securityInfo, 80 DeserializeSecurityInfo(data.securityInfo,
80 &params.security_info.cert_id, &params.security_info.cert_status, 81 &params.security_info.cert_id, &params.security_info.cert_status,
81 &params.security_info.security_bits, 82 &params.security_info.security_bits,
82 &params.security_info.connection_status, 83 &params.security_info.connection_status,
83 &params.security_info.signed_certificate_timestamp_ids); 84 &params.security_info.signed_certificate_timestamp_ids);
84 } 85 }
85 86
87 // 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
88 params.is_password_field =
89 data.node.isElementNode() &&
90 data.node.toConst<blink::WebElement>().hasHTMLTagName("input") &&
91 data.node.toConst<blink::WebInputElement>().isPasswordField();
92
86 return params; 93 return params;
87 } 94 }
88 95
89 } // namespace content 96 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698