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

Unified Diff: components/password_manager/content/browser/content_password_manager_driver.cc

Issue 1817483002: [Password Manager] Presave the form with generated password till successful login (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed CPMD_BAD_ORIGIN_UPDATE_PRESAVED_PASSWORD in bad_message.h Created 4 years, 8 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/password_manager/content/browser/content_password_manager_driver.cc
diff --git a/components/password_manager/content/browser/content_password_manager_driver.cc b/components/password_manager/content/browser/content_password_manager_driver.cc
index 08bb4d9c6a5a86f93e01b91bfb43292cb9025c63..38129bf2a79faa3c65ba99cb36afa3eae93c6e5b 100644
--- a/components/password_manager/content/browser/content_password_manager_driver.cc
+++ b/components/password_manager/content/browser/content_password_manager_driver.cc
@@ -151,6 +151,8 @@ bool ContentPasswordManagerDriver::HandleMessage(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(AutofillHostMsg_PasswordFormSubmitted,
OnPasswordFormSubmitted)
IPC_MESSAGE_HANDLER(AutofillHostMsg_InPageNavigation, OnInPageNavigation)
+ IPC_MESSAGE_HANDLER(AutofillHostMsg_PresaveGeneratedPassword,
+ OnPresaveGeneratedPassword)
IPC_MESSAGE_HANDLER(AutofillHostMsg_PasswordNoLongerGenerated,
OnPasswordNoLongerGenerated)
IPC_MESSAGE_HANDLER(AutofillHostMsg_FocusedPasswordFormFound,
@@ -231,6 +233,15 @@ void ContentPasswordManagerDriver::OnInPageNavigation(
GetPasswordManager()->OnInPageNavigation(this, password_form);
}
+void ContentPasswordManagerDriver::OnPresaveGeneratedPassword(
+ const autofill::PasswordForm& password_form) {
+ if (!CheckChildProcessSecurityPolicy(
+ password_form.origin,
+ BadMessageReason::CPMD_BAD_ORIGIN_PRESAVE_GENERATED_PASSWORD))
+ return;
+ GetPasswordManager()->OnPresaveGeneratedPassword(password_form);
+}
+
void ContentPasswordManagerDriver::OnPasswordNoLongerGenerated(
const autofill::PasswordForm& password_form) {
if (!CheckChildProcessSecurityPolicy(

Powered by Google App Engine
This is Rietveld 408576698