: WebContentsObserver(web_contents),
password_manager_(client),
password_generation_manager_(client),
- password_autofill_manager_(client, autofill_client) {
+ password_autofill_manager_(client, autofill_client),
+ next_free_key_(0) {
DCHECK(web_contents);
}
void ContentPasswordManagerDriver::FillPasswordForm(
const autofill::PasswordFormFillData& form_data) {
+ const int key = next_free_key_++;
+ password_autofill_manager_.OnAddPasswordFormMapping(key, form_data);
DCHECK(web_contents());
web_contents()->GetRenderViewHost()->Send(new AutofillMsg_FillPasswordForm(
- web_contents()->GetRenderViewHost()->GetRoutingID(), form_data));
+ web_contents()->GetRenderViewHost()->GetRoutingID(), key, form_data));
}
void ContentPasswordManagerDriver::AllowPasswordGenerationForForm(
IPC_MESSAGE_FORWARD(AutofillHostMsg_ShowPasswordSuggestions,
&password_autofill_manager_,
PasswordAutofillManager::OnShowPasswordSuggestions)
- IPC_MESSAGE_FORWARD(AutofillHostMsg_AddPasswordFormMapping,
- &password_autofill_manager_,
- PasswordAutofillManager::OnAddPasswordFormMapping)
IPC_MESSAGE_FORWARD(AutofillHostMsg_RecordSavePasswordProgress,
password_manager_.client(),
PasswordManagerClient::LogSavePasswordProgress)