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

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: Update code as per further review comments. 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 fb58dab42ad8c2c61a6ff867176ec19cedf2a58a..0c8181e68000409d554dc11c78c4319aff418c34 100644
--- a/components/autofill/content/renderer/autofill_agent.cc
+++ b/components/autofill/content/renderer/autofill_agent.cc
@@ -161,8 +161,10 @@ bool AutofillAgent::OnMessageReceived(const IPC::Message& message) {
OnPreviewFieldWithValue)
IPC_MESSAGE_HANDLER(AutofillMsg_AcceptDataListSuggestion,
OnAcceptDataListSuggestion)
- IPC_MESSAGE_HANDLER(AutofillMsg_AcceptPasswordAutofillSuggestion,
- OnAcceptPasswordAutofillSuggestion)
+ IPC_MESSAGE_HANDLER(AutofillMsg_FillPasswordSuggestion,
+ OnFillPasswordSuggestion)
+ IPC_MESSAGE_HANDLER(AutofillMsg_PreviewPasswordSuggestion,
+ OnPreviewPasswordSuggestion)
IPC_MESSAGE_HANDLER(AutofillMsg_RequestAutocompleteResult,
OnRequestAutocompleteResult)
IPC_MESSAGE_UNHANDLED(handled = false)
@@ -494,10 +496,19 @@ void AutofillAgent::OnAcceptDataListSuggestion(const base::string16& value) {
AcceptDataListSuggestion(value);
}
-void AutofillAgent::OnAcceptPasswordAutofillSuggestion(
+void AutofillAgent::OnFillPasswordSuggestion(const base::string16& username,
+ const base::string16& password) {
+ bool handled = password_autofill_agent_->FillSuggestion(
+ element_,
+ username,
+ password);
+ DCHECK(handled);
+}
+
+void AutofillAgent::OnPreviewPasswordSuggestion(
const base::string16& username,
const base::string16& password) {
- bool handled = password_autofill_agent_->AcceptSuggestion(
+ bool handled = password_autofill_agent_->PreviewSuggestion(
element_,
username,
password);
« no previous file with comments | « components/autofill/content/renderer/autofill_agent.h ('k') | components/autofill/content/renderer/password_autofill_agent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698