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

Unified Diff: components/autofill/content/renderer/autofill_agent.cc

Issue 208453002: Add "previewing on hover" support for password field. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Improve rebased code. Created 6 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: components/autofill/content/renderer/autofill_agent.cc
diff --git a/components/autofill/content/renderer/autofill_agent.cc b/components/autofill/content/renderer/autofill_agent.cc
index ca8e10ef7a3bc1384eafd203d351c62ad3610f19..0d8f49a3050cf392522bbedb85c99308d1290f63 100644
--- a/components/autofill/content/renderer/autofill_agent.cc
+++ b/components/autofill/content/renderer/autofill_agent.cc
@@ -162,6 +162,8 @@ bool AutofillAgent::OnMessageReceived(const IPC::Message& message) {
OnAcceptDataListSuggestion)
IPC_MESSAGE_HANDLER(AutofillMsg_AcceptPasswordAutofillSuggestion,
OnAcceptPasswordAutofillSuggestion)
+ IPC_MESSAGE_HANDLER(AutofillMsg_PreviewPasswordAutofillSuggestion,
+ OnPreviewPasswordAutofillSuggestion)
IPC_MESSAGE_HANDLER(AutofillMsg_RequestAutocompleteResult,
OnRequestAutocompleteResult)
IPC_MESSAGE_UNHANDLED(handled = false)
@@ -486,7 +488,10 @@ void AutofillAgent::OnClearPreviewedForm() {
if (password_autofill_agent_->DidClearAutofillSelection(element_))
return;
- ClearPreviewedFormWithElement(element_, was_query_node_autofilled_);
+ ClearPreviewedFormWithElement(
+ element_,
+ was_query_node_autofilled_,
+ password_autofill_agent_->WasPasswordAutofilled());
Ilya Sherman 2014/05/13 00:44:05 This call site should not need to change as a resu
ziran.sun 2014/05/14 15:35:12 Done.
} else {
// TODO(isherman): There seem to be rare cases where this code *is*
// reachable: see [ http://crbug.com/96321#c6 ]. Ideally we would
@@ -523,6 +528,17 @@ void AutofillAgent::OnAcceptPasswordAutofillSuggestion(
DCHECK(handled);
}
+void AutofillAgent::OnPreviewPasswordAutofillSuggestion(
+ const base::string16& username,
+ const base::string16& password) {
+ was_query_node_autofilled_ = element_.isAutofilled();
Ilya Sherman 2014/05/13 00:44:05 This should be tracked internally to the PasswordA
ziran.sun 2014/05/14 15:35:12 Done.
+ bool handled = password_autofill_agent_->SelectSuggestion(
+ element_,
+ username,
+ password);
+ DCHECK(handled);
+}
+
void AutofillAgent::OnRequestAutocompleteResult(
WebFormElement::AutocompleteResult result,
const base::string16& message,

Powered by Google App Engine
This is Rietveld 408576698