Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / components / password_manager / content / browser / content_password_manager_driver.cc
index 0c0e348..62c20e6 100644 (file)
@@ -27,7 +27,8 @@ ContentPasswordManagerDriver::ContentPasswordManagerDriver(
     : 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);
 }
 
@@ -35,9 +36,11 @@ ContentPasswordManagerDriver::~ContentPasswordManagerDriver() {}
 
 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(
@@ -133,9 +136,6 @@ bool ContentPasswordManagerDriver::OnMessageReceived(
   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)