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

Unified Diff: components/autofill/core/browser/password_autofill_manager.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 Ilya's comment. Created 6 years, 9 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/core/browser/password_autofill_manager.cc
diff --git a/components/autofill/core/browser/password_autofill_manager.cc b/components/autofill/core/browser/password_autofill_manager.cc
index 730c10e49d5d1b2282440dcf3dd406593cd3977b..ccacf24a636870f884d61d4659aad040b5f761d5 100644
--- a/components/autofill/core/browser/password_autofill_manager.cc
+++ b/components/autofill/core/browser/password_autofill_manager.cc
@@ -20,7 +20,7 @@ PasswordAutofillManager::PasswordAutofillManager(
PasswordAutofillManager::~PasswordAutofillManager() {
}
-bool PasswordAutofillManager::DidAcceptAutofillSuggestion(
+bool PasswordAutofillManager::DidSelectSuggestion(
const FormFieldData& field,
const base::string16& username) {
PasswordFormFillData password;
@@ -28,7 +28,22 @@ bool PasswordAutofillManager::DidAcceptAutofillSuggestion(
return false;
if (WillFillUserNameAndPassword(username, password)) {
- autofill_driver_->RendererShouldAcceptPasswordAutofillSuggestion(username);
+ autofill_driver_->RendererShouldPreviewPassword(username);
+ return true;
+ }
+
+ return false;
+ }
+
+bool PasswordAutofillManager::DidAcceptSuggestion(
+ const FormFieldData& field,
+ const base::string16& username) {
+ PasswordFormFillData password;
+ if (!FindLoginInfo(field, &password))
+ return false;
+
+ if (WillFillUserNameAndPassword(username, password)) {
+ autofill_driver_->RendererShouldFillPassword(username);
return true;
}

Powered by Google App Engine
This is Rietveld 408576698