Index: chrome/renderer/autofill/password_autofill_manager.cc |
diff --git a/chrome/renderer/autofill/password_autofill_manager.cc b/chrome/renderer/autofill/password_autofill_manager.cc |
index 2d86597c24d712d3068ee4ab868d1429e084af87..413411ff8e75288381c4a404d1233b6269ec10f2 100644 |
--- a/chrome/renderer/autofill/password_autofill_manager.cc |
+++ b/chrome/renderer/autofill/password_autofill_manager.cc |
@@ -8,7 +8,11 @@ |
#include "base/memory/scoped_ptr.h" |
#include "base/message_loop.h" |
#include "chrome/common/autofill_messages.h" |
+#include "chrome/common/form_field_data.h" |
+#include "chrome/common/password_form_fill_data.h" |
#include "chrome/renderer/autofill/form_autofill_util.h" |
+#include "content/public/common/password_form.h" |
+#include "content/public/renderer/password_form_conversion_utils.h" |
#include "content/public/renderer/render_view.h" |
#include "third_party/WebKit/Source/WebKit/chromium/public/WebAutofillClient.h" |
#include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" |
@@ -20,9 +24,6 @@ |
#include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" |
#include "ui/base/keycodes/keyboard_codes.h" |
-#include "webkit/forms/form_field.h" |
-#include "webkit/forms/password_form.h" |
-#include "webkit/forms/password_form_dom_manager.h" |
namespace { |
@@ -48,7 +49,7 @@ typedef std::vector<FormElements*> FormElementsList; |
// Helper to search the given form element for the specified input elements |
// in |data|, and add results to |result|. |
static bool FindFormInputElements(WebKit::WebFormElement* fe, |
- const webkit::forms::FormData& data, |
+ const FormData& data, |
FormElements* result) { |
// Loop through the list of elements we need to find on the form in order to |
// autofill it. If we don't find any one of them, abort processing this |
@@ -96,7 +97,7 @@ static bool FindFormInputElements(WebKit::WebFormElement* fe, |
// Helper to locate form elements identified by |data|. |
void FindFormElements(WebKit::WebView* view, |
- const webkit::forms::FormData& data, |
+ const FormData& data, |
FormElementsList* results) { |
DCHECK(view); |
DCHECK(results); |
@@ -150,7 +151,7 @@ bool IsElementEditable(const WebKit::WebInputElement& element) { |
return element.isEnabled() && !element.isReadOnly(); |
} |
-void FillForm(FormElements* fe, const webkit::forms::FormData& data) { |
+void FillForm(FormElements* fe, const FormData& data) { |
if (!fe->form_element.autoComplete()) |
return; |
@@ -220,7 +221,7 @@ bool PasswordAutofillManager::TextFieldDidEndEditing( |
if (iter == login_to_password_info_.end()) |
return false; |
- const webkit::forms::PasswordFormFillData& fill_data = |
+ const PasswordFormFillData& fill_data = |
iter->second.fill_data; |
// If wait_for_username is false, we should have filled when the text changed. |
@@ -343,7 +344,7 @@ void PasswordAutofillManager::SendPasswordForms(WebKit::WebFrame* frame, |
WebKit::WebVector<WebKit::WebFormElement> forms; |
frame->document().forms(forms); |
- std::vector<webkit::forms::PasswordForm> password_forms; |
+ std::vector<content::PasswordForm> password_forms; |
for (size_t i = 0; i < forms.size(); ++i) { |
const WebKit::WebFormElement& form = forms[i]; |
@@ -356,8 +357,8 @@ void PasswordAutofillManager::SendPasswordForms(WebKit::WebFrame* frame, |
if (only_visible && !form.hasNonEmptyBoundingBox()) |
continue; |
- scoped_ptr<webkit::forms::PasswordForm> password_form( |
- webkit::forms::PasswordFormDomManager::CreatePasswordForm(form)); |
+ scoped_ptr<content::PasswordForm> password_form( |
+ content::CreatePasswordForm(form)); |
if (password_form.get()) |
password_forms.push_back(*password_form); |
} |
@@ -426,7 +427,7 @@ bool PasswordAutofillManager::InputElementLostFocus() { |
} |
void PasswordAutofillManager::OnFillPasswordForm( |
- const webkit::forms::PasswordFormFillData& form_data, |
+ const PasswordFormFillData& form_data, |
bool disable_popup) { |
disable_popup_ = disable_popup; |
@@ -463,8 +464,8 @@ void PasswordAutofillManager::OnFillPasswordForm( |
password_info.password_field = password_element; |
login_to_password_info_[username_element] = password_info; |
- webkit::forms::FormData form; |
- webkit::forms::FormField field; |
+ FormData form; |
+ FormFieldData field; |
FindFormAndFieldForInputElement( |
username_element, &form, &field, REQUIRE_NONE); |
Send(new AutofillHostMsg_AddPasswordFormMapping( |
@@ -478,13 +479,13 @@ void PasswordAutofillManager::OnFillPasswordForm( |
// PasswordAutofillManager, private: |
void PasswordAutofillManager::GetSuggestions( |
- const webkit::forms::PasswordFormFillData& fill_data, |
+ const PasswordFormFillData& fill_data, |
const string16& input, |
std::vector<string16>* suggestions) { |
if (StartsWith(fill_data.basic_data.fields[0].value, input, false)) |
suggestions->push_back(fill_data.basic_data.fields[0].value); |
- webkit::forms::PasswordFormFillData::LoginCollection::const_iterator iter; |
+ PasswordFormFillData::LoginCollection::const_iterator iter; |
for (iter = fill_data.additional_logins.begin(); |
iter != fill_data.additional_logins.end(); ++iter) { |
if (StartsWith(iter->first, input, false)) |
@@ -493,7 +494,7 @@ void PasswordAutofillManager::GetSuggestions( |
} |
bool PasswordAutofillManager::ShowSuggestionPopup( |
- const webkit::forms::PasswordFormFillData& fill_data, |
+ const PasswordFormFillData& fill_data, |
const WebKit::WebInputElement& user_input) { |
WebKit::WebFrame* frame = user_input.document().frame(); |
if (!frame) |
@@ -507,8 +508,8 @@ bool PasswordAutofillManager::ShowSuggestionPopup( |
GetSuggestions(fill_data, user_input.value(), &suggestions); |
if (disable_popup_) { |
- webkit::forms::FormData form; |
- webkit::forms::FormField field; |
+ FormData form; |
+ FormFieldData field; |
FindFormAndFieldForInputElement( |
user_input, &form, &field, REQUIRE_NONE); |
@@ -539,7 +540,7 @@ bool PasswordAutofillManager::ShowSuggestionPopup( |
bool PasswordAutofillManager::FillUserNameAndPassword( |
WebKit::WebInputElement* username_element, |
WebKit::WebInputElement* password_element, |
- const webkit::forms::PasswordFormFillData& fill_data, |
+ const PasswordFormFillData& fill_data, |
bool exact_username_match, |
bool set_selection) { |
string16 current_username = username_element->value(); |
@@ -554,7 +555,7 @@ bool PasswordAutofillManager::FillUserNameAndPassword( |
password = fill_data.basic_data.fields[1].value; |
} else { |
// Scan additional logins for a match. |
- webkit::forms::PasswordFormFillData::LoginCollection::const_iterator iter; |
+ PasswordFormFillData::LoginCollection::const_iterator iter; |
for (iter = fill_data.additional_logins.begin(); |
iter != fill_data.additional_logins.end(); ++iter) { |
if (DoUsernamesMatch(iter->first, current_username, |
@@ -586,7 +587,7 @@ bool PasswordAutofillManager::FillUserNameAndPassword( |
void PasswordAutofillManager::PerformInlineAutocomplete( |
const WebKit::WebInputElement& username_input, |
const WebKit::WebInputElement& password_input, |
- const webkit::forms::PasswordFormFillData& fill_data) { |
+ const PasswordFormFillData& fill_data) { |
DCHECK(!fill_data.wait_for_username); |
// We need non-const versions of the username and password inputs. |