Chromium Code Reviews| 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 def93f407f2058ae1887d4994890a2211c342a27..aa566cc9723766bd5f3e1f557bb4af870e6944c1 100644 |
| --- a/components/autofill/core/browser/password_autofill_manager.cc |
| +++ b/components/autofill/core/browser/password_autofill_manager.cc |
| @@ -2,10 +2,8 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| +#include "components/autofill/core/browser/autofill_driver.h" |
| #include "components/autofill/core/browser/password_autofill_manager.h" |
| -#include "components/autofill/core/common/autofill_messages.h" |
| -#include "content/public/browser/render_view_host.h" |
| -#include "content/public/browser/web_contents.h" |
| #include "ui/events/keycodes/keyboard_codes.h" |
| namespace autofill { |
| @@ -14,7 +12,7 @@ namespace autofill { |
| // PasswordAutofillManager, public: |
| PasswordAutofillManager::PasswordAutofillManager( |
| - content::WebContents* web_contents) : web_contents_(web_contents) { |
| + AutofillDriver* autofill_driver) : autofill_driver_(autofill_driver) { |
|
Ilya Sherman
2013/11/22 00:26:29
nit: Please add DCHECK(autofill_driver) here, sinc
jif-google
2013/11/22 12:21:44
Done.
|
| } |
| PasswordAutofillManager::~PasswordAutofillManager() { |
| @@ -22,19 +20,13 @@ PasswordAutofillManager::~PasswordAutofillManager() { |
| bool PasswordAutofillManager::DidAcceptAutofillSuggestion( |
| const FormFieldData& field, |
| - const base::string16& value) { |
| + const base::string16& username) { |
| PasswordFormFillData password; |
| if (!FindLoginInfo(field, &password)) |
| return false; |
| - if (WillFillUserNameAndPassword(value, password)) { |
| - if (web_contents_) { |
| - content::RenderViewHost* render_view_host = |
| - web_contents_->GetRenderViewHost(); |
| - render_view_host->Send(new AutofillMsg_AcceptPasswordAutofillSuggestion( |
| - render_view_host->GetRoutingID(), |
| - value)); |
| - } |
| + if (WillFillUserNameAndPassword(username, password)) { |
| + autofill_driver_->RendererShouldAcceptPasswordAutofillSuggestion(username); |
| return true; |
| } |