diff options
author | blundell@chromium.org <blundell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-05 01:29:14 +0000 |
---|---|---|
committer | blundell@chromium.org <blundell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-05 01:29:14 +0000 |
commit | 1ecbe866c38fb6c781d337393b7ff62d0c662f4e (patch) | |
tree | 37ddf68241e68df9035f2c612388369f1539fe4d /chrome/browser | |
parent | 456cface8888f0e39742243f25295d55c8922744 (diff) | |
download | chromium_src-1ecbe866c38fb6c781d337393b7ff62d0c662f4e.zip chromium_src-1ecbe866c38fb6c781d337393b7ff62d0c662f4e.tar.gz chromium_src-1ecbe866c38fb6c781d337393b7ff62d0c662f4e.tar.bz2 |
Move forms/ out of webkit/.
The motivation for this CL is to move PasswordForm and friends (which are totally unrelated to WebKit) out of webkit/ and into a target that platforms that do not use WebKit (such as iOS) can logically depend on.
As such, this CL does three things:
1. Separates the WebKit-related code in webkit/forms from the
non-WebKit-related code. Concretely, this means having the WebKit::WebFormElement->PasswordForm conversion function in its own file.
2. Moves the core, non-WebKit-related forms code to chrome/common and content/public/common depending on where its usage points are.
3. Moves the above-mentioned conversion function to content/public/renderer. It cannot stay in webkit/ as it (now) has a dependency on content/, and as it is used only in chrome/renderer and content/renderer, this is a good place for it.
The rest of this CL is churn due to namespace, file location, and GYP target changes.
BUG=
Review URL: https://chromiumcodereview.appspot.com/11000016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@160280 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
141 files changed, 699 insertions, 796 deletions
diff --git a/chrome/browser/DEPS b/chrome/browser/DEPS index b57c3f5..a680115 100644 --- a/chrome/browser/DEPS +++ b/chrome/browser/DEPS @@ -37,7 +37,6 @@ include_rules = [ "+webkit/database", "+webkit/dom_storage", "+webkit/fileapi", - "+webkit/forms", # Defines some types that are marshalled over IPC. "+webkit/plugins", # Defines some types that are marshalled over IPC. "+webkit/quota", "+webkit/user_agent", diff --git a/chrome/browser/api/webdata/autofill_web_data.h b/chrome/browser/api/webdata/autofill_web_data.h index d509dde..35838b4 100644 --- a/chrome/browser/api/webdata/autofill_web_data.h +++ b/chrome/browser/api/webdata/autofill_web_data.h @@ -12,16 +12,11 @@ #include "base/string16.h" #include "chrome/browser/api/webdata/web_data_service_base.h" -namespace webkit { -namespace forms { -struct FormField; -} -} - class AutofillProfile; class CreditCard; class Profile; class WebDataServiceConsumer; +struct FormFieldData; // Pure virtual interface for retrieving Autofill data. API users // should use AutofillWebDataService. @@ -31,7 +26,7 @@ class AutofillWebData { // Schedules a task to add form fields to the web database. virtual void AddFormFields( - const std::vector<webkit::forms::FormField>& fields) = 0; + const std::vector<FormFieldData>& fields) = 0; // Initiates the request for a vector of values which have been entered in // form input fields named |name|. The method OnWebDataServiceRequestDone of diff --git a/chrome/browser/autofill/address_field_unittest.cc b/chrome/browser/autofill/address_field_unittest.cc index 0bc6567..1f3330d 100644 --- a/chrome/browser/autofill/address_field_unittest.cc +++ b/chrome/browser/autofill/address_field_unittest.cc @@ -9,8 +9,8 @@ #include "chrome/browser/autofill/address_field.h" #include "chrome/browser/autofill/autofill_field.h" #include "chrome/browser/autofill/autofill_scanner.h" +#include "chrome/common/form_field_data.h" #include "testing/gtest/include/gtest/gtest.h" -#include "webkit/forms/form_field.h" class AddressFieldTest : public testing::Test { public: @@ -44,7 +44,7 @@ TEST_F(AddressFieldTest, NonParse) { } TEST_F(AddressFieldTest, ParseOneLineAddress) { - webkit::forms::FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("Address"); @@ -62,7 +62,7 @@ TEST_F(AddressFieldTest, ParseOneLineAddress) { } TEST_F(AddressFieldTest, ParseOneLineAddressBilling) { - webkit::forms::FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("Address"); @@ -80,7 +80,7 @@ TEST_F(AddressFieldTest, ParseOneLineAddressBilling) { } TEST_F(AddressFieldTest, ParseOneLineAddressShipping) { - webkit::forms::FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("Address"); @@ -98,7 +98,7 @@ TEST_F(AddressFieldTest, ParseOneLineAddressShipping) { } TEST_F(AddressFieldTest, ParseTwoLineAddress) { - webkit::forms::FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("Address"); @@ -123,7 +123,7 @@ TEST_F(AddressFieldTest, ParseTwoLineAddress) { } TEST_F(AddressFieldTest, ParseThreeLineAddress) { - webkit::forms::FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("Address Line1"); @@ -154,7 +154,7 @@ TEST_F(AddressFieldTest, ParseThreeLineAddress) { } TEST_F(AddressFieldTest, ParseCity) { - webkit::forms::FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("City"); @@ -172,7 +172,7 @@ TEST_F(AddressFieldTest, ParseCity) { } TEST_F(AddressFieldTest, ParseState) { - webkit::forms::FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("State"); @@ -190,7 +190,7 @@ TEST_F(AddressFieldTest, ParseState) { } TEST_F(AddressFieldTest, ParseZip) { - webkit::forms::FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("Zip"); @@ -208,7 +208,7 @@ TEST_F(AddressFieldTest, ParseZip) { } TEST_F(AddressFieldTest, ParseStateAndZipOneLabel) { - webkit::forms::FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("State/Province, Zip/Postal Code"); @@ -233,7 +233,7 @@ TEST_F(AddressFieldTest, ParseStateAndZipOneLabel) { } TEST_F(AddressFieldTest, ParseCountry) { - webkit::forms::FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("Country"); @@ -251,7 +251,7 @@ TEST_F(AddressFieldTest, ParseCountry) { } TEST_F(AddressFieldTest, ParseTwoLineAddressMissingLabel) { - webkit::forms::FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("Address"); @@ -276,7 +276,7 @@ TEST_F(AddressFieldTest, ParseTwoLineAddressMissingLabel) { } TEST_F(AddressFieldTest, ParseCompany) { - webkit::forms::FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("Company"); diff --git a/chrome/browser/autofill/autocomplete_history_manager.cc b/chrome/browser/autofill/autocomplete_history_manager.cc index de2cf6d..4cee493 100644 --- a/chrome/browser/autofill/autocomplete_history_manager.cc +++ b/chrome/browser/autofill/autocomplete_history_manager.cc @@ -13,17 +13,15 @@ #include "chrome/browser/autofill/autofill_external_delegate.h" #include "chrome/browser/autofill/credit_card.h" #include "chrome/common/autofill_messages.h" +#include "chrome/common/form_data.h" #include "chrome/common/pref_names.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/render_view_host.h" #include "content/public/browser/web_contents.h" -#include "webkit/forms/form_data.h" using base::StringPiece16; using content::BrowserContext; using content::WebContents; -using webkit::forms::FormData; -using webkit::forms::FormField; DEFINE_WEB_CONTENTS_USER_DATA_KEY(AutocompleteHistoryManager) @@ -98,7 +96,7 @@ bool IsSSN(const string16& text) { return true; } -bool IsTextField(const FormField& field) { +bool IsTextField(const FormFieldData& field) { return field.form_control_type == ASCIIToUTF16("text") || field.form_control_type == ASCIIToUTF16("search") || @@ -209,8 +207,8 @@ void AutocompleteHistoryManager::OnFormSubmitted(const FormData& form) { // - text field // - value is not a credit card number // - value is not a SSN - std::vector<FormField> values; - for (std::vector<FormField>::const_iterator iter = + std::vector<FormFieldData> values; + for (std::vector<FormFieldData>::const_iterator iter = form.fields.begin(); iter != form.fields.end(); ++iter) { if (!iter->value.empty() && diff --git a/chrome/browser/autofill/autocomplete_history_manager.h b/chrome/browser/autofill/autocomplete_history_manager.h index a6a7f5b..a8f39f3 100644 --- a/chrome/browser/autofill/autocomplete_history_manager.h +++ b/chrome/browser/autofill/autocomplete_history_manager.h @@ -14,16 +14,12 @@ #include "chrome/browser/common/web_contents_user_data.h" #include "content/public/browser/web_contents_observer.h" +struct FormData; + namespace content { class BrowserContext; } -namespace webkit { -namespace forms { -struct FormData; -} -} - class AutofillExternalDelegate; // Per-tab Autocomplete history manager. Handles receiving form data @@ -54,7 +50,7 @@ class AutocompleteHistoryManager const std::vector<string16>& autofill_labels, const std::vector<string16>& autofill_icons, const std::vector<int>& autofill_unique_ids); - void OnFormSubmitted(const webkit::forms::FormData& form); + void OnFormSubmitted(const FormData& form); // Must be public for the external delegate to use. void OnRemoveAutocompleteEntry(const string16& name, const string16& value); diff --git a/chrome/browser/autofill/autocomplete_history_manager_unittest.cc b/chrome/browser/autofill/autocomplete_history_manager_unittest.cc index 16799f9..9cc9ade 100644 --- a/chrome/browser/autofill/autocomplete_history_manager_unittest.cc +++ b/chrome/browser/autofill/autocomplete_history_manager_unittest.cc @@ -12,6 +12,7 @@ #include "chrome/browser/ui/tab_contents/tab_contents.h" #include "chrome/browser/webdata/autofill_web_data_service_impl.h" #include "chrome/browser/webdata/web_data_service.h" +#include "chrome/common/form_data.h" #include "chrome/test/base/chrome_render_view_host_test_harness.h" #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_profile.h" @@ -19,17 +20,15 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/gfx/rect.h" -#include "webkit/forms/form_data.h" using content::BrowserThread; using content::WebContents; using testing::_; -using webkit::forms::FormData; class MockWebDataService : public WebDataService { public: MOCK_METHOD1(AddFormFields, - void(const std::vector<webkit::forms::FormField>&)); // NOLINT + void(const std::vector<FormFieldData>&)); // NOLINT protected: virtual ~MockWebDataService() {} @@ -71,7 +70,7 @@ TEST_F(AutocompleteHistoryManagerTest, CreditCardNumberValue) { form.user_submitted = true; // Valid Visa credit card number pulled from the paypal help site. - webkit::forms::FormField valid_cc; + FormFieldData valid_cc; valid_cc.label = ASCIIToUTF16("Credit Card"); valid_cc.name = ASCIIToUTF16("ccnum"); valid_cc.value = ASCIIToUTF16("4012888888881881"); @@ -94,7 +93,7 @@ TEST_F(AutocompleteHistoryManagerTest, NonCreditCardNumberValue) { form.user_submitted = true; // Invalid credit card number. - webkit::forms::FormField invalid_cc; + FormFieldData invalid_cc; invalid_cc.label = ASCIIToUTF16("Credit Card"); invalid_cc.name = ASCIIToUTF16("ccnum"); invalid_cc.value = ASCIIToUTF16("4580123456789012"); @@ -114,7 +113,7 @@ TEST_F(AutocompleteHistoryManagerTest, SSNValue) { form.action = GURL("http://myform.com/submit.html"); form.user_submitted = true; - webkit::forms::FormField ssn; + FormFieldData ssn; ssn.label = ASCIIToUTF16("Social Security Number"); ssn.name = ASCIIToUTF16("ssn"); ssn.value = ASCIIToUTF16("078-05-1120"); @@ -135,7 +134,7 @@ TEST_F(AutocompleteHistoryManagerTest, SearchField) { form.user_submitted = true; // Search field. - webkit::forms::FormField search_field; + FormFieldData search_field; search_field.label = ASCIIToUTF16("Search"); search_field.name = ASCIIToUTF16("search"); search_field.value = ASCIIToUTF16("my favorite query"); diff --git a/chrome/browser/autofill/autofill_common_test.cc b/chrome/browser/autofill/autofill_common_test.cc index 194cd02..5c12a58 100644 --- a/chrome/browser/autofill/autofill_common_test.cc +++ b/chrome/browser/autofill/autofill_common_test.cc @@ -10,8 +10,8 @@ #include "chrome/browser/autofill/credit_card.h" #include "chrome/browser/password_manager/encryptor.h" #include "chrome/browser/profiles/profile.h" +#include "chrome/common/form_field_data.h" #include "chrome/common/pref_names.h" -#include "webkit/forms/form_field.h" namespace autofill_test { @@ -19,7 +19,7 @@ void CreateTestFormField(const char* label, const char* name, const char* value, const char* type, - webkit::forms::FormField* field) { + FormFieldData* field) { field->label = ASCIIToUTF16(label); field->name = ASCIIToUTF16(name); field->value = ASCIIToUTF16(value); diff --git a/chrome/browser/autofill/autofill_common_test.h b/chrome/browser/autofill/autofill_common_test.h index 1207084..8ad2085 100644 --- a/chrome/browser/autofill/autofill_common_test.h +++ b/chrome/browser/autofill/autofill_common_test.h @@ -9,11 +9,7 @@ class AutofillProfile; class CreditCard; class Profile; -namespace webkit { -namespace forms { -struct FormField; -} -} +struct FormFieldData; // Common utilities shared amongst Autofill tests. namespace autofill_test { @@ -23,7 +19,7 @@ void CreateTestFormField(const char* label, const char* name, const char* value, const char* type, - webkit::forms::FormField* field); + FormFieldData* field); // A unit testing utility that is common to a number of the Autofill unit // tests. |SetProfileInfo| provides a quick way to populate a profile with diff --git a/chrome/browser/autofill/autofill_download_unittest.cc b/chrome/browser/autofill/autofill_download_unittest.cc index 1b2169d..51f3740 100644 --- a/chrome/browser/autofill/autofill_download_unittest.cc +++ b/chrome/browser/autofill/autofill_download_unittest.cc @@ -13,6 +13,7 @@ #include "chrome/browser/autofill/autofill_metrics.h" #include "chrome/browser/autofill/autofill_type.h" #include "chrome/browser/autofill/form_structure.h" +#include "chrome/common/form_data.h" #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_profile.h" #include "content/public/test/test_browser_thread.h" @@ -21,11 +22,8 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputElement.h" -#include "webkit/forms/form_data.h" using content::BrowserThread; -using webkit::forms::FormData; -using webkit::forms::FormField; using WebKit::WebInputElement; namespace { @@ -145,7 +143,7 @@ TEST_F(AutofillDownloadTest, QueryAndUploadTest) { FormData form; form.method = ASCIIToUTF16("post"); - FormField field; + FormFieldData field; field.label = ASCIIToUTF16("username"); field.name = ASCIIToUTF16("username"); field.form_control_type = ASCIIToUTF16("text"); @@ -357,7 +355,7 @@ TEST_F(AutofillDownloadTest, CacheQueryTest) { FormData form; form.method = ASCIIToUTF16("post"); - FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("username"); diff --git a/chrome/browser/autofill/autofill_external_delegate.cc b/chrome/browser/autofill/autofill_external_delegate.cc index b5c9bd2..e762da7 100644 --- a/chrome/browser/autofill/autofill_external_delegate.cc +++ b/chrome/browser/autofill/autofill_external_delegate.cc @@ -42,8 +42,8 @@ void AutofillExternalDelegate::SelectAutofillSuggestionAtIndex(int unique_id) { } void AutofillExternalDelegate::OnQuery(int query_id, - const webkit::forms::FormData& form, - const webkit::forms::FormField& field, + const FormData& form, + const FormFieldData& field, const gfx::Rect& bounds, bool display_warning_if_disabled) { autofill_query_form_ = form; @@ -118,7 +118,7 @@ void AutofillExternalDelegate::OnSuggestionsReturned( void AutofillExternalDelegate::OnShowPasswordSuggestions( const std::vector<string16>& suggestions, - const webkit::forms::FormField& field, + const FormFieldData& field, const gfx::Rect& bounds) { autofill_query_field_ = field; @@ -231,8 +231,8 @@ void AutofillExternalDelegate::Reset() { } void AutofillExternalDelegate::AddPasswordFormMapping( - const webkit::forms::FormField& form, - const webkit::forms::PasswordFormFillData& fill_data) { + const FormFieldData& form, + const PasswordFormFillData& fill_data) { password_autofill_manager_.AddPasswordFormMapping(form, fill_data); } diff --git a/chrome/browser/autofill/autofill_external_delegate.h b/chrome/browser/autofill/autofill_external_delegate.h index 8d853ad..423860a 100644 --- a/chrome/browser/autofill/autofill_external_delegate.h +++ b/chrome/browser/autofill/autofill_external_delegate.h @@ -11,9 +11,9 @@ #include "base/string16.h" #include "chrome/browser/autofill/password_autofill_manager.h" #include "chrome/browser/ui/tab_contents/tab_contents.h" -#include "webkit/forms/form_data.h" -#include "webkit/forms/form_field.h" -#include "webkit/forms/password_form_dom_manager.h" +#include "chrome/common/form_data.h" +#include "chrome/common/form_field_data.h" +#include "chrome/common/password_form_fill_data.h" class AutofillManager; @@ -47,8 +47,8 @@ class AutofillExternalDelegate { // Autocomplete because they have their own popup, and showing our popup // on to of theirs would be a poor user experience. virtual void OnQuery(int query_id, - const webkit::forms::FormData& form, - const webkit::forms::FormField& field, + const FormData& form, + const FormFieldData& field, const gfx::Rect& bounds, bool display_warning_if_disabled); @@ -63,7 +63,7 @@ class AutofillExternalDelegate { // Show password suggestions in the popup. void OnShowPasswordSuggestions(const std::vector<string16>& suggestions, - const webkit::forms::FormField& field, + const FormFieldData& field, const gfx::Rect& bounds); // Set the data list value associated with the current field. @@ -100,8 +100,8 @@ class AutofillExternalDelegate { // Inform the Password Manager of a filled form. void AddPasswordFormMapping( - const webkit::forms::FormField& form, - const webkit::forms::PasswordFormFillData& fill_data); + const FormFieldData& form, + const PasswordFormFillData& fill_data); // Platforms that wish to implement an external Autofill delegate // MUST implement this. The 1st arg is the tab contents that owns @@ -124,8 +124,8 @@ class AutofillExternalDelegate { // Handle instance specific OnQueryCode. virtual void OnQueryPlatformSpecific(int query_id, - const webkit::forms::FormData& form, - const webkit::forms::FormField& field, + const FormData& form, + const FormFieldData& field, const gfx::Rect& bounds) = 0; // Handle platform-dependent hiding. @@ -179,8 +179,8 @@ class AutofillExternalDelegate { int autofill_query_id_; // The current form and field selected by Autofill. - webkit::forms::FormData autofill_query_form_; - webkit::forms::FormField autofill_query_field_; + FormData autofill_query_form_; + FormFieldData autofill_query_field_; // Should we display a warning if Autofill is disabled? bool display_warning_if_disabled_; diff --git a/chrome/browser/autofill/autofill_external_delegate_unittest.cc b/chrome/browser/autofill/autofill_external_delegate_unittest.cc index 0c7c934..282ec0d 100644 --- a/chrome/browser/autofill/autofill_external_delegate_unittest.cc +++ b/chrome/browser/autofill/autofill_external_delegate_unittest.cc @@ -11,19 +11,17 @@ #include "chrome/browser/autofill/test_autofill_external_delegate.h" #include "chrome/browser/ui/autofill/tab_autofill_manager_delegate.h" #include "chrome/browser/ui/tab_contents/test_tab_contents.h" +#include "chrome/common/form_data.h" +#include "chrome/common/form_field_data.h" #include "chrome/test/base/testing_profile.h" #include "content/public/test/test_browser_thread.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebAutofillClient.h" #include "ui/gfx/rect.h" -#include "webkit/forms/form_data.h" -#include "webkit/forms/form_field.h" using content::BrowserThread; using testing::_; -using webkit::forms::FormData; -using webkit::forms::FormField; using WebKit::WebAutofillClient; namespace { @@ -49,8 +47,8 @@ class MockAutofillExternalDelegate : public TestAutofillExternalDelegate { MOCK_METHOD4(OnQueryPlatformSpecific, void(int query_id, - const webkit::forms::FormData& form, - const webkit::forms::FormField& field, + const FormData& form, + const FormFieldData& field, const gfx::Rect& bounds)); MOCK_METHOD0(ClearPreviewedForm, void()); @@ -72,8 +70,8 @@ class MockAutofillManager : public AutofillManager { MOCK_METHOD4(OnFillAutofillFormData, void(int query_id, - const webkit::forms::FormData& form, - const webkit::forms::FormField& field, + const FormData& form, + const FormFieldData& field, int unique_id)); protected: @@ -104,7 +102,7 @@ class AutofillExternalDelegateUnitTest : public TabContentsTestHarness { // execute it with the given QueryId. void IssueOnQuery(int query_id) { const FormData form; - FormField field; + FormFieldData field; field.is_focusable = true; field.should_autocomplete = true; const gfx::Rect bounds; diff --git a/chrome/browser/autofill/autofill_field.cc b/chrome/browser/autofill/autofill_field.cc index 174d88a..55bb725 100644 --- a/chrome/browser/autofill/autofill_field.cc +++ b/chrome/browser/autofill/autofill_field.cc @@ -31,9 +31,9 @@ AutofillField::AutofillField() phone_part_(IGNORED) { } -AutofillField::AutofillField(const webkit::forms::FormField& field, +AutofillField::AutofillField(const FormFieldData& field, const string16& unique_name) - : webkit::forms::FormField(field), + : FormFieldData(field), unique_name_(unique_name), server_type_(NO_SERVER_DATA), heuristic_type_(UNKNOWN_TYPE), diff --git a/chrome/browser/autofill/autofill_field.h b/chrome/browser/autofill/autofill_field.h index e72a89c..797802a 100644 --- a/chrome/browser/autofill/autofill_field.h +++ b/chrome/browser/autofill/autofill_field.h @@ -10,9 +10,9 @@ #include "base/basictypes.h" #include "base/string16.h" #include "chrome/browser/autofill/field_types.h" -#include "webkit/forms/form_field.h" +#include "chrome/common/form_field_data.h" -class AutofillField : public webkit::forms::FormField { +class AutofillField : public FormFieldData { public: enum PhonePart { IGNORED = 0, @@ -21,8 +21,7 @@ class AutofillField : public webkit::forms::FormField { }; AutofillField(); - AutofillField(const webkit::forms::FormField& field, - const string16& unique_name); + AutofillField(const FormFieldData& field, const string16& unique_name); virtual ~AutofillField(); const string16& unique_name() const { return unique_name_; } diff --git a/chrome/browser/autofill/autofill_manager.cc b/chrome/browser/autofill/autofill_manager.cc index 02f53aa..9793ad6 100644 --- a/chrome/browser/autofill/autofill_manager.cc +++ b/chrome/browser/autofill/autofill_manager.cc @@ -42,6 +42,10 @@ #include "chrome/common/autofill_messages.h" #include "chrome/common/chrome_notification_types.h" #include "chrome/common/chrome_switches.h" +#include "chrome/common/form_data.h" +#include "chrome/common/form_data_predictions.h" +#include "chrome/common/form_field_data.h" +#include "chrome/common/password_form_fill_data.h" #include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" #include "content/public/browser/browser_context.h" @@ -56,18 +60,11 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/WebAutofillClient.h" #include "ui/base/l10n/l10n_util.h" #include "ui/gfx/rect.h" -#include "webkit/forms/form_data.h" -#include "webkit/forms/form_data_predictions.h" -#include "webkit/forms/form_field.h" -#include "webkit/forms/password_form_dom_manager.h" using base::TimeTicks; using content::BrowserThread; using content::RenderViewHost; using switches::kEnableAutofillFeedback; -using webkit::forms::FormData; -using webkit::forms::FormDataPredictions; -using webkit::forms::FormField; namespace { @@ -441,7 +438,7 @@ void AutofillManager::OnFormsSeen(const std::vector<FormData>& forms, } void AutofillManager::OnTextFieldDidChange(const FormData& form, - const FormField& field, + const FormFieldData& field, const TimeTicks& timestamp) { FormStructure* form_structure = NULL; AutofillField* autofill_field = NULL; @@ -470,7 +467,7 @@ void AutofillManager::OnTextFieldDidChange(const FormData& form, void AutofillManager::OnQueryFormFieldAutofill(int query_id, const FormData& form, - const FormField& field, + const FormFieldData& field, const gfx::Rect& bounding_box, bool display_warning) { std::vector<string16> values; @@ -564,7 +561,7 @@ void AutofillManager::OnQueryFormFieldAutofill(int query_id, void AutofillManager::OnFillAutofillFormData(int query_id, const FormData& form, - const FormField& field, + const FormFieldData& field, int unique_id) { const std::vector<AutofillProfile*>& profiles = personal_data_->profiles(); const std::vector<CreditCard*>& credit_cards = personal_data_->credit_cards(); @@ -590,7 +587,7 @@ void AutofillManager::OnFillAutofillFormData(int query_id, // If the relevant section is auto-filled, we should fill |field| but not the // rest of the form. if (SectionIsAutofilled(*form_structure, form, autofill_field->section())) { - for (std::vector<FormField>::iterator iter = result.fields.begin(); + for (std::vector<FormFieldData>::iterator iter = result.fields.begin(); iter != result.fields.end(); ++iter) { if ((*iter) == field) { AutofillFieldType field_type = autofill_field->type(); @@ -716,7 +713,7 @@ void AutofillManager::OnHideAutofillPopup() { void AutofillManager::OnShowPasswordGenerationPopup( const gfx::Rect& bounds, int max_length, - const webkit::forms::PasswordForm& form) { + const content::PasswordForm& form) { password_generator_.reset(new autofill::PasswordGenerator(max_length)); manager_delegate_->ShowPasswordGenerationBubble( bounds, form, password_generator_.get()); @@ -747,14 +744,14 @@ void AutofillManager::RemoveAutofillProfileOrCreditCard(int unique_id) { } void AutofillManager::OnAddPasswordFormMapping( - const webkit::forms::FormField& form, - const webkit::forms::PasswordFormFillData& fill_data) { + const FormFieldData& form, + const PasswordFormFillData& fill_data) { if (external_delegate_) external_delegate_->AddPasswordFormMapping(form, fill_data); } void AutofillManager::OnShowPasswordSuggestions( - const webkit::forms::FormField& field, + const FormFieldData& field, const gfx::Rect& bounds, const std::vector<string16>& suggestions) { if (external_delegate_) @@ -1004,7 +1001,7 @@ bool AutofillManager::FindCachedForm(const FormData& form, } bool AutofillManager::GetCachedFormAndField(const FormData& form, - const FormField& field, + const FormFieldData& field, FormStructure** form_structure, AutofillField** autofill_field) { // Find the FormStructure that corresponds to |form|. @@ -1093,7 +1090,7 @@ bool AutofillManager::UpdateCachedForm(const FormData& live_form, void AutofillManager::GetProfileSuggestions( FormStructure* form, - const FormField& field, + const FormFieldData& field, AutofillFieldType type, std::vector<string16>* values, std::vector<string16>* labels, @@ -1180,7 +1177,7 @@ void AutofillManager::GetProfileSuggestions( void AutofillManager::GetCreditCardSuggestions( FormStructure* form, - const FormField& field, + const FormFieldData& field, AutofillFieldType type, std::vector<string16>* values, std::vector<string16>* labels, @@ -1219,7 +1216,7 @@ void AutofillManager::GetCreditCardSuggestions( void AutofillManager::FillCreditCardFormField(const CreditCard& credit_card, AutofillFieldType type, - FormField* field) { + FormFieldData* field) { DCHECK_EQ(AutofillType::CREDIT_CARD, AutofillType(type).group()); DCHECK(field); @@ -1243,7 +1240,7 @@ void AutofillManager::FillCreditCardFormField(const CreditCard& credit_card, void AutofillManager::FillFormField(const AutofillProfile& profile, const AutofillField& cached_field, size_t variant, - FormField* field) { + FormFieldData* field) { AutofillFieldType type = cached_field.type(); DCHECK_NE(AutofillType::CREDIT_CARD, AutofillType(type).group()); DCHECK(field); @@ -1270,7 +1267,7 @@ void AutofillManager::FillFormField(const AutofillProfile& profile, void AutofillManager::FillPhoneNumberField(const AutofillProfile& profile, const AutofillField& cached_field, size_t variant, - FormField* field) { + FormFieldData* field) { std::vector<string16> values; profile.GetCanonicalizedMultiInfo(cached_field.type(), &values); DCHECK(variant < values.size()); diff --git a/chrome/browser/autofill/autofill_manager.h b/chrome/browser/autofill/autofill_manager.h index 57af9b3..87e2d37 100644 --- a/chrome/browser/autofill/autofill_manager.h +++ b/chrome/browser/autofill/autofill_manager.h @@ -38,6 +38,9 @@ class PrefService; class ProfileSyncService; class TabContents; +struct FormData; +struct FormFieldData; +struct PasswordFormFillData; struct ViewHostMsg_FrameNavigate_Params; namespace autofill { @@ -47,6 +50,7 @@ class PasswordGenerator; namespace content { class RenderViewHost; +struct PasswordForm; } namespace gfx { @@ -57,15 +61,6 @@ namespace IPC { class Message; } -namespace webkit { -namespace forms { -struct FormData; -struct FormField; -struct PasswordForm; -struct PasswordFormFillData; -} -} - // Manages saving and restoring the user's personal information entered into web // forms. class AutofillManager : public content::NotificationObserver, @@ -95,8 +90,8 @@ class AutofillManager : public content::NotificationObserver, // Called from our external delegate so they cannot be private. virtual void OnFillAutofillFormData(int query_id, - const webkit::forms::FormData& form, - const webkit::forms::FormField& field, + const FormData& form, + const FormFieldData& field, int unique_id); void OnDidShowAutofillSuggestions(bool is_new_popup); void OnDidFillAutofillFormData(const base::TimeTicks& timestamp); @@ -104,7 +99,7 @@ class AutofillManager : public content::NotificationObserver, void OnDidPreviewAutofillFormData(); void OnShowPasswordGenerationPopup(const gfx::Rect& bounds, int max_length, - const webkit::forms::PasswordForm& form); + const content::PasswordForm& form); // Remove the credit card or Autofill profile that matches |unique_id| // from the database. @@ -171,7 +166,7 @@ class AutofillManager : public content::NotificationObserver, // Processes the submitted |form|, saving any new Autofill data and uploading // the possible field types for the submitted fields to the crowdsouring // server. Returns false if this form is not relevant for Autofill. - bool OnFormSubmitted(const webkit::forms::FormData& form, + bool OnFormSubmitted(const FormData& form, const base::TimeTicks& timestamp); private: @@ -204,24 +199,24 @@ class AutofillManager : public content::NotificationObserver, void UpdatePasswordGenerationState(content::RenderViewHost* host, bool new_renderer); - void OnFormsSeen(const std::vector<webkit::forms::FormData>& forms, + void OnFormsSeen(const std::vector<FormData>& forms, const base::TimeTicks& timestamp); - void OnTextFieldDidChange(const webkit::forms::FormData& form, - const webkit::forms::FormField& field, + void OnTextFieldDidChange(const FormData& form, + const FormFieldData& field, const base::TimeTicks& timestamp); // The |bounding_box| is a window relative value. void OnQueryFormFieldAutofill(int query_id, - const webkit::forms::FormData& form, - const webkit::forms::FormField& field, + const FormData& form, + const FormFieldData& field, const gfx::Rect& bounding_box, bool display_warning); void OnDidEndTextFieldEditing(); void OnHideAutofillPopup(); void OnAddPasswordFormMapping( - const webkit::forms::FormField& form, - const webkit::forms::PasswordFormFillData& fill_data); - void OnShowPasswordSuggestions(const webkit::forms::FormField& field, + const FormFieldData& form, + const PasswordFormFillData& fill_data); + void OnShowPasswordSuggestions(const FormFieldData& field, const gfx::Rect& bounds, const std::vector<string16>& suggestions); void OnSetDataList(const std::vector<string16>& values, @@ -246,15 +241,15 @@ class AutofillManager : public content::NotificationObserver, // Fills |form_structure| cached element corresponding to |form|. // Returns false if the cached element was not found. - bool FindCachedForm(const webkit::forms::FormData& form, + bool FindCachedForm(const FormData& form, FormStructure** form_structure) const WARN_UNUSED_RESULT; // Fills |form_structure| and |autofill_field| with the cached elements // corresponding to |form| and |field|. This might have the side-effect of // updating the cache. Returns false if the |form| is not autofillable, or if // it is not already present in the cache and the cache is full. - bool GetCachedFormAndField(const webkit::forms::FormData& form, - const webkit::forms::FormField& field, + bool GetCachedFormAndField(const FormData& form, + const FormFieldData& field, FormStructure** form_structure, AutofillField** autofill_field) WARN_UNUSED_RESULT; @@ -262,7 +257,7 @@ class AutofillManager : public content::NotificationObserver, // |cached_form| should be a pointer to the existing version of the form, or // NULL if no cached version exists. The updated form is then written into // |updated_form|. Returns false if the cache could not be updated. - bool UpdateCachedForm(const webkit::forms::FormData& live_form, + bool UpdateCachedForm(const FormData& live_form, const FormStructure* cached_form, FormStructure** updated_form) WARN_UNUSED_RESULT; @@ -270,7 +265,7 @@ class AutofillManager : public content::NotificationObserver, // value of |field| and returns the labels of the matching profiles. |labels| // is filled with the Profile label. void GetProfileSuggestions(FormStructure* form, - const webkit::forms::FormField& field, + const FormFieldData& field, AutofillFieldType type, std::vector<string16>* values, std::vector<string16>* labels, @@ -280,7 +275,7 @@ class AutofillManager : public content::NotificationObserver, // Returns a list of values from the stored credit cards that match |type| and // the value of |field| and returns the labels of the matching credit cards. void GetCreditCardSuggestions(FormStructure* form, - const webkit::forms::FormField& field, + const FormFieldData& field, AutofillFieldType type, std::vector<string16>* values, std::vector<string16>* labels, @@ -290,7 +285,7 @@ class AutofillManager : public content::NotificationObserver, // Set |field|'s value based on |type| and contents of the |credit_card|. void FillCreditCardFormField(const CreditCard& credit_card, AutofillFieldType type, - webkit::forms::FormField* field); + FormFieldData* field); // Set |field|'s value based on |cached_field|'s type and contents of the // |profile|. The |variant| parameter specifies which value in a multi-valued @@ -298,7 +293,7 @@ class AutofillManager : public content::NotificationObserver, void FillFormField(const AutofillProfile& profile, const AutofillField& cached_field, size_t variant, - webkit::forms::FormField* field); + FormFieldData* field); // Set |field|'s value for phone number based on contents of the |profile|. // The |cached_field| specifies the type of the phone and whether this is a @@ -307,10 +302,10 @@ class AutofillManager : public content::NotificationObserver, void FillPhoneNumberField(const AutofillProfile& profile, const AutofillField& cached_field, size_t variant, - webkit::forms::FormField* field); + FormFieldData* field); // Parses the forms using heuristic matching and querying the Autofill server. - void ParseForms(const std::vector<webkit::forms::FormData>& forms); + void ParseForms(const std::vector<FormData>& forms); // Imports the form data, submitted by the user, into |personal_data_|. void ImportFormData(const FormStructure& submitted_form); diff --git a/chrome/browser/autofill/autofill_manager_delegate.h b/chrome/browser/autofill/autofill_manager_delegate.h index dda8bfe..4e23556 100644 --- a/chrome/browser/autofill/autofill_manager_delegate.h +++ b/chrome/browser/autofill/autofill_manager_delegate.h @@ -11,18 +11,13 @@ class PasswordGenerator; namespace content { class BrowserContext; +struct PasswordForm; } namespace gfx { class Rect; } -namespace webkit { -namespace forms { -struct PasswordForm; -} -} - class InfoBarService; class PrefServiceBase; class Profile; @@ -73,7 +68,7 @@ class AutofillManagerDelegate { // specified form with the given bounds. virtual void ShowPasswordGenerationBubble( const gfx::Rect& bounds, - const webkit::forms::PasswordForm& form, + const content::PasswordForm& form, autofill::PasswordGenerator* generator) = 0; }; diff --git a/chrome/browser/autofill/autofill_manager_unittest.cc b/chrome/browser/autofill/autofill_manager_unittest.cc index 0a59cc6..be1c481 100644 --- a/chrome/browser/autofill/autofill_manager_unittest.cc +++ b/chrome/browser/autofill/autofill_manager_unittest.cc @@ -32,6 +32,8 @@ #include "chrome/browser/ui/tab_contents/test_tab_contents.h" #include "chrome/common/autofill_messages.h" #include "chrome/common/chrome_switches.h" +#include "chrome/common/form_data.h" +#include "chrome/common/form_field_data.h" #include "chrome/common/pref_names.h" #include "chrome/test/base/testing_profile.h" #include "content/public/browser/web_contents.h" @@ -45,14 +47,10 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/WebAutofillClient.h" #include "ui/base/l10n/l10n_util.h" #include "ui/gfx/rect.h" -#include "webkit/forms/form_data.h" -#include "webkit/forms/form_field.h" using content::BrowserThread; using content::WebContents; using testing::_; -using webkit::forms::FormData; -using webkit::forms::FormField; namespace { @@ -198,7 +196,7 @@ void CreateTestAddressFormData(FormData* form) { form->action = GURL("http://myform.com/submit.html"); form->user_submitted = true; - FormField field; + FormFieldData field; autofill_test::CreateTestFormField( "First Name", "firstname", "", "text", &field); form->fields.push_back(field); @@ -251,7 +249,7 @@ void CreateTestCreditCardFormData(FormData* form, } form->user_submitted = true; - FormField field; + FormFieldData field; autofill_test::CreateTestFormField( "Name on Card", "nameoncard", "", "text", &field); form->fields.push_back(field); @@ -301,7 +299,7 @@ void ExpectFilledField(const char* expected_label, const char* expected_name, const char* expected_value, const char* expected_form_control_type, - const webkit::forms::FormField& field) { + const FormFieldData& field) { SCOPED_TRACE(expected_label); EXPECT_EQ(UTF8ToUTF16(expected_label), field.label); EXPECT_EQ(UTF8ToUTF16(expected_name), field.name); @@ -624,8 +622,8 @@ class AutofillManagerTest : public TabContentsTestHarness { } void GetAutofillSuggestions(int query_id, - const webkit::forms::FormData& form, - const webkit::forms::FormField& field) { + const FormData& form, + const FormFieldData& field) { autofill_manager_->OnQueryFormFieldAutofill(query_id, form, field, @@ -633,8 +631,8 @@ class AutofillManagerTest : public TabContentsTestHarness { false); } - void GetAutofillSuggestions(const webkit::forms::FormData& form, - const webkit::forms::FormField& field) { + void GetAutofillSuggestions(const FormData& form, + const FormFieldData& field) { GetAutofillSuggestions(kDefaultPageID, form, field); } @@ -643,7 +641,7 @@ class AutofillManagerTest : public TabContentsTestHarness { SendSuggestions(&result); } - void FormsSeen(const std::vector<webkit::forms::FormData>& forms) { + void FormsSeen(const std::vector<FormData>& forms) { autofill_manager_->OnFormsSeen(forms, base::TimeTicks()); } @@ -653,8 +651,8 @@ class AutofillManagerTest : public TabContentsTestHarness { } void FillAutofillFormData(int query_id, - const webkit::forms::FormData& form, - const webkit::forms::FormField& field, + const FormData& form, + const FormFieldData& field, int unique_id) { autofill_manager_->OnFillAutofillFormData(query_id, form, field, unique_id); } @@ -758,7 +756,7 @@ TEST_F(AutofillManagerTest, GetProfileSuggestionsEmptyValue) { std::vector<FormData> forms(1, form); FormsSeen(forms); - const FormField& field = form.fields[0]; + const FormFieldData& field = form.fields[0]; GetAutofillSuggestions(form, field); // No suggestions provided, so send an empty vector as the results. @@ -800,7 +798,7 @@ TEST_F(AutofillManagerTest, GetProfileSuggestionsMatchCharacter) { std::vector<FormData> forms(1, form); FormsSeen(forms); - FormField field; + FormFieldData field; autofill_test::CreateTestFormField("First Name", "firstname", "E", "text", &field); GetAutofillSuggestions(form, field); @@ -837,7 +835,7 @@ TEST_F(AutofillManagerTest, GetProfileSuggestionsUnknownFields) { form.action = GURL("http://myform.com/submit.html"); form.user_submitted = true; - FormField field; + FormFieldData field; autofill_test::CreateTestFormField("Username", "username", "", "text", &field); form.fields.push_back(field); @@ -871,7 +869,7 @@ TEST_F(AutofillManagerTest, GetProfileSuggestionsWithDuplicates) { "00000000-0000-0000-0000-000000000001"))); autofill_manager_->AddProfile(duplicate_profile); - const FormField& field = form.fields[0]; + const FormFieldData& field = form.fields[0]; GetAutofillSuggestions(form, field); // No suggestions provided, so send an empty vector as the results. @@ -913,7 +911,7 @@ TEST_F(AutofillManagerTest, GetProfileSuggestionsAutofillDisabledByUser) { // Disable Autofill. autofill_manager_->set_autofill_enabled(false); - const FormField& field = form.fields[0]; + const FormFieldData& field = form.fields[0]; GetAutofillSuggestions(form, field); EXPECT_FALSE(GetAutofillSuggestionsMessage(NULL, NULL, NULL, NULL, NULL)); } @@ -928,7 +926,7 @@ TEST_F(AutofillManagerTest, GetProfileSuggestionsMethodGet) { std::vector<FormData> forms(1, form); FormsSeen(forms); - const FormField& field = form.fields[0]; + const FormFieldData& field = form.fields[0]; GetAutofillSuggestions(form, field); // No suggestions provided, so send an empty vector as the results. @@ -995,7 +993,7 @@ TEST_F(AutofillManagerTest, GetCreditCardSuggestionsEmptyValue) { std::vector<FormData> forms(1, form); FormsSeen(forms); - FormField field = form.fields[1]; + FormFieldData field = form.fields[1]; GetAutofillSuggestions(form, field); // No suggestions provided, so send an empty vector as the results. @@ -1038,7 +1036,7 @@ TEST_F(AutofillManagerTest, GetCreditCardSuggestionsMatchCharacter) { std::vector<FormData> forms(1, form); FormsSeen(forms); - FormField field; + FormFieldData field; autofill_test::CreateTestFormField( "Card Number", "cardnumber", "4", "text", &field); GetAutofillSuggestions(form, field); @@ -1074,7 +1072,7 @@ TEST_F(AutofillManagerTest, GetCreditCardSuggestionsNonCCNumber) { std::vector<FormData> forms(1, form); FormsSeen(forms); - const FormField& field = form.fields[0]; + const FormFieldData& field = form.fields[0]; GetAutofillSuggestions(form, field); // No suggestions provided, so send an empty vector as the results. @@ -1117,7 +1115,7 @@ TEST_F(AutofillManagerTest, GetCreditCardSuggestionsNonHTTPS) { std::vector<FormData> forms(1, form); FormsSeen(forms); - const FormField& field = form.fields[0]; + const FormFieldData& field = form.fields[0]; GetAutofillSuggestions(form, field); // No suggestions provided, so send an empty vector as the results. @@ -1191,7 +1189,7 @@ TEST_F(AutofillManagerTest, GetCreditCardSuggestionsRepeatedObfuscatedNumber) { std::vector<FormData> forms(1, form); FormsSeen(forms); - FormField field = form.fields[1]; + FormFieldData field = form.fields[1]; GetAutofillSuggestions(form, field); // No suggestions provided, so send an empty vector as the results. @@ -1241,7 +1239,7 @@ TEST_F(AutofillManagerTest, GetAddressAndCreditCardSuggestions) { std::vector<FormData> forms(1, form); FormsSeen(forms); - FormField field = form.fields[0]; + FormFieldData field = form.fields[0]; GetAutofillSuggestions(form, field); // No suggestions provided, so send an empty vector as the results. @@ -1315,7 +1313,7 @@ TEST_F(AutofillManagerTest, GetAddressAndCreditCardSuggestionsNonHttps) { std::vector<FormData> forms(1, form); FormsSeen(forms); - FormField field = form.fields[0]; + FormFieldData field = form.fields[0]; GetAutofillSuggestions(form, field); // No suggestions provided, so send an empty vector as the results. @@ -1382,7 +1380,7 @@ TEST_F(AutofillManagerTest, GetCombinedAutofillAndAutocompleteSuggestions) { std::vector<FormData> forms(1, form); FormsSeen(forms); - const FormField& field = form.fields[0]; + const FormFieldData& field = form.fields[0]; GetAutofillSuggestions(form, field); // Add some Autocomplete suggestions. @@ -1433,7 +1431,7 @@ TEST_F(AutofillManagerTest, GetFieldSuggestionsWhenFormIsAutofilled) { // Mark one of the fields as filled. form.fields[2].is_autofilled = true; - const FormField& field = form.fields[0]; + const FormFieldData& field = form.fields[0]; GetAutofillSuggestions(form, field); // No suggestions provided, so send an empty vector as the results. @@ -1466,7 +1464,7 @@ TEST_F(AutofillManagerTest, GetFieldSuggestionsForAutocompleteOnly) { // Set up our form data. FormData form; CreateTestAddressFormData(&form); - FormField field; + FormFieldData field; autofill_test::CreateTestFormField( "Some Field", "somefield", "", "text", &field); form.fields.push_back(field); @@ -1519,7 +1517,7 @@ TEST_F(AutofillManagerTest, GetFieldSuggestionsWithDuplicateValues) { profile->set_guid("00000000-0000-0000-0000-000000000101"); autofill_manager_->AddProfile(profile); - FormField& field = form.fields[0]; + FormFieldData& field = form.fields[0]; field.is_autofilled = true; field.value = ASCIIToUTF16("Elvis"); GetAutofillSuggestions(form, field); @@ -1570,7 +1568,7 @@ TEST_F(AutofillManagerTest, GetFieldSuggestionsForMultiValuedProfileUnfilled) { { // Get the first name field. // Start out with "E", hoping for either "Elvis" or "Elena. - FormField& field = form.fields[0]; + FormFieldData& field = form.fields[0]; field.value = ASCIIToUTF16("E"); field.is_autofilled = false; GetAutofillSuggestions(form, field); @@ -1605,7 +1603,7 @@ TEST_F(AutofillManagerTest, GetFieldSuggestionsForMultiValuedProfileUnfilled) { { // Get the first name field. // This time, start out with "Ele", hoping for "Elena". - FormField& field = form.fields[0]; + FormFieldData& field = form.fields[0]; field.value = ASCIIToUTF16("Ele"); field.is_autofilled = false; GetAutofillSuggestions(form, field); @@ -1654,7 +1652,7 @@ TEST_F(AutofillManagerTest, GetFieldSuggestionsForMultiValuedProfileFilled) { // Get the first name field. And start out with "Travis", hoping for all the // multi-valued variants as suggestions. - FormField& field = form.fields[0]; + FormFieldData& field = form.fields[0]; field.value = ASCIIToUTF16("Travis"); field.is_autofilled = true; GetAutofillSuggestions(form, field); @@ -1700,7 +1698,7 @@ TEST_F(AutofillManagerTest, GetProfileSuggestionsFancyPhone) { profile->SetMultiInfo(PHONE_HOME_WHOLE_NUMBER, multi_values); autofill_manager_->AddProfile(profile); - const FormField& field = form.fields[9]; + const FormFieldData& field = form.fields[9]; GetAutofillSuggestions(form, field); // No suggestions provided, so send an empty vector as the results. @@ -1992,7 +1990,7 @@ TEST_F(AutofillManagerTest, FillFormWithAuthorSpecifiedSections) { form.action = GURL("https://myform.com/submit.html"); form.user_submitted = true; - FormField field; + FormFieldData field; autofill_test::CreateTestFormField("", "country", "", "text", &field); field.autocomplete_type = ASCIIToUTF16("section-billing country"); @@ -2146,7 +2144,7 @@ TEST_F(AutofillManagerTest, FillFormWithMultipleEmails) { // Set up our form data. FormData form; CreateTestAddressFormData(&form); - FormField field; + FormFieldData field; autofill_test::CreateTestFormField( "Confirm email", "email2", "", "text", &field); form.fields.push_back(field); @@ -2214,7 +2212,7 @@ TEST_F(AutofillManagerTest, FillAutofilledForm) { // Now set the credit card fields to also be auto-filled, and try again to // fill the credit card data - for (std::vector<FormField>::iterator iter = form.fields.begin(); + for (std::vector<FormFieldData>::iterator iter = form.fields.begin(); iter != form.fields.end(); ++iter) { iter->is_autofilled = true; @@ -2311,7 +2309,7 @@ TEST_F(AutofillManagerTest, FillPhoneNumber) { { "Phone Extension", "ext", 3, "phone-extension" } }; - FormField field; + FormFieldData field; const size_t default_max_length = field.max_length; for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_fields); ++i) { autofill_test::CreateTestFormField( @@ -2439,7 +2437,7 @@ TEST_F(AutofillManagerTest, FormChangesRemoveField) { CreateTestAddressFormData(&form); // Add a field -- we'll remove it again later. - FormField field; + FormFieldData field; autofill_test::CreateTestFormField("Some", "field", "", "text", &field); form.fields.insert(form.fields.begin() + 3, field); @@ -2470,9 +2468,9 @@ TEST_F(AutofillManagerTest, FormChangesAddField) { CreateTestAddressFormData(&form); // Remove the phone field -- we'll add it back later. - std::vector<FormField>::iterator pos = + std::vector<FormFieldData>::iterator pos = form.fields.begin() + kPhoneFieldOffset; - FormField field = *pos; + FormFieldData field = *pos; pos = form.fields.erase(pos); std::vector<FormData> forms(1, form); @@ -2571,7 +2569,7 @@ TEST_F(AutofillManagerTest, FormSubmittedWithDifferentFields) { // Websites would typically invoke JavaScript either on page load or on form // submit to achieve this. form.fields.pop_back(); - FormField field = form.fields[3]; + FormFieldData field = form.fields[3]; form.fields[3] = form.fields[7]; form.fields[7] = field; @@ -2651,7 +2649,7 @@ TEST_F(AutofillManagerTest, DeterminePossibleFieldTypesForUpload) { std::vector<FieldTypeSet> expected_types; // These fields should all match. - FormField field; + FormFieldData field; FieldTypeSet types; autofill_test::CreateTestFormField("", "1", "Elvis", "text", &field); types.clear(); @@ -3083,14 +3081,14 @@ class MockAutofillExternalDelegate : public TestAutofillExternalDelegate { virtual ~MockAutofillExternalDelegate() {} MOCK_METHOD5(OnQuery, void(int query_id, - const webkit::forms::FormData& form, - const webkit::forms::FormField& field, + const FormData& form, + const FormFieldData& field, const gfx::Rect& bounds, bool display_warning)); virtual void OnQueryPlatformSpecific(int query_id, - const webkit::forms::FormData& form, - const webkit::forms::FormField& field, + const FormData& form, + const FormFieldData& field, const gfx::Rect& bounds) OVERRIDE {} private: @@ -3110,7 +3108,7 @@ TEST_F(AutofillManagerTest, TestExternalDelegate) { CreateTestAddressFormData(&form); std::vector<FormData> forms(1, form); FormsSeen(forms); - const FormField& field = form.fields[0]; + const FormFieldData& field = form.fields[0]; GetAutofillSuggestions(form, field); // should call the delegate's OnQuery() autofill_manager_->SetExternalDelegate(NULL); diff --git a/chrome/browser/autofill/autofill_merge_unittest.cc b/chrome/browser/autofill/autofill_merge_unittest.cc index 83430f4..2e51e2d 100644 --- a/chrome/browser/autofill/autofill_merge_unittest.cc +++ b/chrome/browser/autofill/autofill_merge_unittest.cc @@ -13,10 +13,10 @@ #include "chrome/browser/autofill/data_driven_test.h" #include "chrome/browser/autofill/form_structure.h" #include "chrome/browser/autofill/personal_data_manager.h" +#include "chrome/common/form_data.h" #include "googleurl/src/gurl.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputElement.h" -#include "webkit/forms/form_data.h" namespace { @@ -155,7 +155,7 @@ void AutofillMergeTest::MergeProfiles(const std::string& profiles, personal_data_.Reset(); // Create a test form. - webkit::forms::FormData form; + FormData form; form.name = ASCIIToUTF16("MyTestForm"); form.method = ASCIIToUTF16("POST"); form.origin = GURL("https://www.example.com/origin.html"); @@ -175,7 +175,7 @@ void AutofillMergeTest::MergeProfiles(const std::string& profiles, string16 field_type = UTF8ToUTF16(line.substr(0, separator_pos)); string16 value = UTF8ToUTF16(line.substr(separator_pos + kFieldOffset)); - webkit::forms::FormField field; + FormFieldData field; field.label = field_type; field.name = field_type; field.value = value; diff --git a/chrome/browser/autofill/autofill_metrics.cc b/chrome/browser/autofill/autofill_metrics.cc index aa8a805..960c7a6 100644 --- a/chrome/browser/autofill/autofill_metrics.cc +++ b/chrome/browser/autofill/autofill_metrics.cc @@ -9,7 +9,7 @@ #include "base/time.h" #include "chrome/browser/autofill/autofill_type.h" #include "chrome/browser/autofill/form_structure.h" -#include "webkit/forms/form_data.h" +#include "chrome/common/form_data.h" namespace { @@ -203,7 +203,7 @@ void LogServerExperimentId(const std::string& histogram_name, ServerExperiment metric = UNKNOWN_EXPERIMENT; const std::string default_experiment_name = - FormStructure(webkit::forms::FormData()).server_experiment_id(); + FormStructure(FormData()).server_experiment_id(); if (experiment_id.empty()) metric = NO_EXPERIMENT; else if (experiment_id == "ar06") diff --git a/chrome/browser/autofill/autofill_metrics_unittest.cc b/chrome/browser/autofill/autofill_metrics_unittest.cc index 8e31f33..c1d1b00 100644 --- a/chrome/browser/autofill/autofill_metrics_unittest.cc +++ b/chrome/browser/autofill/autofill_metrics_unittest.cc @@ -20,13 +20,13 @@ #include "chrome/browser/ui/tab_contents/tab_contents.h" #include "chrome/browser/ui/tab_contents/test_tab_contents.h" #include "chrome/browser/webdata/web_data_service.h" +#include "chrome/common/form_data.h" +#include "chrome/common/form_field_data.h" #include "chrome/test/base/testing_profile.h" #include "content/public/test/test_browser_thread.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/gfx/rect.h" -#include "webkit/forms/form_data.h" -#include "webkit/forms/form_field.h" using content::BrowserThread; using ::testing::_; @@ -34,8 +34,6 @@ using ::testing::AnyNumber; using ::testing::Mock; using base::TimeTicks; using base::TimeDelta; -using webkit::forms::FormData; -using webkit::forms::FormField; namespace { @@ -339,7 +337,7 @@ TEST_F(AutofillMetricsTest, QualityMetrics) { form.user_submitted = true; std::vector<AutofillFieldType> heuristic_types, server_types; - FormField field; + FormFieldData field; autofill_test::CreateTestFormField( "Autofilled", "autofilled", "Elvis Aaron Presley", "text", &field); @@ -554,7 +552,7 @@ TEST_F(AutofillMetricsTest, QualityMetricsForFailure) { std::vector<AutofillFieldType> heuristic_types, server_types; for (size_t i = 0; i < ARRAYSIZE_UNSAFE(failure_cases); ++i) { - FormField field; + FormFieldData field; autofill_test::CreateTestFormField(failure_cases[i].label, failure_cases[i].name, failure_cases[i].value, "text", &field); @@ -608,7 +606,7 @@ TEST_F(AutofillMetricsTest, SaneMetricsWithCacheMismatch) { std::vector<AutofillFieldType> heuristic_types, server_types; - FormField field; + FormFieldData field; autofill_test::CreateTestFormField( "Both match", "match", "Elvis Aaron Presley", "text", &field); field.is_autofilled = true; @@ -641,7 +639,7 @@ TEST_F(AutofillMetricsTest, SaneMetricsWithCacheMismatch) { // Add a field and re-arrange the remaining form fields before submitting. - std::vector<FormField> cached_fields = form.fields; + std::vector<FormFieldData> cached_fields = form.fields; form.fields.clear(); autofill_test::CreateTestFormField( "New field", "new field", "Tennessee", "text", &field); @@ -763,7 +761,7 @@ TEST_F(AutofillMetricsTest, NoQualityMetricsForNonAutofillableForms) { form.action = GURL("http://example.com/submit.html"); form.user_submitted = true; - FormField field; + FormFieldData field; autofill_test::CreateTestFormField( "Autofilled", "autofilled", "Elvis Presley", "text", &field); field.is_autofilled = true; @@ -804,7 +802,7 @@ TEST_F(AutofillMetricsTest, QualityMetricsWithExperimentId) { form.user_submitted = true; std::vector<AutofillFieldType> heuristic_types, server_types; - FormField field; + FormFieldData field; autofill_test::CreateTestFormField( "Autofilled", "autofilled", "Elvis Aaron Presley", "text", &field); @@ -956,7 +954,7 @@ TEST_F(AutofillMetricsTest, AddressSuggestionsCount) { form.action = GURL("http://example.com/submit.html"); form.user_submitted = true; - FormField field; + FormFieldData field; std::vector<AutofillFieldType> field_types; autofill_test::CreateTestFormField("Name", "name", "", "text", &field); form.fields.push_back(field); @@ -1130,7 +1128,7 @@ TEST_F(AutofillMetricsTest, UserHappinessFormLoadAndSubmission) { form.action = GURL("http://example.com/submit.html"); form.user_submitted = true; - FormField field; + FormFieldData field; autofill_test::CreateTestFormField("Name", "name", "", "text", &field); form.fields.push_back(field); autofill_test::CreateTestFormField("Email", "email", "", "text", &field); @@ -1264,7 +1262,7 @@ TEST_F(AutofillMetricsTest, UserHappinessFormInteraction) { form.action = GURL("http://example.com/submit.html"); form.user_submitted = true; - FormField field; + FormFieldData field; autofill_test::CreateTestFormField("Name", "name", "", "text", &field); form.fields.push_back(field); autofill_test::CreateTestFormField("Email", "email", "", "text", &field); @@ -1369,7 +1367,7 @@ TEST_F(AutofillMetricsTest, FormFillDuration) { form.action = GURL("http://example.com/submit.html"); form.user_submitted = true; - FormField field; + FormFieldData field; autofill_test::CreateTestFormField("Name", "name", "", "text", &field); form.fields.push_back(field); autofill_test::CreateTestFormField("Email", "email", "", "text", &field); diff --git a/chrome/browser/autofill/credit_card_field_unittest.cc b/chrome/browser/autofill/credit_card_field_unittest.cc index 37bd16d..efe1bb5 100644 --- a/chrome/browser/autofill/credit_card_field_unittest.cc +++ b/chrome/browser/autofill/credit_card_field_unittest.cc @@ -8,8 +8,8 @@ #include "chrome/browser/autofill/autofill_field.h" #include "chrome/browser/autofill/autofill_scanner.h" #include "chrome/browser/autofill/credit_card_field.h" +#include "chrome/common/form_field_data.h" #include "testing/gtest/include/gtest/gtest.h" -#include "webkit/forms/form_field.h" class CreditCardFieldTest : public testing::Test { public: @@ -43,7 +43,7 @@ TEST_F(CreditCardFieldTest, NonParse) { } TEST_F(CreditCardFieldTest, ParseCreditCardNoNumber) { - webkit::forms::FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("Exp Month"); @@ -60,7 +60,7 @@ TEST_F(CreditCardFieldTest, ParseCreditCardNoNumber) { } TEST_F(CreditCardFieldTest, ParseCreditCardNoDate) { - webkit::forms::FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("Card Number"); @@ -73,7 +73,7 @@ TEST_F(CreditCardFieldTest, ParseCreditCardNoDate) { } TEST_F(CreditCardFieldTest, ParseMiniumCreditCard) { - webkit::forms::FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("Card Number"); @@ -105,7 +105,7 @@ TEST_F(CreditCardFieldTest, ParseMiniumCreditCard) { } TEST_F(CreditCardFieldTest, ParseFullCreditCard) { - webkit::forms::FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("Name on Card"); @@ -151,7 +151,7 @@ TEST_F(CreditCardFieldTest, ParseFullCreditCard) { } TEST_F(CreditCardFieldTest, ParseExpMonthYear) { - webkit::forms::FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("Name on Card"); @@ -190,7 +190,7 @@ TEST_F(CreditCardFieldTest, ParseExpMonthYear) { } TEST_F(CreditCardFieldTest, ParseExpMonthYear2) { - webkit::forms::FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("Name on Card"); @@ -229,7 +229,7 @@ TEST_F(CreditCardFieldTest, ParseExpMonthYear2) { } TEST_F(CreditCardFieldTest, ParseExpField) { - webkit::forms::FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("Name on Card"); @@ -261,7 +261,7 @@ TEST_F(CreditCardFieldTest, ParseExpField) { } TEST_F(CreditCardFieldTest, ParseExpField2DigitYear) { - webkit::forms::FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("Name on Card"); @@ -293,7 +293,7 @@ TEST_F(CreditCardFieldTest, ParseExpField2DigitYear) { } TEST_F(CreditCardFieldTest, ParseCreditCardHolderNameWithCCFullName) { - webkit::forms::FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("Name"); diff --git a/chrome/browser/autofill/form_structure.cc b/chrome/browser/autofill/form_structure.cc index 5f19ed6..07af748 100644 --- a/chrome/browser/autofill/form_structure.cc +++ b/chrome/browser/autofill/form_structure.cc @@ -20,15 +20,11 @@ #include "chrome/browser/autofill/autofill_xml_parser.h" #include "chrome/browser/autofill/field_types.h" #include "chrome/browser/autofill/form_field.h" +#include "chrome/common/form_data.h" +#include "chrome/common/form_data_predictions.h" +#include "chrome/common/form_field_data.h" +#include "chrome/common/form_field_data_predictions.h" #include "third_party/libjingle/source/talk/xmllite/xmlelement.h" -#include "webkit/forms/form_data.h" -#include "webkit/forms/form_data_predictions.h" -#include "webkit/forms/form_field.h" -#include "webkit/forms/form_field_predictions.h" - -using webkit::forms::FormData; -using webkit::forms::FormDataPredictions; -using webkit::forms::FormFieldPredictions; namespace { @@ -244,7 +240,7 @@ FormStructure::FormStructure(const FormData& form) has_author_specified_types_(false) { // Copy the form fields. std::map<string16, size_t> unique_names; - for (std::vector<webkit::forms::FormField>::const_iterator field = + for (std::vector<FormFieldData>::const_iterator field = form.fields.begin(); field != form.fields.end(); field++) { // Add all supported form fields (including with empty names) to the @@ -487,9 +483,9 @@ void FormStructure::GetFieldTypePredictions( for (std::vector<AutofillField*>::const_iterator field = form_structure->fields_.begin(); field != form_structure->fields_.end(); ++field) { - form.data.fields.push_back(webkit::forms::FormField(**field)); + form.data.fields.push_back(FormFieldData(**field)); - FormFieldPredictions annotated_field; + FormFieldDataPredictions annotated_field; annotated_field.signature = (*field)->FieldSignature(); annotated_field.heuristic_type = AutofillType::FieldTypeToString((*field)->heuristic_type()); diff --git a/chrome/browser/autofill/form_structure.h b/chrome/browser/autofill/form_structure.h index 68223a8..fba3c1f 100644 --- a/chrome/browser/autofill/form_structure.h +++ b/chrome/browser/autofill/form_structure.h @@ -15,6 +15,8 @@ #include "chrome/browser/autofill/field_types.h" #include "googleurl/src/gurl.h" +struct FormData; +struct FormDataPredictions; enum RequestMethod { GET, @@ -37,18 +39,11 @@ namespace buzz { class XmlElement; } -namespace webkit { -namespace forms { -struct FormData; -struct FormDataPredictions; -} -} - // FormStructure stores a single HTML form together with the values entered // in the fields along with additional information needed by Autofill. class FormStructure { public: - explicit FormStructure(const webkit::forms::FormData& form); + explicit FormStructure(const FormData& form); virtual ~FormStructure(); // Runs several heuristics against the form fields to determine their possible @@ -79,7 +74,7 @@ class FormStructure { // fields' predicted types. static void GetFieldTypePredictions( const std::vector<FormStructure*>& form_structures, - std::vector<webkit::forms::FormDataPredictions>* forms); + std::vector<FormDataPredictions>* forms); // The unique signature for this form, composed of the target url domain, // the form name, and the form field names in a 64-bit hash. @@ -140,8 +135,8 @@ class FormStructure { virtual std::string server_experiment_id() const; - bool operator==(const webkit::forms::FormData& form) const; - bool operator!=(const webkit::forms::FormData& form) const; + bool operator==(const FormData& form) const; + bool operator!=(const FormData& form) const; private: friend class FormStructureTest; diff --git a/chrome/browser/autofill/form_structure_unittest.cc b/chrome/browser/autofill/form_structure_unittest.cc index 811c69e..64c8e17 100644 --- a/chrome/browser/autofill/form_structure_unittest.cc +++ b/chrome/browser/autofill/form_structure_unittest.cc @@ -6,18 +6,15 @@ #include "base/string_util.h" #include "base/utf_string_conversions.h" #include "chrome/browser/autofill/form_structure.h" +#include "chrome/common/form_data.h" +#include "chrome/common/form_field_data.h" #include "googleurl/src/gurl.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputElement.h" -#include "webkit/forms/form_data.h" -#include "webkit/forms/form_field.h" -using webkit::forms::FormData; -using webkit::forms::FormField; using WebKit::WebInputElement; -namespace webkit { -namespace forms { +namespace content { std::ostream& operator<<(std::ostream& os, const FormData& form) { os << UTF16ToUTF8(form.name) @@ -29,7 +26,7 @@ std::ostream& operator<<(std::ostream& os, const FormData& form) { << form.action.spec() << " "; - for (std::vector<webkit::forms::FormField>::const_iterator iter = + for (std::vector<FormFieldData>::const_iterator iter = form.fields.begin(); iter != form.fields.end(); ++iter) { os << *iter @@ -39,8 +36,7 @@ std::ostream& operator<<(std::ostream& os, const FormData& form) { return os; } -} // namespace forms -} // namespace webkit_glue +} // namespace content class FormStructureTest { public: @@ -53,7 +49,7 @@ TEST(FormStructureTest, FieldCount) { FormData form; form.method = ASCIIToUTF16("post"); - FormField field; + FormFieldData field; field.label = ASCIIToUTF16("username"); field.name = ASCIIToUTF16("username"); field.form_control_type = ASCIIToUTF16("text"); @@ -79,7 +75,7 @@ TEST(FormStructureTest, AutofillCount) { FormData form; form.method = ASCIIToUTF16("post"); - FormField field; + FormFieldData field; field.label = ASCIIToUTF16("username"); field.name = ASCIIToUTF16("username"); field.form_control_type = ASCIIToUTF16("text"); @@ -123,7 +119,7 @@ TEST(FormStructureTest, IsAutofillable) { // We need at least three text fields to be auto-fillable. form.method = ASCIIToUTF16("post"); - FormField field; + FormFieldData field; field.label = ASCIIToUTF16("username"); field.name = ASCIIToUTF16("username"); field.form_control_type = ASCIIToUTF16("text"); @@ -197,7 +193,7 @@ TEST(FormStructureTest, ShouldBeParsed) { // We need at least three text fields to be parseable. form.method = ASCIIToUTF16("post"); - FormField field; + FormFieldData field; field.label = ASCIIToUTF16("username"); field.name = ASCIIToUTF16("username"); field.form_control_type = ASCIIToUTF16("text"); @@ -270,7 +266,7 @@ TEST(FormStructureTest, HeuristicsContactInfo) { FormData form; form.method = ASCIIToUTF16("post"); - FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("First Name"); @@ -339,7 +335,7 @@ TEST(FormStructureTest, HeuristicsAutocompletetype) { FormData form; form.method = ASCIIToUTF16("post"); - FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = string16(); @@ -377,7 +373,7 @@ TEST(FormStructureTest, HeuristicsAutocompletetypePhones) { FormData form; form.method = ASCIIToUTF16("post"); - FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = string16(); @@ -421,7 +417,7 @@ TEST(FormStructureTest, AutocompletetypeOverridesOtherHeuristics) { form.method = ASCIIToUTF16("post"); // Start with a regular contact form. - FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("First Name"); @@ -470,7 +466,7 @@ TEST(FormStructureTest, HeuristicsAutocompletetypeWithSections) { FormData form; form.method = ASCIIToUTF16("post"); - FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); // We expect "shipping" and "billing" to be the most common sections. @@ -542,7 +538,7 @@ TEST(FormStructureTest, HeuristicsAutocompletetypeWithFallbacks) { FormData form; form.method = ASCIIToUTF16("post"); - FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); // Skip over any sections and "x"-prefixed types. @@ -590,7 +586,7 @@ TEST(FormStructureTest, HeuristicsSample8) { FormData form; form.method = ASCIIToUTF16("post"); - FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("Your First Name:"); @@ -669,7 +665,7 @@ TEST(FormStructureTest, HeuristicsSample6) { FormData form; form.method = ASCIIToUTF16("post"); - FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("E-mail address"); @@ -725,14 +721,14 @@ TEST(FormStructureTest, HeuristicsSample6) { } // Tests a sequence of FormFields where only labels are supplied to heuristics -// for matching. This works because FormField labels are matched in the case -// that input element ids (or |name| fields) are missing. +// for matching. This works because FormFieldData labels are matched in the +// case that input element ids (or |name| fields) are missing. TEST(FormStructureTest, HeuristicsLabelsOnly) { scoped_ptr<FormStructure> form_structure; FormData form; form.method = ASCIIToUTF16("post"); - FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("First Name"); @@ -798,7 +794,7 @@ TEST(FormStructureTest, HeuristicsCreditCardInfo) { FormData form; form.method = ASCIIToUTF16("post"); - FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("Name on Card"); @@ -852,7 +848,7 @@ TEST(FormStructureTest, HeuristicsCreditCardInfoWithUnknownCardField) { FormData form; form.method = ASCIIToUTF16("post"); - FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("Name on Card"); @@ -914,7 +910,7 @@ TEST(FormStructureTest, ThreeAddressLines) { FormData form; form.method = ASCIIToUTF16("post"); - FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("Address Line1"); @@ -956,7 +952,7 @@ TEST(FormStructureTest, BillingAndShippingAddresses) { FormData form; form.method = ASCIIToUTF16("post"); - FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("Address Line1"); @@ -1002,7 +998,7 @@ TEST(FormStructureTest, ThreeAddressLinesExpedia) { FormData form; form.method = ASCIIToUTF16("post"); - FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("Street:"); @@ -1045,7 +1041,7 @@ TEST(FormStructureTest, TwoAddressLinesEbay) { FormData form; form.method = ASCIIToUTF16("post"); - FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("Address Line1"); @@ -1079,7 +1075,7 @@ TEST(FormStructureTest, HeuristicsStateWithProvince) { FormData form; form.method = ASCIIToUTF16("post"); - FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("Address Line1"); @@ -1114,7 +1110,7 @@ TEST(FormStructureTest, HeuristicsWithBilling) { FormData form; form.method = ASCIIToUTF16("post"); - FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("First Name*:"); @@ -1187,7 +1183,7 @@ TEST(FormStructureTest, ThreePartPhoneNumber) { FormData form; form.method = ASCIIToUTF16("post"); - FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("Phone:"); @@ -1235,7 +1231,7 @@ TEST(FormStructureTest, HeuristicsInfernoCC) { FormData form; form.method = ASCIIToUTF16("post"); - FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("Name on Card"); @@ -1284,7 +1280,7 @@ TEST(FormStructureTest, CVCCodeClash) { FormData form; form.method = ASCIIToUTF16("post"); - FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("Card number"); @@ -1338,7 +1334,7 @@ TEST(FormStructureTest, EncodeQueryRequest) { FormData form; form.method = ASCIIToUTF16("post"); - FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("Name on Card"); @@ -1453,7 +1449,7 @@ TEST(FormStructureTest, EncodeUploadRequest) { form_structure.reset(new FormStructure(form)); form_structure->DetermineHeuristicTypes(); - FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("First Name"); @@ -1599,7 +1595,7 @@ TEST(FormStructureTest, CheckDataPresence) { FormData form; form.method = ASCIIToUTF16("post"); - FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("First Name"); @@ -1853,7 +1849,7 @@ TEST(FormStructureTest, CheckMultipleTypes) { FormData form; form.method = ASCIIToUTF16("post"); - FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("email"); @@ -1959,7 +1955,7 @@ TEST(FormStructureTest, CheckFormSignature) { FormData form; form.method = ASCIIToUTF16("post"); - FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("email"); diff --git a/chrome/browser/autofill/name_field_unittest.cc b/chrome/browser/autofill/name_field_unittest.cc index 3c703f3..2c7b87e 100644 --- a/chrome/browser/autofill/name_field_unittest.cc +++ b/chrome/browser/autofill/name_field_unittest.cc @@ -8,8 +8,8 @@ #include "chrome/browser/autofill/autofill_field.h" #include "chrome/browser/autofill/autofill_scanner.h" #include "chrome/browser/autofill/name_field.h" +#include "chrome/common/form_field_data.h" #include "testing/gtest/include/gtest/gtest.h" -#include "webkit/forms/form_field.h" class NameFieldTest : public testing::Test { public: @@ -30,7 +30,7 @@ class NameFieldTest : public testing::Test { }; TEST_F(NameFieldTest, FirstMiddleLast) { - webkit::forms::FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("First Name"); @@ -61,7 +61,7 @@ TEST_F(NameFieldTest, FirstMiddleLast) { } TEST_F(NameFieldTest, FirstMiddleLast2) { - webkit::forms::FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = string16(); @@ -92,7 +92,7 @@ TEST_F(NameFieldTest, FirstMiddleLast2) { } TEST_F(NameFieldTest, FirstLast) { - webkit::forms::FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = string16(); @@ -116,7 +116,7 @@ TEST_F(NameFieldTest, FirstLast) { } TEST_F(NameFieldTest, FirstLast2) { - webkit::forms::FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("Name"); @@ -140,7 +140,7 @@ TEST_F(NameFieldTest, FirstLast2) { } TEST_F(NameFieldTest, FirstLastMiddleWithSpaces) { - webkit::forms::FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("First Name"); @@ -171,7 +171,7 @@ TEST_F(NameFieldTest, FirstLastMiddleWithSpaces) { } TEST_F(NameFieldTest, FirstLastEmpty) { - webkit::forms::FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("Name"); @@ -195,7 +195,7 @@ TEST_F(NameFieldTest, FirstLastEmpty) { } TEST_F(NameFieldTest, FirstMiddleLastEmpty) { - webkit::forms::FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("Name"); @@ -226,7 +226,7 @@ TEST_F(NameFieldTest, FirstMiddleLastEmpty) { } TEST_F(NameFieldTest, MiddleInitial) { - webkit::forms::FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("First Name"); @@ -257,7 +257,7 @@ TEST_F(NameFieldTest, MiddleInitial) { } TEST_F(NameFieldTest, MiddleInitialNoLastName) { - webkit::forms::FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("First Name"); @@ -276,7 +276,7 @@ TEST_F(NameFieldTest, MiddleInitialNoLastName) { // This case is from the dell.com checkout page. The middle initial "mi" string // came at the end following other descriptive text. http://crbug.com/45123. TEST_F(NameFieldTest, MiddleInitialAtEnd) { - webkit::forms::FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = string16(); diff --git a/chrome/browser/autofill/password_autofill_manager.cc b/chrome/browser/autofill/password_autofill_manager.cc index d05ec84..f7f36d0 100644 --- a/chrome/browser/autofill/password_autofill_manager.cc +++ b/chrome/browser/autofill/password_autofill_manager.cc @@ -19,9 +19,9 @@ PasswordAutofillManager::~PasswordAutofillManager() { } bool PasswordAutofillManager::DidAcceptAutofillSuggestion( - const webkit::forms::FormField& field, + const FormFieldData& field, const string16& value) { - webkit::forms::PasswordFormFillData password; + PasswordFormFillData password; if (!FindLoginInfo(field, &password)) return false; @@ -40,8 +40,8 @@ bool PasswordAutofillManager::DidAcceptAutofillSuggestion( } void PasswordAutofillManager::AddPasswordFormMapping( - const webkit::forms::FormField& username_element, - const webkit::forms::PasswordFormFillData& password) { + const FormFieldData& username_element, + const PasswordFormFillData& password) { login_to_password_info_[username_element] = password; } @@ -54,13 +54,13 @@ void PasswordAutofillManager::Reset() { bool PasswordAutofillManager::WillFillUserNameAndPassword( const string16& current_username, - const webkit::forms::PasswordFormFillData& fill_data) { + const PasswordFormFillData& fill_data) { // Look for any suitable matches to current field text. if (fill_data.basic_data.fields[0].value == current_username) { return true; } 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 (iter->first == current_username) @@ -72,8 +72,8 @@ bool PasswordAutofillManager::WillFillUserNameAndPassword( } bool PasswordAutofillManager::FindLoginInfo( - const webkit::forms::FormField& field, - webkit::forms::PasswordFormFillData* found_password) { + const FormFieldData& field, + PasswordFormFillData* found_password) { LoginToPasswordInfoMap::iterator iter = login_to_password_info_.find(field); if (iter == login_to_password_info_.end()) return false; diff --git a/chrome/browser/autofill/password_autofill_manager.h b/chrome/browser/autofill/password_autofill_manager.h index 8cb6bca..7326f68 100644 --- a/chrome/browser/autofill/password_autofill_manager.h +++ b/chrome/browser/autofill/password_autofill_manager.h @@ -14,7 +14,7 @@ #include <map> -#include "webkit/forms/password_form_dom_manager.h" +#include "chrome/common/password_form_fill_data.h" namespace content { class WebContents; @@ -28,13 +28,13 @@ class PasswordAutofillManager { // Fills the password associated with user name |value|. Returns true if the // username and password fields were filled, false otherwise. - bool DidAcceptAutofillSuggestion(const webkit::forms::FormField& field, + bool DidAcceptAutofillSuggestion(const FormFieldData& field, const string16& value); // Invoked when a password mapping is added. void AddPasswordFormMapping( - const webkit::forms::FormField& username_element, - const webkit::forms::PasswordFormFillData& password); + const FormFieldData& username_element, + const PasswordFormFillData& password); // Invoked to clear any page specific cached values. void Reset(); @@ -43,19 +43,19 @@ class PasswordAutofillManager { // TODO(csharp): Modify the AutofillExternalDeletegate code so that it can // figure out if a entry is a password one without using this mapping. // crbug.com/118601 - typedef std::map<webkit::forms::FormField, - webkit::forms::PasswordFormFillData> + typedef std::map<FormFieldData, + PasswordFormFillData> LoginToPasswordInfoMap; // Returns true if |current_username| matches a username for one of the // login mappings in |password|. bool WillFillUserNameAndPassword( const string16& current_username, - const webkit::forms::PasswordFormFillData& password); + const PasswordFormFillData& password); // Finds login information for a |node| that was previously filled. - bool FindLoginInfo(const webkit::forms::FormField& field, - webkit::forms::PasswordFormFillData* found_password); + bool FindLoginInfo(const FormFieldData& field, + PasswordFormFillData* found_password); // The logins we have filled so far with their associated info. LoginToPasswordInfoMap login_to_password_info_; diff --git a/chrome/browser/autofill/password_autofill_manager_unittest.cc b/chrome/browser/autofill/password_autofill_manager_unittest.cc index 35ca066..f7305a7 100644 --- a/chrome/browser/autofill/password_autofill_manager_unittest.cc +++ b/chrome/browser/autofill/password_autofill_manager_unittest.cc @@ -34,7 +34,7 @@ class PasswordAutofillManagerTest : public testing::Test { username_field_.value = username1; fill_data_.basic_data.fields.push_back(username_field_); - webkit::forms::FormField password_field; + FormFieldData password_field; password_field.name = ASCIIToUTF16(kPasswordName); password_field.value = password1; fill_data_.basic_data.fields.push_back(password_field); @@ -47,11 +47,11 @@ class PasswordAutofillManagerTest : public testing::Test { return &password_autofill_manager_; } - const webkit::forms::FormField& username_field() { return username_field_; } + const FormFieldData& username_field() { return username_field_; } private: - webkit::forms::PasswordFormFillData fill_data_; - webkit::forms::FormField username_field_; + PasswordFormFillData fill_data_; + FormFieldData username_field_; PasswordAutofillManager password_autofill_manager_; }; @@ -62,7 +62,7 @@ TEST_F(PasswordAutofillManagerTest, DidAcceptAutofillSuggestion) { EXPECT_FALSE(password_autofill_manager()->DidAcceptAutofillSuggestion( username_field(), ASCIIToUTF16(kInvalidUsername))); - webkit::forms::FormField invalid_username_field; + FormFieldData invalid_username_field; invalid_username_field.name = ASCIIToUTF16(kInvalidUsername); EXPECT_FALSE(password_autofill_manager()->DidAcceptAutofillSuggestion( diff --git a/chrome/browser/autofill/personal_data_manager_unittest.cc b/chrome/browser/autofill/personal_data_manager_unittest.cc index 3b4b1c6..c20624e 100644 --- a/chrome/browser/autofill/personal_data_manager_unittest.cc +++ b/chrome/browser/autofill/personal_data_manager_unittest.cc @@ -17,6 +17,7 @@ #include "chrome/browser/password_manager/encryptor.h" #include "chrome/browser/webdata/web_data_service.h" #include "chrome/browser/webdata/web_data_service_factory.h" +#include "chrome/common/form_data.h" #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_profile.h" #include "content/public/browser/notification_details.h" @@ -27,10 +28,8 @@ #include "content/public/test/test_browser_thread.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -#include "webkit/forms/form_data.h" using content::BrowserThread; -using webkit::forms::FormData; ACTION(QuitUIMessageLoop) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); @@ -483,7 +482,7 @@ TEST_F(PersonalDataManagerTest, Refresh) { TEST_F(PersonalDataManagerTest, ImportFormData) { FormData form; - webkit::forms::FormField field; + FormFieldData field; autofill_test::CreateTestFormField( "First name:", "first_name", "George", "text", &field); form.fields.push_back(field); @@ -528,7 +527,7 @@ TEST_F(PersonalDataManagerTest, ImportFormData) { TEST_F(PersonalDataManagerTest, ImportFormDataBadEmail) { FormData form; - webkit::forms::FormField field; + FormFieldData field; autofill_test::CreateTestFormField( "First name:", "first_name", "George", "text", &field); form.fields.push_back(field); @@ -563,7 +562,7 @@ TEST_F(PersonalDataManagerTest, ImportFormDataBadEmail) { TEST_F(PersonalDataManagerTest, ImportFormDataNotEnoughFilledFields) { FormData form; - webkit::forms::FormField field; + FormFieldData field; autofill_test::CreateTestFormField( "First name:", "first_name", "George", "text", &field); form.fields.push_back(field); @@ -588,7 +587,7 @@ TEST_F(PersonalDataManagerTest, ImportFormDataNotEnoughFilledFields) { TEST_F(PersonalDataManagerTest, ImportPhoneNumberSplitAcrossMultipleFields) { FormData form; - webkit::forms::FormField field; + FormFieldData field; autofill_test::CreateTestFormField( "First name:", "first_name", "George", "text", &field); form.fields.push_back(field); @@ -679,7 +678,7 @@ TEST_F(PersonalDataManagerTest, SetUniqueCreditCardLabels) { TEST_F(PersonalDataManagerTest, AggregateTwoDifferentProfiles) { FormData form1; - webkit::forms::FormField field; + FormFieldData field; autofill_test::CreateTestFormField( "First name:", "first_name", "George", "text", &field); form1.fields.push_back(field); @@ -770,7 +769,7 @@ TEST_F(PersonalDataManagerTest, AggregateTwoDifferentProfiles) { TEST_F(PersonalDataManagerTest, AggregateTwoProfilesWithMultiValue) { FormData form1; - webkit::forms::FormField field; + FormFieldData field; autofill_test::CreateTestFormField( "First name:", "first_name", "George", "text", &field); form1.fields.push_back(field); @@ -865,7 +864,7 @@ TEST_F(PersonalDataManagerTest, AggregateTwoProfilesWithMultiValue) { TEST_F(PersonalDataManagerTest, AggregateSameProfileWithConflict) { FormData form1; - webkit::forms::FormField field; + FormFieldData field; autofill_test::CreateTestFormField( "First name:", "first_name", "George", "text", &field); form1.fields.push_back(field); @@ -975,7 +974,7 @@ TEST_F(PersonalDataManagerTest, AggregateSameProfileWithConflict) { TEST_F(PersonalDataManagerTest, AggregateProfileWithMissingInfoInOld) { FormData form1; - webkit::forms::FormField field; + FormFieldData field; autofill_test::CreateTestFormField( "First name:", "first_name", "George", "text", &field); form1.fields.push_back(field); @@ -1062,7 +1061,7 @@ TEST_F(PersonalDataManagerTest, AggregateProfileWithMissingInfoInOld) { TEST_F(PersonalDataManagerTest, AggregateProfileWithMissingInfoInNew) { FormData form1; - webkit::forms::FormField field; + FormFieldData field; autofill_test::CreateTestFormField( "First name:", "first_name", "George", "text", &field); form1.fields.push_back(field); @@ -1153,7 +1152,7 @@ TEST_F(PersonalDataManagerTest, AggregateProfileWithMissingInfoInNew) { TEST_F(PersonalDataManagerTest, AggregateProfileWithInsufficientAddress) { FormData form1; - webkit::forms::FormField field; + FormFieldData field; autofill_test::CreateTestFormField( "First name:", "first_name", "George", "text", &field); form1.fields.push_back(field); @@ -1203,7 +1202,7 @@ TEST_F(PersonalDataManagerTest, AggregateExistingAuxiliaryProfile) { // Simulate a form submission with a subset of the info. // Note that the phone number format is different from the saved format. FormData form; - webkit::forms::FormField field; + FormFieldData field; autofill_test::CreateTestFormField( "First name:", "first_name", "Tester", "text", &field); form.fields.push_back(field); @@ -1250,7 +1249,7 @@ TEST_F(PersonalDataManagerTest, AggregateTwoDifferentCreditCards) { FormData form1; // Start with a single valid credit card form. - webkit::forms::FormField field; + FormFieldData field; autofill_test::CreateTestFormField( "Name on card:", "name_on_card", "Biggie Smalls", "text", &field); form1.fields.push_back(field); @@ -1326,7 +1325,7 @@ TEST_F(PersonalDataManagerTest, AggregateInvalidCreditCard) { FormData form1; // Start with a single valid credit card form. - webkit::forms::FormField field; + FormFieldData field; autofill_test::CreateTestFormField( "Name on card:", "name_on_card", "Biggie Smalls", "text", &field); form1.fields.push_back(field); @@ -1393,7 +1392,7 @@ TEST_F(PersonalDataManagerTest, AggregateSameCreditCardWithConflict) { FormData form1; // Start with a single valid credit card form. - webkit::forms::FormField field; + FormFieldData field; autofill_test::CreateTestFormField( "Name on card:", "name_on_card", "Biggie Smalls", "text", &field); form1.fields.push_back(field); @@ -1469,7 +1468,7 @@ TEST_F(PersonalDataManagerTest, AggregateEmptyCreditCardWithConflict) { FormData form1; // Start with a single valid credit card form. - webkit::forms::FormField field; + FormFieldData field; autofill_test::CreateTestFormField( "Name on card:", "name_on_card", "Biggie Smalls", "text", &field); form1.fields.push_back(field); @@ -1537,7 +1536,7 @@ TEST_F(PersonalDataManagerTest, AggregateCreditCardWithMissingInfoInNew) { FormData form1; // Start with a single valid credit card form. - webkit::forms::FormField field; + FormFieldData field; autofill_test::CreateTestFormField( "Name on card:", "name_on_card", "Biggie Smalls", "text", &field); form1.fields.push_back(field); @@ -1653,7 +1652,7 @@ TEST_F(PersonalDataManagerTest, AggregateCreditCardWithMissingInfoInOld) { // Add a second different valid credit card where the year is different but // the credit card number matches. FormData form; - webkit::forms::FormField field; + FormFieldData field; autofill_test::CreateTestFormField( "Name on card:", "name_on_card", "Biggie Smalls", "text", &field); form.fields.push_back(field); @@ -1710,7 +1709,7 @@ TEST_F(PersonalDataManagerTest, AggregateSameCreditCardWithSeparators) { // Import the same card info, but with different separators in the number. FormData form; - webkit::forms::FormField field; + FormFieldData field; autofill_test::CreateTestFormField( "Name on card:", "name_on_card", "Biggie Smalls", "text", &field); form.fields.push_back(field); @@ -1864,7 +1863,7 @@ TEST_F(PersonalDataManagerTest, GetNonEmptyTypes) { TEST_F(PersonalDataManagerTest, CaseInsensitiveMultiValueAggregation) { FormData form1; - webkit::forms::FormField field; + FormFieldData field; autofill_test::CreateTestFormField( "First name:", "first_name", "George", "text", &field); form1.fields.push_back(field); diff --git a/chrome/browser/autofill/phone_field_unittest.cc b/chrome/browser/autofill/phone_field_unittest.cc index cd8baf5..5bfbace 100644 --- a/chrome/browser/autofill/phone_field_unittest.cc +++ b/chrome/browser/autofill/phone_field_unittest.cc @@ -8,8 +8,8 @@ #include "chrome/browser/autofill/autofill_field.h" #include "chrome/browser/autofill/autofill_scanner.h" #include "chrome/browser/autofill/phone_field.h" +#include "chrome/common/form_field_data.h" #include "testing/gtest/include/gtest/gtest.h" -#include "webkit/forms/form_field.h" class PhoneFieldTest : public testing::Test { public: @@ -43,7 +43,7 @@ TEST_F(PhoneFieldTest, NonParse) { } TEST_F(PhoneFieldTest, ParseOneLinePhone) { - webkit::forms::FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("Phone"); @@ -60,7 +60,7 @@ TEST_F(PhoneFieldTest, ParseOneLinePhone) { } TEST_F(PhoneFieldTest, ParseTwoLinePhone) { - webkit::forms::FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("Area Code"); @@ -89,7 +89,7 @@ TEST_F(PhoneFieldTest, ThreePartPhoneNumber) { // <country code> - <area code> - <phone>. The only distinguishing feature is // size: <prefix> is no bigger than 3 characters, and <suffix> is no bigger // than 4. - webkit::forms::FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("Phone:"); @@ -133,7 +133,7 @@ TEST_F(PhoneFieldTest, ThreePartPhoneNumber) { // encountered in http://crbug.com/40694 with page // https://www.wrapables.com/jsp/Signup.jsp. TEST_F(PhoneFieldTest, ThreePartPhoneNumberPrefixSuffix) { - webkit::forms::FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("Phone:"); @@ -164,7 +164,7 @@ TEST_F(PhoneFieldTest, ThreePartPhoneNumberPrefixSuffix) { } TEST_F(PhoneFieldTest, ThreePartPhoneNumberPrefixSuffix2) { - webkit::forms::FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("("); @@ -200,7 +200,7 @@ TEST_F(PhoneFieldTest, ThreePartPhoneNumberPrefixSuffix2) { TEST_F(PhoneFieldTest, CountryAndCityAndPhoneNumber) { // Phone in format <country code>:3 - <city and number>:10 // The |maxlength| is considered, otherwise it's too broad. - webkit::forms::FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("text"); field.label = ASCIIToUTF16("Phone Number"); diff --git a/chrome/browser/autofill/select_control_handler.cc b/chrome/browser/autofill/select_control_handler.cc index 682ebff..d602911 100644 --- a/chrome/browser/autofill/select_control_handler.cc +++ b/chrome/browser/autofill/select_control_handler.cc @@ -13,7 +13,7 @@ #include "chrome/browser/autofill/autofill_country.h" #include "chrome/browser/autofill/autofill_profile.h" #include "chrome/browser/autofill/form_group.h" -#include "webkit/forms/form_field.h" +#include "chrome/common/form_field_data.h" namespace { @@ -120,7 +120,7 @@ const char* const kMonthsNumeric[] = { // Returns true if the value was successfully set, meaning |value| was found in // the list of select options in |field|. bool SetSelectControlValue(const string16& value, - webkit::forms::FormField* field) { + FormFieldData* field) { string16 value_lowercase = StringToLowerASCII(value); DCHECK_EQ(field->option_values.size(), field->option_contents.size()); @@ -136,7 +136,7 @@ bool SetSelectControlValue(const string16& value, } bool FillStateSelectControl(const string16& value, - webkit::forms::FormField* field) { + FormFieldData* field) { string16 abbrev, full; if (value.size() < 4U) { abbrev = value; @@ -157,7 +157,7 @@ bool FillStateSelectControl(const string16& value, } bool FillCountrySelectControl(const FormGroup& form_group, - webkit::forms::FormField* field) { + FormFieldData* field) { const AutofillProfile& profile = static_cast<const AutofillProfile&>(form_group); std::string country_code = profile.CountryCode(); @@ -180,7 +180,7 @@ bool FillCountrySelectControl(const FormGroup& form_group, } bool FillExpirationMonthSelectControl(const string16& value, - webkit::forms::FormField* field) { + FormFieldData* field) { int index = 0; if (!base::StringToInt(value, &index) || index <= 0 || @@ -200,7 +200,7 @@ namespace autofill { void FillSelectControl(const FormGroup& form_group, AutofillFieldType type, - webkit::forms::FormField* field) { + FormFieldData* field) { DCHECK(field); DCHECK_EQ(ASCIIToUTF16("select-one"), field->form_control_type); DCHECK_EQ(field->option_values.size(), field->option_contents.size()); diff --git a/chrome/browser/autofill/select_control_handler.h b/chrome/browser/autofill/select_control_handler.h index e54d4ed..34f4076 100644 --- a/chrome/browser/autofill/select_control_handler.h +++ b/chrome/browser/autofill/select_control_handler.h @@ -10,11 +10,7 @@ class FormGroup; -namespace webkit { -namespace forms { -struct FormField; -} -} +struct FormFieldData; namespace autofill { @@ -24,7 +20,7 @@ namespace autofill { // months, e.g., (04, April). void FillSelectControl(const FormGroup& form_group, AutofillFieldType type, - webkit::forms::FormField* field); + FormFieldData* field); // Returns true if |value| is a valid US state name or abbreviation. It is case // insensitive. Valid for US states only. diff --git a/chrome/browser/autofill/select_control_handler_unittest.cc b/chrome/browser/autofill/select_control_handler_unittest.cc index 2977655..7d74ab6 100644 --- a/chrome/browser/autofill/select_control_handler_unittest.cc +++ b/chrome/browser/autofill/select_control_handler_unittest.cc @@ -8,8 +8,8 @@ #include "chrome/browser/autofill/autofill_type.h" #include "chrome/browser/autofill/credit_card.h" #include "chrome/browser/autofill/select_control_handler.h" +#include "chrome/common/form_field_data.h" #include "testing/gtest/include/gtest/gtest.h" -#include "webkit/forms/form_field.h" typedef testing::Test SelectControlHandlerTest; @@ -21,7 +21,7 @@ TEST_F(SelectControlHandlerTest, CreditCardMonthExact) { for (size_t i = 0; i < arraysize(kMonthsNumeric); ++i) options[i] = ASCIIToUTF16(kMonthsNumeric[i]); - webkit::forms::FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("select-one"); field.option_values = options; field.option_contents = options; @@ -41,7 +41,7 @@ TEST_F(SelectControlHandlerTest, CreditCardMonthAbbreviated) { for (size_t i = 0; i < arraysize(kMonthsAbbreviated); ++i) options[i] = ASCIIToUTF16(kMonthsAbbreviated[i]); - webkit::forms::FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("select-one"); field.option_values = options; field.option_contents = options; @@ -61,7 +61,7 @@ TEST_F(SelectControlHandlerTest, CreditCardMonthFull) { for (size_t i = 0; i < arraysize(kMonthsFull); ++i) options[i] = ASCIIToUTF16(kMonthsFull[i]); - webkit::forms::FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("select-one"); field.option_values = options; field.option_contents = options; @@ -80,7 +80,7 @@ TEST_F(SelectControlHandlerTest, CreditCardMonthNumeric) { for (size_t i = 0; i < arraysize(kMonthsNumeric); ++i) options[i] = ASCIIToUTF16(kMonthsNumeric[i]); - webkit::forms::FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("select-one"); field.option_values = options; field.option_contents = options; @@ -99,7 +99,7 @@ TEST_F(SelectControlHandlerTest, AddressCountryFull) { for (size_t i = 0; i < arraysize(kCountries); ++i) options[i] = ASCIIToUTF16(kCountries[i]); - webkit::forms::FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("select-one"); field.option_values = options; field.option_contents = options; @@ -118,7 +118,7 @@ TEST_F(SelectControlHandlerTest, AddressCountryAbbrev) { for (size_t i = 0; i < arraysize(kCountries); ++i) options[i] = ASCIIToUTF16(kCountries[i]); - webkit::forms::FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("select-one"); field.option_values = options; field.option_contents = options; @@ -137,7 +137,7 @@ TEST_F(SelectControlHandlerTest, AddressStateFull) { for (size_t i = 0; i < arraysize(kStates); ++i) options[i] = ASCIIToUTF16(kStates[i]); - webkit::forms::FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("select-one"); field.option_values = options; field.option_contents = options; @@ -156,7 +156,7 @@ TEST_F(SelectControlHandlerTest, AddressStateAbbrev) { for (size_t i = 0; i < arraysize(kStates); ++i) options[i] = ASCIIToUTF16(kStates[i]); - webkit::forms::FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("select-one"); field.option_values = options; field.option_contents = options; @@ -178,7 +178,7 @@ TEST_F(SelectControlHandlerTest, FillByValue) { contents[i] = ASCIIToUTF16(base::StringPrintf("%d", static_cast<int>(i))); } - webkit::forms::FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("select-one"); field.option_values = values; field.option_contents = contents; @@ -200,7 +200,7 @@ TEST_F(SelectControlHandlerTest, FillByContents) { contents[i] = ASCIIToUTF16(kStates[i]); } - webkit::forms::FormField field; + FormFieldData field; field.form_control_type = ASCIIToUTF16("select-one"); field.option_values = values; field.option_contents = contents; diff --git a/chrome/browser/autofill/test_autofill_external_delegate.cc b/chrome/browser/autofill/test_autofill_external_delegate.cc index 6815477..f5f6a74 100644 --- a/chrome/browser/autofill/test_autofill_external_delegate.cc +++ b/chrome/browser/autofill/test_autofill_external_delegate.cc @@ -18,8 +18,8 @@ void TestAutofillExternalDelegate::ApplyAutofillSuggestions( void TestAutofillExternalDelegate::OnQueryPlatformSpecific( int query_id, - const webkit::forms::FormData& form, - const webkit::forms::FormField& field, + const FormData& form, + const FormFieldData& field, const gfx::Rect& bounds) {} void TestAutofillExternalDelegate::HideAutofillPopupInternal() {} diff --git a/chrome/browser/autofill/test_autofill_external_delegate.h b/chrome/browser/autofill/test_autofill_external_delegate.h index 56725ed..f06b3f9 100644 --- a/chrome/browser/autofill/test_autofill_external_delegate.h +++ b/chrome/browser/autofill/test_autofill_external_delegate.h @@ -26,8 +26,8 @@ class TestAutofillExternalDelegate : public AutofillExternalDelegate { const std::vector<int>& autofill_unique_ids) OVERRIDE; virtual void OnQueryPlatformSpecific(int query_id, - const webkit::forms::FormData& form, - const webkit::forms::FormField& field, + const FormData& form, + const FormFieldData& field, const gfx::Rect& bounds) OVERRIDE; diff --git a/chrome/browser/automation/automation_provider_observers.cc b/chrome/browser/automation/automation_provider_observers.cc index b3bc8c1..e277c97 100644 --- a/chrome/browser/automation/automation_provider_observers.cc +++ b/chrome/browser/automation/automation_provider_observers.cc @@ -1589,7 +1589,7 @@ AutomationProviderGetPasswordsObserver:: void AutomationProviderGetPasswordsObserver::OnPasswordStoreRequestDone( CancelableRequestProvider::Handle handle, - const std::vector<webkit::forms::PasswordForm*>& result) { + const std::vector<content::PasswordForm*>& result) { if (!provider_) { delete this; return; @@ -1598,10 +1598,10 @@ void AutomationProviderGetPasswordsObserver::OnPasswordStoreRequestDone( scoped_ptr<DictionaryValue> return_value(new DictionaryValue); ListValue* passwords = new ListValue; - for (std::vector<webkit::forms::PasswordForm*>::const_iterator it = + for (std::vector<content::PasswordForm*>::const_iterator it = result.begin(); it != result.end(); ++it) { DictionaryValue* password_val = new DictionaryValue; - webkit::forms::PasswordForm* password_form = *it; + content::PasswordForm* password_form = *it; password_val->SetString("username_value", password_form->username_value); password_val->SetString("password_value", password_form->password_value); password_val->SetString("signon_realm", password_form->signon_realm); diff --git a/chrome/browser/automation/automation_provider_observers.h b/chrome/browser/automation/automation_provider_observers.h index 71f5041..ae2b220 100644 --- a/chrome/browser/automation/automation_provider_observers.h +++ b/chrome/browser/automation/automation_provider_observers.h @@ -1187,7 +1187,7 @@ class AutomationProviderGetPasswordsObserver : public PasswordStoreConsumer { virtual void OnPasswordStoreRequestDone( CancelableRequestProvider::Handle handle, - const std::vector<webkit::forms::PasswordForm*>& result) OVERRIDE; + const std::vector<content::PasswordForm*>& result) OVERRIDE; private: base::WeakPtr<AutomationProvider> provider_; diff --git a/chrome/browser/automation/testing_automation_provider.cc b/chrome/browser/automation/testing_automation_provider.cc index 8943336a..4417e35 100644 --- a/chrome/browser/automation/testing_automation_provider.cc +++ b/chrome/browser/automation/testing_automation_provider.cc @@ -3400,7 +3400,7 @@ void TestingAutomationProvider::ImportSettings(Browser* browser, namespace { // Translates a dictionary password to a PasswordForm struct. -webkit::forms::PasswordForm GetPasswordFormFromDict( +content::PasswordForm GetPasswordFormFromDict( const DictionaryValue& password_dict) { // If the time is specified, change time to the specified time. @@ -3440,7 +3440,7 @@ webkit::forms::PasswordForm GetPasswordFormFromDict( GURL origin_gurl(origin_url_text); GURL action_target(action_target_text); - webkit::forms::PasswordForm password_form; + content::PasswordForm password_form; password_form.signon_realm = signon_realm; password_form.username_value = username_value; password_form.password_value = password_value; @@ -3479,7 +3479,7 @@ void TestingAutomationProvider::AddSavedPassword( return; } - webkit::forms::PasswordForm new_password = + content::PasswordForm new_password = GetPasswordFormFromDict(*password_dict); // Use IMPLICIT_ACCESS since new passwords aren't added in incognito mode. @@ -3525,7 +3525,7 @@ void TestingAutomationProvider::RemoveSavedPassword( "Password must include a value for 'signon_realm.'"); return; } - webkit::forms::PasswordForm to_remove = + content::PasswordForm to_remove = GetPasswordFormFromDict(*password_dict); // Use EXPLICIT_ACCESS since passwords can be removed in incognito mode. diff --git a/chrome/browser/importer/external_process_importer_bridge.cc b/chrome/browser/importer/external_process_importer_bridge.cc index b7c56cb..9b0481e 100644 --- a/chrome/browser/importer/external_process_importer_bridge.cc +++ b/chrome/browser/importer/external_process_importer_bridge.cc @@ -12,7 +12,7 @@ #include "base/values.h" #include "chrome/browser/history/history_types.h" #include "chrome/browser/importer/profile_import_process_messages.h" -#include "webkit/forms/password_form.h" +#include "content/public/common/password_form.h" #if defined(OS_WIN) #include "chrome/browser/password_manager/ie7_password.h" @@ -115,7 +115,7 @@ void ExternalProcessImporterBridge::SetKeywords( } void ExternalProcessImporterBridge::SetPasswordForm( - const webkit::forms::PasswordForm& form) { + const content::PasswordForm& form) { Send(new ProfileImportProcessHostMsg_NotifyPasswordFormReady(form)); } diff --git a/chrome/browser/importer/external_process_importer_bridge.h b/chrome/browser/importer/external_process_importer_bridge.h index b2f9ffd..7942ab69 100644 --- a/chrome/browser/importer/external_process_importer_bridge.h +++ b/chrome/browser/importer/external_process_importer_bridge.h @@ -55,7 +55,7 @@ class ExternalProcessImporterBridge : public ImporterBridge { bool unique_on_host_and_path) OVERRIDE; virtual void SetPasswordForm( - const webkit::forms::PasswordForm& form) OVERRIDE; + const content::PasswordForm& form) OVERRIDE; virtual void NotifyStarted() OVERRIDE; virtual void NotifyItemStarted(importer::ImportItem item) OVERRIDE; diff --git a/chrome/browser/importer/external_process_importer_client.cc b/chrome/browser/importer/external_process_importer_client.cc index e66b6e05..36dc21d 100644 --- a/chrome/browser/importer/external_process_importer_client.cc +++ b/chrome/browser/importer/external_process_importer_client.cc @@ -219,7 +219,7 @@ void ExternalProcessImporterClient::OnFaviconsImportGroup( } void ExternalProcessImporterClient::OnPasswordFormImportReady( - const webkit::forms::PasswordForm& form) { + const content::PasswordForm& form) { if (cancelled_) return; diff --git a/chrome/browser/importer/external_process_importer_client.h b/chrome/browser/importer/external_process_importer_client.h index 9470045..092901f 100644 --- a/chrome/browser/importer/external_process_importer_client.h +++ b/chrome/browser/importer/external_process_importer_client.h @@ -65,7 +65,7 @@ class ExternalProcessImporterClient : public content::UtilityProcessHostClient { void OnFaviconsImportStart(size_t total_favicons_count); void OnFaviconsImportGroup( const std::vector<history::ImportedFaviconUsage>& favicons_group); - void OnPasswordFormImportReady(const webkit::forms::PasswordForm& form); + void OnPasswordFormImportReady(const content::PasswordForm& form); // WARNING: This function takes ownership of (and deletes) the pointers in // |template_urls|! void OnKeywordsImportReady(const std::vector<TemplateURL*>& template_urls, diff --git a/chrome/browser/importer/firefox2_importer.cc b/chrome/browser/importer/firefox2_importer.cc index 09063ed..b05a554 100644 --- a/chrome/browser/importer/firefox2_importer.cc +++ b/chrome/browser/importer/firefox2_importer.cc @@ -26,10 +26,10 @@ #include "chrome/browser/search_engines/template_url.h" #include "chrome/common/time_format.h" #include "chrome/common/url_constants.h" +#include "content/public/common/password_form.h" #include "googleurl/src/gurl.h" #include "grit/generated_resources.h" #include "net/base/data_url.h" -#include "webkit/forms/password_form.h" namespace { const char kItemOpen[] = "<DT><A"; @@ -338,7 +338,7 @@ void Firefox2Importer::ImportPasswords() { std::string content; file_util::ReadFileToString(file, &content); - std::vector<webkit::forms::PasswordForm> forms; + std::vector<content::PasswordForm> forms; decryptor.ParseSignons(content, &forms); if (!cancelled()) { diff --git a/chrome/browser/importer/firefox3_importer.cc b/chrome/browser/importer/firefox3_importer.cc index 948df98..6a38c66 100644 --- a/chrome/browser/importer/firefox3_importer.cc +++ b/chrome/browser/importer/firefox3_importer.cc @@ -22,11 +22,11 @@ #include "chrome/browser/search_engines/template_url.h" #include "chrome/common/time_format.h" #include "content/public/browser/browser_thread.h" +#include "content/public/common/password_form.h" #include "googleurl/src/gurl.h" #include "grit/generated_resources.h" #include "sql/connection.h" #include "sql/statement.h" -#include "webkit/forms/password_form.h" using content::BrowserThread; @@ -307,7 +307,7 @@ void Firefox3Importer::ImportPasswords() { return; } - std::vector<webkit::forms::PasswordForm> forms; + std::vector<content::PasswordForm> forms; FilePath source_path = source_path_; FilePath file = source_path.AppendASCII("signons.sqlite"); if (file_util::PathExists(file)) { diff --git a/chrome/browser/importer/firefox_importer_unittest.cc b/chrome/browser/importer/firefox_importer_unittest.cc index e684209..c0f0ba1 100644 --- a/chrome/browser/importer/firefox_importer_unittest.cc +++ b/chrome/browser/importer/firefox_importer_unittest.cc @@ -25,7 +25,7 @@ #include "chrome/browser/search_engines/template_url.h" #include "chrome/common/chrome_paths.h" #include "chrome/test/base/testing_profile.h" -#include "webkit/forms/password_form.h" +#include "content/public/common/password_form.h" // TODO(estade): some of these are disabled on mac. http://crbug.com/48007 #if defined(OS_MACOSX) @@ -150,7 +150,7 @@ class FirefoxObserver : public ProfileWriter, return true; } - virtual void AddPasswordForm(const webkit::forms::PasswordForm& form) { + virtual void AddPasswordForm(const content::PasswordForm& form) { PasswordInfo p = kFirefox2Passwords[password_count_]; EXPECT_EQ(p.origin, form.origin.spec()); EXPECT_EQ(p.realm, form.signon_realm); @@ -295,7 +295,7 @@ class Firefox3Observer : public ProfileWriter, return true; } - virtual void AddPasswordForm(const webkit::forms::PasswordForm& form) { + virtual void AddPasswordForm(const content::PasswordForm& form) { PasswordInfo p = kFirefox3Passwords[password_count_]; EXPECT_EQ(p.origin, form.origin.spec()); EXPECT_EQ(p.realm, form.signon_realm); diff --git a/chrome/browser/importer/ie_importer.cc b/chrome/browser/importer/ie_importer.cc index 03978e2..1c297d9 100644 --- a/chrome/browser/importer/ie_importer.cc +++ b/chrome/browser/importer/ie_importer.cc @@ -38,10 +38,10 @@ #include "chrome/browser/search_engines/template_url_service.h" #include "chrome/common/time_format.h" #include "chrome/common/url_constants.h" +#include "content/public/common/password_form.h" #include "googleurl/src/gurl.h" #include "grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" -#include "webkit/forms/password_form.h" namespace { @@ -609,7 +609,7 @@ void IEImporter::ImportPasswordsIE6() { continue; } - webkit::forms::PasswordForm form; + content::PasswordForm form; GURL::Replacements rp; rp.ClearUsername(); rp.ClearPassword(); diff --git a/chrome/browser/importer/ie_importer_unittest_win.cc b/chrome/browser/importer/ie_importer_unittest_win.cc index 700d8a0..a86345c 100644 --- a/chrome/browser/importer/ie_importer_unittest_win.cc +++ b/chrome/browser/importer/ie_importer_unittest_win.cc @@ -39,7 +39,7 @@ #include "chrome/browser/search_engines/template_url.h" #include "chrome/common/chrome_paths.h" #include "chrome/test/base/testing_profile.h" -#include "webkit/forms/password_form.h" +#include "content/public/common/password_form.h" namespace { @@ -280,7 +280,7 @@ class TestObserver : public ProfileWriter, return true; } - virtual void AddPasswordForm(const webkit::forms::PasswordForm& form) { + virtual void AddPasswordForm(const content::PasswordForm& form) { // Importer should obtain this password form only. EXPECT_EQ(GURL("http://localhost:8080/security/index.htm"), form.origin); EXPECT_EQ("http://localhost:8080/", form.signon_realm); @@ -377,7 +377,7 @@ class MalformedFavoritesRegistryTestObserver virtual bool BookmarkModelIsLoaded() const { return true; } virtual bool TemplateURLServiceIsLoaded() const { return true; } - virtual void AddPasswordForm(const webkit::forms::PasswordForm& form) {} + virtual void AddPasswordForm(const content::PasswordForm& form) {} virtual void AddHistoryPage(const history::URLRows& page, history::VisitSource visit_source) {} virtual void AddKeyword(std::vector<TemplateURL*> template_url, diff --git a/chrome/browser/importer/importer_bridge.h b/chrome/browser/importer/importer_bridge.h index fa8f377..83f9176 100644 --- a/chrome/browser/importer/importer_bridge.h +++ b/chrome/browser/importer/importer_bridge.h @@ -42,7 +42,7 @@ class ImporterBridge : public base::RefCountedThreadSafe<ImporterBridge> { virtual void SetKeywords(const std::vector<TemplateURL*>& template_urls, bool unique_on_host_and_path) = 0; - virtual void SetPasswordForm(const webkit::forms::PasswordForm& form) = 0; + virtual void SetPasswordForm(const content::PasswordForm& form) = 0; // Notifies the coordinator that the import operation has begun. virtual void NotifyStarted() = 0; diff --git a/chrome/browser/importer/in_process_importer_bridge.cc b/chrome/browser/importer/in_process_importer_bridge.cc index d5a1071..5e7be7d 100644 --- a/chrome/browser/importer/in_process_importer_bridge.cc +++ b/chrome/browser/importer/in_process_importer_bridge.cc @@ -9,8 +9,8 @@ #include "chrome/browser/importer/importer_host.h" #include "chrome/browser/search_engines/template_url.h" #include "content/public/browser/browser_thread.h" +#include "content/public/common/password_form.h" #include "ui/base/l10n/l10n_util.h" -#include "webkit/forms/password_form.h" #if defined(OS_WIN) #include "chrome/browser/password_manager/ie7_password.h" @@ -77,7 +77,7 @@ void InProcessImporterBridge::SetKeywords( } void InProcessImporterBridge::SetPasswordForm( - const webkit::forms::PasswordForm& form) { + const content::PasswordForm& form) { BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, base::Bind(&ProfileWriter::AddPasswordForm, writer_, form)); diff --git a/chrome/browser/importer/in_process_importer_bridge.h b/chrome/browser/importer/in_process_importer_bridge.h index 24876ea..25b5961 100644 --- a/chrome/browser/importer/in_process_importer_bridge.h +++ b/chrome/browser/importer/in_process_importer_bridge.h @@ -43,7 +43,7 @@ class InProcessImporterBridge : public ImporterBridge { bool unique_on_host_and_path) OVERRIDE; virtual void SetPasswordForm( - const webkit::forms::PasswordForm& form) OVERRIDE; + const content::PasswordForm& form) OVERRIDE; virtual void NotifyStarted() OVERRIDE; virtual void NotifyItemStarted(importer::ImportItem item) OVERRIDE; diff --git a/chrome/browser/importer/nss_decryptor.cc b/chrome/browser/importer/nss_decryptor.cc index 4d5a385..4439813 100644 --- a/chrome/browser/importer/nss_decryptor.cc +++ b/chrome/browser/importer/nss_decryptor.cc @@ -12,9 +12,9 @@ #include "base/string_split.h" #include "base/string_util.h" #include "base/utf_string_conversions.h" +#include "content/public/common/password_form.h" #include "sql/connection.h" #include "sql/statement.h" -#include "webkit/forms/password_form.h" #if defined(USE_NSS) #include <pk11pub.h> @@ -112,7 +112,7 @@ string16 NSSDecryptor::Decrypt(const std::string& crypt) const { // http://kb.mozillazine.org/Signons3.txt void NSSDecryptor::ParseSignons( const std::string& content, - std::vector<webkit::forms::PasswordForm>* forms) { + std::vector<content::PasswordForm>* forms) { forms->clear(); // Splits the file content into lines. @@ -141,7 +141,7 @@ void NSSDecryptor::ParseSignons( // Reads never-saved list. Domains are stored one per line. size_t i; for (i = 1; i < lines.size() && lines[i].compare(".") != 0; ++i) { - webkit::forms::PasswordForm form; + content::PasswordForm form; form.origin = GURL(lines[i]).ReplaceComponents(rep); form.signon_realm = form.origin.GetOrigin().spec(); form.blacklisted_by_user = true; @@ -163,7 +163,7 @@ void NSSDecryptor::ParseSignons( if (end - begin < 5) continue; - webkit::forms::PasswordForm form; + content::PasswordForm form; // The first line is the site URL. // For HTTP authentication logins, the URL may contain http realm, @@ -233,7 +233,7 @@ void NSSDecryptor::ParseSignons( } bool NSSDecryptor::ReadAndParseSignons(const FilePath& sqlite_file, - std::vector<webkit::forms::PasswordForm>* forms) { + std::vector<content::PasswordForm>* forms) { sql::Connection db; if (!db.Open(sqlite_file)) return false; @@ -250,7 +250,7 @@ bool NSSDecryptor::ReadAndParseSignons(const FilePath& sqlite_file, rep.ClearPassword(); // Read domains for which passwords are never saved. while (s.Step()) { - webkit::forms::PasswordForm form; + content::PasswordForm form; form.origin = GURL(s.ColumnString(0)).ReplaceComponents(rep); form.signon_realm = form.origin.GetOrigin().spec(); form.blacklisted_by_user = true; @@ -281,7 +281,7 @@ bool NSSDecryptor::ReadAndParseSignons(const FilePath& sqlite_file, if (!url.is_valid()) continue; - webkit::forms::PasswordForm form; + content::PasswordForm form; form.origin = url.ReplaceComponents(rep); form.signon_realm = form.origin.GetOrigin().spec(); if (!realm.empty()) diff --git a/chrome/browser/importer/nss_decryptor_mac.h b/chrome/browser/importer/nss_decryptor_mac.h index 3e0b181..7cae82e 100644 --- a/chrome/browser/importer/nss_decryptor_mac.h +++ b/chrome/browser/importer/nss_decryptor_mac.h @@ -105,11 +105,9 @@ typedef void (*SECITEMFreeItemFunc)(SECItem *item, PRBool free_it); typedef void (*PLArenaFinishFunc)(void); typedef PRStatus (*PRCleanupFunc)(void); -namespace webkit { -namespace forms { +namespace content { struct PasswordForm; } -} // A wrapper for Firefox NSS decrypt component. class NSSDecryptor { @@ -132,13 +130,13 @@ class NSSDecryptor { // username/password and reads other related information. // The result will be stored in |forms|. void ParseSignons(const std::string& content, - std::vector<webkit::forms::PasswordForm>* forms); + std::vector<content::PasswordForm>* forms); // Reads and parses the Firefox password sqlite db, decrypts the // username/password and reads other related information. // The result will be stored in |forms|. bool ReadAndParseSignons(const FilePath& sqlite_file, - std::vector<webkit::forms::PasswordForm>* forms); + std::vector<content::PasswordForm>* forms); private: PK11SlotInfo* GetKeySlotForDB() const { return PK11_GetInternalKeySlot(); } void FreeSlot(PK11SlotInfo* slot) const { PK11_FreeSlot(slot); } diff --git a/chrome/browser/importer/nss_decryptor_null.h b/chrome/browser/importer/nss_decryptor_null.h index 040df33..4fd6934 100644 --- a/chrome/browser/importer/nss_decryptor_null.h +++ b/chrome/browser/importer/nss_decryptor_null.h @@ -13,11 +13,9 @@ class FilePath; -namespace webkit { -namespace forms { +namespace content { struct PasswordForm; } -} // A NULL wrapper for Firefox NSS decrypt component, for use in builds where // we do not have the NSS library. @@ -27,9 +25,9 @@ class NSSDecryptor { bool Init(const FilePath& dll_path, const FilePath& db_path) { return false; } string16 Decrypt(const std::string& crypt) const { return string16(); } void ParseSignons(const std::string& content, - std::vector<webkit::forms::PasswordForm>* forms) {} + std::vector<content::PasswordForm>* forms) {} bool ReadAndParseSignons(const FilePath& sqlite_file, - std::vector<webkit::forms::PasswordForm>* forms) { + std::vector<content::PasswordForm>* forms) { return false; } diff --git a/chrome/browser/importer/nss_decryptor_system_nss.h b/chrome/browser/importer/nss_decryptor_system_nss.h index e055fa9..c125da9 100644 --- a/chrome/browser/importer/nss_decryptor_system_nss.h +++ b/chrome/browser/importer/nss_decryptor_system_nss.h @@ -14,11 +14,9 @@ class FilePath; -namespace webkit { -namespace forms { +namespace content { struct PasswordForm; } -} // A wrapper for Firefox NSS decrypt component. class NSSDecryptor { @@ -37,13 +35,13 @@ class NSSDecryptor { // username/password and reads other related information. // The result will be stored in |forms|. void ParseSignons(const std::string& content, - std::vector<webkit::forms::PasswordForm>* forms); + std::vector<content::PasswordForm>* forms); // Reads and parses the Firefox password sqlite db, decrypts the // username/password and reads other related information. // The result will be stored in |forms|. bool ReadAndParseSignons(const FilePath& sqlite_file, - std::vector<webkit::forms::PasswordForm>* forms); + std::vector<content::PasswordForm>* forms); private: // Does not actually free the slot, since we'll free it when NSSDecryptor is // destroyed. diff --git a/chrome/browser/importer/nss_decryptor_win.h b/chrome/browser/importer/nss_decryptor_win.h index 5fea1a9..1aeb266 100644 --- a/chrome/browser/importer/nss_decryptor_win.h +++ b/chrome/browser/importer/nss_decryptor_win.h @@ -104,11 +104,9 @@ typedef void (*SECITEMFreeItemFunc)(SECItem *item, PRBool free_it); typedef void (*PLArenaFinishFunc)(void); typedef PRStatus (*PRCleanupFunc)(void); -namespace webkit { -namespace forms { +namespace content { struct PasswordForm; } -} // A wrapper for Firefox NSS decrypt component. class NSSDecryptor { @@ -132,13 +130,13 @@ class NSSDecryptor { // username/password and reads other related information. // The result will be stored in |forms|. void ParseSignons(const std::string& content, - std::vector<webkit::forms::PasswordForm>* forms); + std::vector<content::PasswordForm>* forms); // Reads and parses the Firefox password sqlite db, decrypts the // username/password and reads other related information. // The result will be stored in |forms|. bool ReadAndParseSignons(const FilePath& sqlite_file, - std::vector<webkit::forms::PasswordForm>* forms); + std::vector<content::PasswordForm>* forms); private: // Call NSS initialization funcs. diff --git a/chrome/browser/importer/profile_import_process_messages.h b/chrome/browser/importer/profile_import_process_messages.h index d2300dd..d697a1e 100644 --- a/chrome/browser/importer/profile_import_process_messages.h +++ b/chrome/browser/importer/profile_import_process_messages.h @@ -15,9 +15,9 @@ #include "chrome/browser/search_engines/template_url.h" #include "chrome/common/common_param_traits_macros.h" #include "content/public/common/common_param_traits.h" +#include "content/public/common/password_form.h" #include "ipc/ipc_message_macros.h" #include "ipc/ipc_message_utils.h" -#include "webkit/forms/password_form.h" #ifndef CHROME_BROWSER_IMPORTER_PROFILE_IMPORT_PROCESS_MESSAGES_H_ #define CHROME_BROWSER_IMPORTER_PROFILE_IMPORT_PROCESS_MESSAGES_H_ @@ -331,7 +331,7 @@ IPC_MESSAGE_CONTROL1(ProfileImportProcessHostMsg_NotifyFaviconsImportGroup, std::vector<history::ImportedFaviconUsage>) IPC_MESSAGE_CONTROL1(ProfileImportProcessHostMsg_NotifyPasswordFormReady, - webkit::forms::PasswordForm) + content::PasswordForm) // WARNING: The TemplateURL*s in the following message get heap-allocated on the // receiving end. The message handler for this message MUST take ownership of diff --git a/chrome/browser/importer/profile_writer.cc b/chrome/browser/importer/profile_writer.cc index e7a6d20..ae536fb 100644 --- a/chrome/browser/importer/profile_writer.cc +++ b/chrome/browser/importer/profile_writer.cc @@ -91,7 +91,7 @@ bool ProfileWriter::TemplateURLServiceIsLoaded() const { return TemplateURLServiceFactory::GetForProfile(profile_)->loaded(); } -void ProfileWriter::AddPasswordForm(const webkit::forms::PasswordForm& form) { +void ProfileWriter::AddPasswordForm(const content::PasswordForm& form) { PasswordStoreFactory::GetForProfile( profile_, Profile::EXPLICIT_ACCESS)->AddLogin(form); } diff --git a/chrome/browser/importer/profile_writer.h b/chrome/browser/importer/profile_writer.h index 7714828..f4fc4db1 100644 --- a/chrome/browser/importer/profile_writer.h +++ b/chrome/browser/importer/profile_writer.h @@ -19,11 +19,9 @@ class Profile; class TemplateURL; -namespace webkit { -namespace forms { +namespace content { struct PasswordForm; } -} #if defined(OS_WIN) struct IE7PasswordInfo; @@ -55,7 +53,7 @@ class ProfileWriter : public base::RefCountedThreadSafe<ProfileWriter> { virtual bool TemplateURLServiceIsLoaded() const; // Helper methods for adding data to local stores. - virtual void AddPasswordForm(const webkit::forms::PasswordForm& form); + virtual void AddPasswordForm(const content::PasswordForm& form); #if defined(OS_WIN) virtual void AddIE7PasswordInfo(const IE7PasswordInfo& info); diff --git a/chrome/browser/password_manager/login_database.cc b/chrome/browser/password_manager/login_database.cc index 1427f47..a2f4d03 100644 --- a/chrome/browser/password_manager/login_database.cc +++ b/chrome/browser/password_manager/login_database.cc @@ -16,7 +16,7 @@ #include "sql/statement.h" #include "sql/transaction.h" -using webkit::forms::PasswordForm; +using content::PasswordForm; static const int kCurrentVersionNumber = 1; static const int kCompatibleVersionNumber = 1; @@ -297,7 +297,7 @@ bool LoginDatabase::GetLogins(const PasswordForm& form, bool LoginDatabase::GetLoginsCreatedBetween( const base::Time begin, const base::Time end, - std::vector<webkit::forms::PasswordForm*>* forms) const { + std::vector<content::PasswordForm*>* forms) const { DCHECK(forms); sql::Statement s(db_.GetCachedStatement(SQL_FROM_HERE, "SELECT origin_url, action_url, " diff --git a/chrome/browser/password_manager/login_database.h b/chrome/browser/password_manager/login_database.h index 06ac6f1..e37b966 100644 --- a/chrome/browser/password_manager/login_database.h +++ b/chrome/browser/password_manager/login_database.h @@ -10,9 +10,9 @@ #include "base/file_path.h" #include "base/string16.h" +#include "content/public/common/password_form.h" #include "sql/connection.h" #include "sql/meta_table.h" -#include "webkit/forms/password_form.h" // Interface to the database storage of login information, intended as a helper // for PasswordStore on platforms that need internal storage of some or all of @@ -30,14 +30,14 @@ class LoginDatabase { void ReportMetrics(); // Adds |form| to the list of remembered password forms. - bool AddLogin(const webkit::forms::PasswordForm& form); + bool AddLogin(const content::PasswordForm& form); // Updates remembered password form. Returns true on success and sets // items_changed (if non-NULL) to the number of logins updated. - bool UpdateLogin(const webkit::forms::PasswordForm& form, int* items_changed); + bool UpdateLogin(const content::PasswordForm& form, int* items_changed); // Removes |form| from the list of remembered password forms. - bool RemoveLogin(const webkit::forms::PasswordForm& form); + bool RemoveLogin(const content::PasswordForm& form); // Removes all logins created from |delete_begin| onwards (inclusive) and // before |delete_end|. You may use a null Time value to do an unbounded @@ -48,8 +48,8 @@ class LoginDatabase { // Loads a list of matching password forms into the specified vector |forms|. // The list will contain all possibly relevant entries to the observed |form|, // including blacklisted matches. - bool GetLogins(const webkit::forms::PasswordForm& form, - std::vector<webkit::forms::PasswordForm*>* forms) const; + bool GetLogins(const content::PasswordForm& form, + std::vector<content::PasswordForm*>* forms) const; // Loads all logins created from |begin| onwards (inclusive) and before |end|. // You may use a null Time value to do an unbounded search in either @@ -57,16 +57,16 @@ class LoginDatabase { bool GetLoginsCreatedBetween( const base::Time begin, const base::Time end, - std::vector<webkit::forms::PasswordForm*>* forms) const; + std::vector<content::PasswordForm*>* forms) const; // Loads the complete list of autofillable password forms (i.e., not blacklist // entries) into |forms|. bool GetAutofillableLogins( - std::vector<webkit::forms::PasswordForm*>* forms) const; + std::vector<content::PasswordForm*>* forms) const; // Loads the complete list of blacklist forms into |forms|. bool GetBlacklistLogins( - std::vector<webkit::forms::PasswordForm*>* forms) const; + std::vector<content::PasswordForm*>* forms) const; // Deletes the login database file on disk, and creates a new, empty database. // This can be used after migrating passwords to some other store, to ensure @@ -87,13 +87,13 @@ class LoginDatabase { // Fills |form| from the values in the given statement (which is assumed to // be of the form used by the Get*Logins methods). - void InitPasswordFormFromStatement(webkit::forms::PasswordForm* form, + void InitPasswordFormFromStatement(content::PasswordForm* form, sql::Statement& s) const; // Loads all logins whose blacklist setting matches |blacklisted| into // |forms|. bool GetAllLoginsWithBlacklistSetting( - bool blacklisted, std::vector<webkit::forms::PasswordForm*>* forms) const; + bool blacklisted, std::vector<content::PasswordForm*>* forms) const; FilePath db_path_; mutable sql::Connection db_; diff --git a/chrome/browser/password_manager/login_database_unittest.cc b/chrome/browser/password_manager/login_database_unittest.cc index d2486a2..c31376d 100644 --- a/chrome/browser/password_manager/login_database_unittest.cc +++ b/chrome/browser/password_manager/login_database_unittest.cc @@ -13,9 +13,9 @@ #include "base/utf_string_conversions.h" #include "chrome/browser/password_manager/login_database.h" #include "chrome/common/chrome_paths.h" -#include "webkit/forms/password_form.h" +#include "content/public/common/password_form.h" -using webkit::forms::PasswordForm; +using content::PasswordForm; class LoginDatabaseTest : public testing::Test { protected: diff --git a/chrome/browser/password_manager/mock_password_store.h b/chrome/browser/password_manager/mock_password_store.h index 627b5db..608c2ad 100644 --- a/chrome/browser/password_manager/mock_password_store.h +++ b/chrome/browser/password_manager/mock_password_store.h @@ -6,8 +6,8 @@ #define CHROME_BROWSER_PASSWORD_MANAGER_MOCK_PASSWORD_STORE_H_ #include "chrome/browser/password_manager/password_store.h" +#include "content/public/common/password_form.h" #include "testing/gmock/include/gmock/gmock.h" -#include "webkit/forms/password_form.h" class Profile; @@ -17,26 +17,26 @@ class MockPasswordStore : public PasswordStore { static scoped_refptr<RefcountedProfileKeyedService> Build(Profile* profile); - MOCK_METHOD1(RemoveLogin, void(const webkit::forms::PasswordForm&)); - MOCK_METHOD2(GetLogins, int(const webkit::forms::PasswordForm&, + MOCK_METHOD1(RemoveLogin, void(const content::PasswordForm&)); + MOCK_METHOD2(GetLogins, int(const content::PasswordForm&, PasswordStoreConsumer*)); - MOCK_METHOD1(AddLogin, void(const webkit::forms::PasswordForm&)); - MOCK_METHOD1(UpdateLogin, void(const webkit::forms::PasswordForm&)); + MOCK_METHOD1(AddLogin, void(const content::PasswordForm&)); + MOCK_METHOD1(UpdateLogin, void(const content::PasswordForm&)); MOCK_METHOD0(ReportMetrics, void()); MOCK_METHOD0(ReportMetricsImpl, void()); - MOCK_METHOD1(AddLoginImpl, void(const webkit::forms::PasswordForm&)); - MOCK_METHOD1(UpdateLoginImpl, void(const webkit::forms::PasswordForm&)); - MOCK_METHOD1(RemoveLoginImpl, void(const webkit::forms::PasswordForm&)); + MOCK_METHOD1(AddLoginImpl, void(const content::PasswordForm&)); + MOCK_METHOD1(UpdateLoginImpl, void(const content::PasswordForm&)); + MOCK_METHOD1(RemoveLoginImpl, void(const content::PasswordForm&)); MOCK_METHOD2(RemoveLoginsCreatedBetweenImpl, void(const base::Time&, const base::Time&)); MOCK_METHOD2(GetLoginsImpl, void(GetLoginsRequest*, - const webkit::forms::PasswordForm&)); + const content::PasswordForm&)); MOCK_METHOD1(GetAutofillableLoginsImpl, void(GetLoginsRequest*)); MOCK_METHOD1(GetBlacklistLoginsImpl, void(GetLoginsRequest*)); MOCK_METHOD1(FillAutofillableLogins, - bool(std::vector<webkit::forms::PasswordForm*>*)); + bool(std::vector<content::PasswordForm*>*)); MOCK_METHOD1(FillBlacklistLogins, - bool(std::vector<webkit::forms::PasswordForm*>*)); + bool(std::vector<content::PasswordForm*>*)); virtual void ShutdownOnUIThread(); diff --git a/chrome/browser/password_manager/native_backend_gnome_x.cc b/chrome/browser/password_manager/native_backend_gnome_x.cc index 94dcdd2..6fa8f6c 100644 --- a/chrome/browser/password_manager/native_backend_gnome_x.cc +++ b/chrome/browser/password_manager/native_backend_gnome_x.cc @@ -22,7 +22,7 @@ #include "content/public/browser/browser_thread.h" using content::BrowserThread; -using webkit::forms::PasswordForm; +using content::PasswordForm; #define GNOME_KEYRING_DEFINE_POINTER(name) \ typeof(&::gnome_keyring_##name) GnomeKeyringLoader::gnome_keyring_##name; diff --git a/chrome/browser/password_manager/native_backend_gnome_x.h b/chrome/browser/password_manager/native_backend_gnome_x.h index 233eb84..f421831 100644 --- a/chrome/browser/password_manager/native_backend_gnome_x.h +++ b/chrome/browser/password_manager/native_backend_gnome_x.h @@ -17,11 +17,9 @@ class PrefService; -namespace webkit { -namespace forms { +namespace content { struct PasswordForm; } -} // Many of the gnome_keyring_* functions use variable arguments, which makes // them difficult if not impossible to truly wrap in C. Therefore, we use @@ -75,12 +73,12 @@ class NativeBackendGnome : public PasswordStoreX::NativeBackend, virtual bool Init() OVERRIDE; // Implements NativeBackend interface. - virtual bool AddLogin(const webkit::forms::PasswordForm& form) OVERRIDE; - virtual bool UpdateLogin(const webkit::forms::PasswordForm& form) OVERRIDE; - virtual bool RemoveLogin(const webkit::forms::PasswordForm& form) OVERRIDE; + virtual bool AddLogin(const content::PasswordForm& form) OVERRIDE; + virtual bool UpdateLogin(const content::PasswordForm& form) OVERRIDE; + virtual bool RemoveLogin(const content::PasswordForm& form) OVERRIDE; virtual bool RemoveLoginsCreatedBetween( const base::Time& delete_begin, const base::Time& delete_end) OVERRIDE; - virtual bool GetLogins(const webkit::forms::PasswordForm& form, + virtual bool GetLogins(const content::PasswordForm& form, PasswordFormList* forms) OVERRIDE; virtual bool GetLoginsCreatedBetween(const base::Time& get_begin, const base::Time& get_end, @@ -90,7 +88,7 @@ class NativeBackendGnome : public PasswordStoreX::NativeBackend, private: // Adds a login form without checking for one to replace first. - bool RawAddLogin(const webkit::forms::PasswordForm& form); + bool RawAddLogin(const content::PasswordForm& form); // Reads PasswordForms from the keyring with the given autofillability state. bool GetLoginsList(PasswordFormList* forms, bool autofillable); diff --git a/chrome/browser/password_manager/native_backend_gnome_x_unittest.cc b/chrome/browser/password_manager/native_backend_gnome_x_unittest.cc index b1163c5..eb0e44d 100644 --- a/chrome/browser/password_manager/native_backend_gnome_x_unittest.cc +++ b/chrome/browser/password_manager/native_backend_gnome_x_unittest.cc @@ -18,7 +18,7 @@ #include "testing/gtest/include/gtest/gtest.h" using content::BrowserThread; -using webkit::forms::PasswordForm; +using content::PasswordForm; namespace { diff --git a/chrome/browser/password_manager/native_backend_kwallet_x.cc b/chrome/browser/password_manager/native_backend_kwallet_x.cc index 66208a1..d88ac50 100644 --- a/chrome/browser/password_manager/native_backend_kwallet_x.cc +++ b/chrome/browser/password_manager/native_backend_kwallet_x.cc @@ -22,7 +22,7 @@ #include "ui/base/l10n/l10n_util.h" using content::BrowserThread; -using webkit::forms::PasswordForm; +using content::PasswordForm; // We could localize this string, but then changing your locale would cause // you to lose access to all your stored passwords. Maybe best not to do that. diff --git a/chrome/browser/password_manager/native_backend_kwallet_x.h b/chrome/browser/password_manager/native_backend_kwallet_x.h index 0bd909e..4bcfc8f 100644 --- a/chrome/browser/password_manager/native_backend_kwallet_x.h +++ b/chrome/browser/password_manager/native_backend_kwallet_x.h @@ -18,11 +18,9 @@ class Pickle; class PickleIterator; class PrefService; -namespace webkit { -namespace forms { +namespace content { struct PasswordForm; } -} namespace base { class WaitableEvent; @@ -43,12 +41,12 @@ class NativeBackendKWallet : public PasswordStoreX::NativeBackend { virtual bool Init() OVERRIDE; // Implements NativeBackend interface. - virtual bool AddLogin(const webkit::forms::PasswordForm& form) OVERRIDE; - virtual bool UpdateLogin(const webkit::forms::PasswordForm& form) OVERRIDE; - virtual bool RemoveLogin(const webkit::forms::PasswordForm& form) OVERRIDE; + virtual bool AddLogin(const content::PasswordForm& form) OVERRIDE; + virtual bool UpdateLogin(const content::PasswordForm& form) OVERRIDE; + virtual bool RemoveLogin(const content::PasswordForm& form) OVERRIDE; virtual bool RemoveLoginsCreatedBetween( const base::Time& delete_begin, const base::Time& delete_end) OVERRIDE; - virtual bool GetLogins(const webkit::forms::PasswordForm& form, + virtual bool GetLogins(const content::PasswordForm& form, PasswordFormList* forms) OVERRIDE; virtual bool GetLoginsCreatedBetween(const base::Time& get_begin, const base::Time& get_end, @@ -127,8 +125,8 @@ class NativeBackendKWallet : public PasswordStoreX::NativeBackend { // If |update_check| is false, we only check the fields that are checked by // LoginDatabase::UpdateLogin() when updating logins; otherwise, we check the // fields that are checked by LoginDatabase::RemoveLogin() for removing them. - static bool CompareForms(const webkit::forms::PasswordForm& a, - const webkit::forms::PasswordForm& b, + static bool CompareForms(const content::PasswordForm& a, + const content::PasswordForm& b, bool update_check); // Serializes a list of PasswordForms to be stored in the wallet. diff --git a/chrome/browser/password_manager/native_backend_kwallet_x_unittest.cc b/chrome/browser/password_manager/native_backend_kwallet_x_unittest.cc index 3157a29..32c2648 100644 --- a/chrome/browser/password_manager/native_backend_kwallet_x_unittest.cc +++ b/chrome/browser/password_manager/native_backend_kwallet_x_unittest.cc @@ -29,7 +29,7 @@ using content::BrowserThread; using testing::_; using testing::Invoke; using testing::Return; -using webkit::forms::PasswordForm; +using content::PasswordForm; namespace { diff --git a/chrome/browser/password_manager/password_form_data.cc b/chrome/browser/password_manager/password_form_data.cc index 3c6f377..c2c9a01 100644 --- a/chrome/browser/password_manager/password_form_data.cc +++ b/chrome/browser/password_manager/password_form_data.cc @@ -6,7 +6,7 @@ #include "base/utf_string_conversions.h" #include "chrome/browser/password_manager/password_form_data.h" -using webkit::forms::PasswordForm; +using content::PasswordForm; PasswordForm* CreatePasswordFormFromData( const PasswordFormData& form_data) { @@ -69,7 +69,7 @@ std::ostream& operator<<(std::ostream& os, const PasswordForm& form) { << "date_created: " << form.date_created.ToDoubleT(); } -typedef std::set<const webkit::forms::PasswordForm*> SetOfForms; +typedef std::set<const content::PasswordForm*> SetOfForms; bool ContainsSamePasswordFormsPtr( const std::vector<PasswordForm*>& first, @@ -105,8 +105,8 @@ bool ContainsSamePasswordFormsPtr( } bool ContainsSamePasswordForms( - std::vector<webkit::forms::PasswordForm>& first, - std::vector<webkit::forms::PasswordForm>& second) { + std::vector<content::PasswordForm>& first, + std::vector<content::PasswordForm>& second) { std::vector<PasswordForm*> first_ptr; for (unsigned int i = 0; i < first.size(); ++i) { first_ptr.push_back(&first[i]); diff --git a/chrome/browser/password_manager/password_form_data.h b/chrome/browser/password_manager/password_form_data.h index 35be0de..0bc512f 100644 --- a/chrome/browser/password_manager/password_form_data.h +++ b/chrome/browser/password_manager/password_form_data.h @@ -7,13 +7,13 @@ #include <ostream> +#include "content/public/common/password_form.h" #include "testing/gmock/include/gmock/gmock.h" -#include "webkit/forms/password_form.h" // Struct used for creation of PasswordForms from static arrays of data. // Note: This is only meant to be used in unit test. struct PasswordFormData { - const webkit::forms::PasswordForm::Scheme scheme; + const content::PasswordForm::Scheme scheme; const char* signon_realm; const char* origin; const char* action; @@ -29,23 +29,23 @@ struct PasswordFormData { // Creates and returns a new PasswordForm built from form_data. Caller is // responsible for deleting the object when finished with it. -webkit::forms::PasswordForm* CreatePasswordFormFromData( +content::PasswordForm* CreatePasswordFormFromData( const PasswordFormData& form_data); // Checks whether two vectors of PasswordForms contain equivalent elements, // regardless of order. bool ContainsSamePasswordFormsPtr( - const std::vector<webkit::forms::PasswordForm*>& first, - const std::vector<webkit::forms::PasswordForm*>& second); + const std::vector<content::PasswordForm*>& first, + const std::vector<content::PasswordForm*>& second); bool ContainsSamePasswordForms( - std::vector<webkit::forms::PasswordForm>& first, - std::vector<webkit::forms::PasswordForm>& second); + std::vector<content::PasswordForm>& first, + std::vector<content::PasswordForm>& second); // Pretty-prints the contents of a PasswordForm. // TODO(sync): This file must eventually be refactored away -- crbug.com/87185. std::ostream& operator<<(std::ostream& os, - const webkit::forms::PasswordForm& form); + const content::PasswordForm& form); // This gmock matcher is used to check that the |arg| contains exactly the same // PasswordForms as |forms|, regardless of order. diff --git a/chrome/browser/password_manager/password_form_manager.cc b/chrome/browser/password_manager/password_form_manager.cc index 16b3075..6aacd0c 100644 --- a/chrome/browser/password_manager/password_form_manager.cc +++ b/chrome/browser/password_manager/password_form_manager.cc @@ -16,11 +16,11 @@ #include "chrome/common/autofill_messages.h" #include "content/public/browser/render_view_host.h" #include "content/public/browser/web_contents.h" -#include "webkit/forms/password_form_dom_manager.h" +#include "content/public/common/password_form.h" using base::Time; -using webkit::forms::PasswordForm; -using webkit::forms::PasswordFormMap; +using content::PasswordForm; +using content::PasswordFormMap; PasswordFormManager::PasswordFormManager(Profile* profile, PasswordManager* password_manager, diff --git a/chrome/browser/password_manager/password_form_manager.h b/chrome/browser/password_manager/password_form_manager.h index 1580f13..aa4bb1c 100644 --- a/chrome/browser/password_manager/password_form_manager.h +++ b/chrome/browser/password_manager/password_form_manager.h @@ -12,7 +12,7 @@ #include "base/stl_util.h" #include "chrome/browser/password_manager/password_store_consumer.h" -#include "webkit/forms/password_form.h" +#include "content/public/common/password_form.h" namespace content { class WebContents; @@ -35,7 +35,7 @@ class PasswordFormManager : public PasswordStoreConsumer { PasswordFormManager(Profile* profile, PasswordManager* password_manager, content::WebContents* web_contents, - const webkit::forms::PasswordForm& observed_form, + const content::PasswordForm& observed_form, bool ssl_valid); virtual ~PasswordFormManager(); @@ -46,7 +46,7 @@ class PasswordFormManager : public PasswordStoreConsumer { // Compare basic data of observed_form_ with argument. Only check the action // URL when action match is required. - bool DoesManage(const webkit::forms::PasswordForm& form, + bool DoesManage(const content::PasswordForm& form, ActionMatch action_match) const; // Retrieves potential matching logins from the database. @@ -85,12 +85,12 @@ class PasswordFormManager : public PasswordStoreConsumer { // Determines if we need to autofill given the results of the query. void OnRequestDone( - int handle, const std::vector<webkit::forms::PasswordForm*>& result); + int handle, const std::vector<content::PasswordForm*>& result); // PasswordStoreConsumer implementation. virtual void OnPasswordStoreRequestDone( CancelableRequestProvider::Handle handle, - const std::vector<webkit::forms::PasswordForm*>& result) OVERRIDE; + const std::vector<content::PasswordForm*>& result) OVERRIDE; // A user opted to 'never remember' passwords for this form. // Blacklist it so that from now on when it is seen we ignore it. @@ -99,7 +99,7 @@ class PasswordFormManager : public PasswordStoreConsumer { // If the user has submitted observed_form_, provisionally hold on to // the submitted credentials until we are told by PasswordManager whether // or not the login was successful. - void ProvisionallySave(const webkit::forms::PasswordForm& credentials); + void ProvisionallySave(const content::PasswordForm& credentials); // Handles save-as-new or update of the form managed by this manager. // Note the basic data of updated_credentials must match that of @@ -166,7 +166,7 @@ class PasswordFormManager : public PasswordStoreConsumer { // Helper for OnPasswordStoreRequestDone to determine whether or not // the given result form is worth scoring. - bool IgnoreResult(const webkit::forms::PasswordForm& form) const; + bool IgnoreResult(const content::PasswordForm& form) const; // Helper for Save in the case that best_matches.size() == 0, meaning // we have no prior record of this form/username/password and the user @@ -176,7 +176,7 @@ class PasswordFormManager : public PasswordStoreConsumer { // Helper for OnPasswordStoreRequestDone to score an individual result // against the observed_form_. - int ScoreResult(const webkit::forms::PasswordForm& form) const; + int ScoreResult(const content::PasswordForm& form) const; // Helper for Save in the case that best_matches.size() > 0, meaning // we have at least one match for this form/username/password. This @@ -202,13 +202,13 @@ class PasswordFormManager : public PasswordStoreConsumer { // Set of PasswordForms from the DB that best match the form // being managed by this. Use a map instead of vector, because we most // frequently require lookups by username value in IsNewLogin. - webkit::forms::PasswordFormMap best_matches_; + content::PasswordFormMap best_matches_; // Cleans up when best_matches_ goes out of scope. - STLValueDeleter<webkit::forms::PasswordFormMap> best_matches_deleter_; + STLValueDeleter<content::PasswordFormMap> best_matches_deleter_; // The PasswordForm from the page or dialog managed by this. - webkit::forms::PasswordForm observed_form_; + content::PasswordForm observed_form_; // The origin url path of observed_form_ tokenized, for convenience when // scoring. @@ -216,7 +216,7 @@ class PasswordFormManager : public PasswordStoreConsumer { // Stores updated credentials when the form was submitted but success is // still unknown. - webkit::forms::PasswordForm pending_credentials_; + content::PasswordForm pending_credentials_; // Whether pending_credentials_ stores a new login or is an update // to an existing one. @@ -235,7 +235,7 @@ class PasswordFormManager : public PasswordStoreConsumer { // as preferred. This is only allowed to be null if there are no best matches // at all, since there will always be one preferred login when there are // multiple matches (when first saved, a login is marked preferred). - const webkit::forms::PasswordForm* preferred_match_; + const content::PasswordForm* preferred_match_; typedef enum { PRE_MATCHING_PHASE, // Have not yet invoked a GetLogins query to find diff --git a/chrome/browser/password_manager/password_form_manager_unittest.cc b/chrome/browser/password_manager/password_form_manager_unittest.cc index 07f3e67..43f1a02 100644 --- a/chrome/browser/password_manager/password_form_manager_unittest.cc +++ b/chrome/browser/password_manager/password_form_manager_unittest.cc @@ -12,16 +12,16 @@ #include "chrome/browser/password_manager/password_manager_delegate.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/test/base/testing_profile.h" -#include "webkit/forms/password_form.h" +#include "content/public/common/password_form.h" -using webkit::forms::PasswordForm; +using content::PasswordForm; class TestPasswordManagerDelegate : public PasswordManagerDelegate { public: explicit TestPasswordManagerDelegate(Profile* profile) : profile_(profile) {} virtual void FillPasswordForm( - const webkit::forms::PasswordFormFillData& form_data) OVERRIDE {} + const PasswordFormFillData& form_data) OVERRIDE {} virtual void AddSavePasswordInfoBarIfPermitted( PasswordFormManager* form_to_save) OVERRIDE {} virtual Profile* GetProfile() OVERRIDE { return profile_; } @@ -37,9 +37,9 @@ class TestPasswordManager : public PasswordManager { : PasswordManager(NULL, delegate) {} virtual void Autofill( - const webkit::forms::PasswordForm& form_for_autofill, - const webkit::forms::PasswordFormMap& best_matches, - const webkit::forms::PasswordForm& preferred_match, + const content::PasswordForm& form_for_autofill, + const content::PasswordFormMap& best_matches, + const content::PasswordForm& preferred_match, bool wait_for_username) const OVERRIDE {} }; @@ -47,7 +47,7 @@ class TestPasswordFormManager : public PasswordFormManager { public: TestPasswordFormManager(Profile* profile, PasswordManager* manager, - const webkit::forms::PasswordForm& observed_form, + const content::PasswordForm& observed_form, bool ssl_valid) : PasswordFormManager(profile, manager, NULL, observed_form, ssl_valid), num_sent_messages_(0) {} diff --git a/chrome/browser/password_manager/password_manager.cc b/chrome/browser/password_manager/password_manager.cc index fdd0138..2f93ea5 100644 --- a/chrome/browser/password_manager/password_manager.cc +++ b/chrome/browser/password_manager/password_manager.cc @@ -21,8 +21,8 @@ using content::UserMetricsAction; using content::WebContents; -using webkit::forms::PasswordForm; -using webkit::forms::PasswordFormMap; +using content::PasswordForm; +using content::PasswordFormMap; namespace { @@ -285,12 +285,12 @@ void PasswordManager::Autofill( case PasswordForm::SCHEME_HTML: { // Note the check above is required because the observer_ for a non-HTML // schemed password form may have been freed, so we need to distinguish. - webkit::forms::PasswordFormFillData fill_data; - webkit::forms::PasswordFormDomManager::InitFillData(form_for_autofill, - best_matches, - &preferred_match, - wait_for_username, - &fill_data); + PasswordFormFillData fill_data; + InitPasswordFormFillData(form_for_autofill, + best_matches, + &preferred_match, + wait_for_username, + &fill_data); delegate_->FillPasswordForm(fill_data); return; } diff --git a/chrome/browser/password_manager/password_manager.h b/chrome/browser/password_manager/password_manager.h index 6b990dc..544546d 100644 --- a/chrome/browser/password_manager/password_manager.h +++ b/chrome/browser/password_manager/password_manager.h @@ -13,9 +13,9 @@ #include "chrome/browser/api/prefs/pref_member.h" #include "chrome/browser/password_manager/password_form_manager.h" #include "chrome/browser/ui/login/login_model.h" +#include "chrome/common/password_form_fill_data.h" #include "content/public/browser/web_contents_observer.h" -#include "webkit/forms/password_form.h" -#include "webkit/forms/password_form_dom_manager.h" +#include "content/public/common/password_form.h" class PasswordManagerDelegate; class PasswordManagerTest; @@ -44,23 +44,23 @@ class PasswordManager : public LoginModel, // Called by a PasswordFormManager when it decides a form can be autofilled // on the page. - virtual void Autofill(const webkit::forms::PasswordForm& form_for_autofill, - const webkit::forms::PasswordFormMap& best_matches, - const webkit::forms::PasswordForm& preferred_match, + virtual void Autofill(const content::PasswordForm& form_for_autofill, + const content::PasswordFormMap& best_matches, + const content::PasswordForm& preferred_match, bool wait_for_username) const; // LoginModel implementation. virtual void SetObserver(LoginModelObserver* observer) OVERRIDE; // Mark this form as having a generated password. - void SetFormHasGeneratedPassword(const webkit::forms::PasswordForm& form); + void SetFormHasGeneratedPassword(const content::PasswordForm& form); // TODO(isherman): This should not be public, but is currently being used by // the LoginPrompt code. // When a form is submitted, we prepare to save the password but wait // until we decide the user has successfully logged in. This is step 1 // of 2 (see SavePassword). - void ProvisionallySavePassword(const webkit::forms::PasswordForm& form); + void ProvisionallySavePassword(const content::PasswordForm& form); // content::WebContentsObserver overrides. virtual void DidNavigateAnyFrame( @@ -71,9 +71,9 @@ class PasswordManager : public LoginModel, // TODO(isherman): This should not be public, but is currently being used by // the LoginPrompt code. void OnPasswordFormsParsed( - const std::vector<webkit::forms::PasswordForm>& forms); + const std::vector<content::PasswordForm>& forms); void OnPasswordFormsRendered( - const std::vector<webkit::forms::PasswordForm>& visible_forms); + const std::vector<content::PasswordForm>& visible_forms); private: // Is password autofill enabled for the current profile? diff --git a/chrome/browser/password_manager/password_manager_delegate.h b/chrome/browser/password_manager/password_manager_delegate.h index 158311cc..e3314ba 100644 --- a/chrome/browser/password_manager/password_manager_delegate.h +++ b/chrome/browser/password_manager/password_manager_delegate.h @@ -5,15 +5,11 @@ #ifndef CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_DELEGATE_H_ #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_DELEGATE_H_ -namespace webkit { -namespace forms { -struct PasswordFormFillData; -} -} - class PasswordFormManager; class Profile; +struct PasswordFormFillData; + // An abstraction of operations in the external environment (WebContents) // that the PasswordManager depends on. This allows for more targeted // unit testing. @@ -26,7 +22,7 @@ class PasswordManagerDelegate { // through the RenderViewHost to FillPasswordForm. Tests can override this // to sever the dependency on the entire rendering stack. virtual void FillPasswordForm( - const webkit::forms::PasswordFormFillData& form_data) = 0; + const PasswordFormFillData& form_data) = 0; // A mechanism to show an infobar in the current tab at our request. // The infobar may not show in some circumstances, such as when the one-click diff --git a/chrome/browser/password_manager/password_manager_delegate_impl.cc b/chrome/browser/password_manager/password_manager_delegate_impl.cc index 6360be4..3966ba3 100644 --- a/chrome/browser/password_manager/password_manager_delegate_impl.cc +++ b/chrome/browser/password_manager/password_manager_delegate_impl.cc @@ -18,6 +18,7 @@ #include "content/public/browser/navigation_entry.h" #include "content/public/browser/render_view_host.h" #include "content/public/browser/web_contents.h" +#include "content/public/common/password_form.h" #include "content/public/common/ssl_status.h" #include "google_apis/gaia/gaia_urls.h" #include "grit/chromium_strings.h" @@ -26,7 +27,6 @@ #include "net/base/cert_status_flags.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" -#include "webkit/forms/password_form.h" // After a successful *new* login attempt, we take the PasswordFormManager in // provisional_save_manager_ and move it to a SavePasswordInfoBarDelegate while @@ -123,7 +123,7 @@ InfoBarDelegate::InfoBarAutomationType // PasswordManagerDelegateImpl ------------------------------------------------ void PasswordManagerDelegateImpl::FillPasswordForm( - const webkit::forms::PasswordFormFillData& form_data) { + const PasswordFormFillData& form_data) { bool disable_popup = tab_contents_->autofill_manager()->HasExternalDelegate(); tab_contents_->web_contents()->GetRenderViewHost()->Send( diff --git a/chrome/browser/password_manager/password_manager_delegate_impl.h b/chrome/browser/password_manager/password_manager_delegate_impl.h index 6b8c4e9..3837b45 100644 --- a/chrome/browser/password_manager/password_manager_delegate_impl.h +++ b/chrome/browser/password_manager/password_manager_delegate_impl.h @@ -18,7 +18,7 @@ class PasswordManagerDelegateImpl : public PasswordManagerDelegate { // PasswordManagerDelegate implementation. virtual void FillPasswordForm( - const webkit::forms::PasswordFormFillData& form_data) OVERRIDE; + const PasswordFormFillData& form_data) OVERRIDE; virtual void AddSavePasswordInfoBarIfPermitted( PasswordFormManager* form_to_save) OVERRIDE; virtual Profile* GetProfile() OVERRIDE; diff --git a/chrome/browser/password_manager/password_manager_unittest.cc b/chrome/browser/password_manager/password_manager_unittest.cc index 3afd0a3..054c126 100644 --- a/chrome/browser/password_manager/password_manager_unittest.cc +++ b/chrome/browser/password_manager/password_manager_unittest.cc @@ -22,7 +22,7 @@ #include "testing/gtest/include/gtest/gtest.h" using content::BrowserThread; -using webkit::forms::PasswordForm; +using content::PasswordForm; using testing::_; using testing::DoAll; using ::testing::Exactly; @@ -32,7 +32,7 @@ using ::testing::Return; class MockPasswordManagerDelegate : public PasswordManagerDelegate { public: MOCK_METHOD1(FillPasswordForm, void( - const webkit::forms::PasswordFormFillData&)); + const PasswordFormFillData&)); MOCK_METHOD1(AddSavePasswordInfoBarIfPermitted, void(PasswordFormManager*)); MOCK_METHOD0(GetProfile, Profile*()); MOCK_METHOD0(DidLastPageLoadEncounterSSLErrors, bool()); diff --git a/chrome/browser/password_manager/password_store.cc b/chrome/browser/password_manager/password_store.cc index c08ec91..d4ef8e1 100644 --- a/chrome/browser/password_manager/password_store.cc +++ b/chrome/browser/password_manager/password_store.cc @@ -10,11 +10,11 @@ #include "base/stl_util.h" #include "chrome/browser/password_manager/password_store_consumer.h" #include "content/public/browser/browser_thread.h" -#include "webkit/forms/password_form.h" +#include "content/public/common/password_form.h" using content::BrowserThread; using std::vector; -using webkit::forms::PasswordForm; +using content::PasswordForm; PasswordStore::GetLoginsRequest::GetLoginsRequest( const GetLoginsCallback& callback) diff --git a/chrome/browser/password_manager/password_store.h b/chrome/browser/password_manager/password_store.h index 7233d13..a15bd7a 100644 --- a/chrome/browser/password_manager/password_store.h +++ b/chrome/browser/password_manager/password_store.h @@ -25,16 +25,14 @@ class PasswordModelAssociator; class PasswordModelWorker; } -namespace webkit { -namespace forms { +namespace content { struct PasswordForm; } -} namespace passwords_helper { -void AddLogin(PasswordStore* store, const webkit::forms::PasswordForm& form); -void RemoveLogin(PasswordStore* store, const webkit::forms::PasswordForm& form); -void UpdateLogin(PasswordStore* store, const webkit::forms::PasswordForm& form); +void AddLogin(PasswordStore* store, const content::PasswordForm& form); +void RemoveLogin(PasswordStore* store, const content::PasswordForm& form); +void UpdateLogin(PasswordStore* store, const content::PasswordForm& form); } // Interface for storing form passwords in a platform-specific secure way. @@ -45,7 +43,7 @@ class PasswordStore public CancelableRequestProvider { public: typedef base::Callback< - void(Handle, const std::vector<webkit::forms::PasswordForm*>&)> + void(Handle, const std::vector<content::PasswordForm*>&)> GetLoginsCallback; // PasswordForm vector elements are meant to be owned by the @@ -53,7 +51,7 @@ class PasswordStore // allocation, then the request must take care of the deletion. class GetLoginsRequest : public CancelableRequest1<GetLoginsCallback, - std::vector<webkit::forms::PasswordForm*> > { + std::vector<content::PasswordForm*> > { public: explicit GetLoginsRequest(const GetLoginsCallback& callback); @@ -92,13 +90,13 @@ class PasswordStore virtual bool Init(); // Adds the given PasswordForm to the secure password store asynchronously. - virtual void AddLogin(const webkit::forms::PasswordForm& form); + virtual void AddLogin(const content::PasswordForm& form); // Updates the matching PasswordForm in the secure password store (async). - void UpdateLogin(const webkit::forms::PasswordForm& form); + void UpdateLogin(const content::PasswordForm& form); // Removes the matching PasswordForm from the secure password store (async). - void RemoveLogin(const webkit::forms::PasswordForm& form); + void RemoveLogin(const content::PasswordForm& form); // Removes all logins created in the given date range. void RemoveLoginsCreatedBetween(const base::Time& delete_begin, @@ -107,7 +105,7 @@ class PasswordStore // Searches for a matching PasswordForm and returns a handle so the async // request can be tracked. Implement the PasswordStoreConsumer interface to be // notified on completion. - virtual Handle GetLogins(const webkit::forms::PasswordForm& form, + virtual Handle GetLogins(const content::PasswordForm& form, PasswordStoreConsumer* consumer); // Gets the complete list of PasswordForms that are not blacklist entries--and @@ -136,11 +134,11 @@ class PasswordStore friend class browser_sync::PasswordModelAssociator; friend class browser_sync::PasswordModelWorker; friend void passwords_helper::AddLogin(PasswordStore*, - const webkit::forms::PasswordForm&); + const content::PasswordForm&); friend void passwords_helper::RemoveLogin(PasswordStore*, - const webkit::forms::PasswordForm&); + const content::PasswordForm&); friend void passwords_helper::UpdateLogin(PasswordStore*, - const webkit::forms::PasswordForm&); + const content::PasswordForm&); virtual ~PasswordStore(); @@ -156,11 +154,11 @@ class PasswordStore // Synchronous implementation that reports usage metrics. virtual void ReportMetricsImpl() = 0; // Synchronous implementation to add the given login. - virtual void AddLoginImpl(const webkit::forms::PasswordForm& form) = 0; + virtual void AddLoginImpl(const content::PasswordForm& form) = 0; // Synchronous implementation to update the given login. - virtual void UpdateLoginImpl(const webkit::forms::PasswordForm& form) = 0; + virtual void UpdateLoginImpl(const content::PasswordForm& form) = 0; // Synchronous implementation to remove the given login. - virtual void RemoveLoginImpl(const webkit::forms::PasswordForm& form) = 0; + virtual void RemoveLoginImpl(const content::PasswordForm& form) = 0; // Synchronous implementation to remove the given logins. virtual void RemoveLoginsCreatedBetweenImpl(const base::Time& delete_begin, const base::Time& delete_end) = 0; @@ -168,7 +166,7 @@ class PasswordStore // will then be scored by the PasswordFormManager. Once they are found // (or not), the consumer should be notified. virtual void GetLoginsImpl(GetLoginsRequest* request, - const webkit::forms::PasswordForm& form) = 0; + const content::PasswordForm& form) = 0; // Finds all non-blacklist PasswordForms, and notifies the consumer. virtual void GetAutofillableLoginsImpl(GetLoginsRequest* request) = 0; // Finds all blacklist PasswordForms, and notifies the consumer. @@ -176,10 +174,10 @@ class PasswordStore // Finds all non-blacklist PasswordForms, and fills the vector. virtual bool FillAutofillableLogins( - std::vector<webkit::forms::PasswordForm*>* forms) = 0; + std::vector<content::PasswordForm*>* forms) = 0; // Finds all blacklist PasswordForms, and fills the vector. virtual bool FillBlacklistLogins( - std::vector<webkit::forms::PasswordForm*>* forms) = 0; + std::vector<content::PasswordForm*>* forms) = 0; // Dispatches the result to the PasswordStoreConsumer on the original caller's // thread so the callback can be executed there. This should be the UI thread. @@ -196,7 +194,7 @@ class PasswordStore // See GetLogins() for more information on |ignore_logins_cutoff|. template<typename BackendFunc> Handle Schedule(BackendFunc func, PasswordStoreConsumer* consumer, - const webkit::forms::PasswordForm& form, + const content::PasswordForm& form, const base::Time& ignore_logins_cutoff); // Wrapper method called on the destination thread (DB for non-mac) that diff --git a/chrome/browser/password_manager/password_store_change.h b/chrome/browser/password_manager/password_store_change.h index 8e5de8d..404f57b 100644 --- a/chrome/browser/password_manager/password_store_change.h +++ b/chrome/browser/password_manager/password_store_change.h @@ -7,7 +7,7 @@ #include <vector> -#include "webkit/forms/password_form.h" +#include "content/public/common/password_form.h" class PasswordStoreChange { public: @@ -17,13 +17,13 @@ class PasswordStoreChange { REMOVE, }; - PasswordStoreChange(Type type, const webkit::forms::PasswordForm& form) + PasswordStoreChange(Type type, const content::PasswordForm& form) : type_(type), form_(form) { } virtual ~PasswordStoreChange() {} Type type() const { return type_; } - const webkit::forms::PasswordForm& form() const { return form_; } + const content::PasswordForm& form() const { return form_; } bool operator==(const PasswordStoreChange& other) const { return type() == other.type() && @@ -45,7 +45,7 @@ class PasswordStoreChange { private: Type type_; - webkit::forms::PasswordForm form_; + content::PasswordForm form_; }; typedef std::vector<PasswordStoreChange> PasswordStoreChangeList; diff --git a/chrome/browser/password_manager/password_store_consumer.h b/chrome/browser/password_manager/password_store_consumer.h index 7d2ab8d..87e7f43 100644 --- a/chrome/browser/password_manager/password_store_consumer.h +++ b/chrome/browser/password_manager/password_store_consumer.h @@ -7,11 +7,9 @@ #include "chrome/browser/common/cancelable_request.h" -namespace webkit { -namespace forms { +namespace content { struct PasswordForm; } -} // Reads from the PasswordStore are done asynchronously on a separate // thread. PasswordStoreConsumer provides the virtual callback method, which is @@ -26,7 +24,7 @@ class PasswordStoreConsumer { // anyway with an empty vector. virtual void OnPasswordStoreRequestDone( CancelableRequestProvider::Handle handle, - const std::vector<webkit::forms::PasswordForm*>& result) = 0; + const std::vector<content::PasswordForm*>& result) = 0; // The CancelableRequest framework needs both a callback (the // PasswordStoreConsumer::OnPasswordStoreRequestDone) as well as a diff --git a/chrome/browser/password_manager/password_store_default.cc b/chrome/browser/password_manager/password_store_default.cc index 50f54f9..a5c6db6 100644 --- a/chrome/browser/password_manager/password_store_default.cc +++ b/chrome/browser/password_manager/password_store_default.cc @@ -18,7 +18,7 @@ #include "content/public/browser/notification_service.h" using content::BrowserThread; -using webkit::forms::PasswordForm; +using content::PasswordForm; PasswordStoreDefault::PasswordStoreDefault(LoginDatabase* login_db, Profile* profile) @@ -94,7 +94,7 @@ void PasswordStoreDefault::RemoveLoginsCreatedBetweenImpl( } void PasswordStoreDefault::GetLoginsImpl( - GetLoginsRequest* request, const webkit::forms::PasswordForm& form) { + GetLoginsRequest* request, const content::PasswordForm& form) { login_db_->GetLogins(form, &request->value); ForwardLoginsResult(request); } diff --git a/chrome/browser/password_manager/password_store_default.h b/chrome/browser/password_manager/password_store_default.h index 0fe7750..ac624ca 100644 --- a/chrome/browser/password_manager/password_store_default.h +++ b/chrome/browser/password_manager/password_store_default.h @@ -29,21 +29,21 @@ class PasswordStoreDefault : public PasswordStore { // Implements PasswordStore interface. virtual void ReportMetricsImpl() OVERRIDE; - virtual void AddLoginImpl(const webkit::forms::PasswordForm& form) OVERRIDE; + virtual void AddLoginImpl(const content::PasswordForm& form) OVERRIDE; virtual void UpdateLoginImpl( - const webkit::forms::PasswordForm& form) OVERRIDE; + const content::PasswordForm& form) OVERRIDE; virtual void RemoveLoginImpl( - const webkit::forms::PasswordForm& form) OVERRIDE; + const content::PasswordForm& form) OVERRIDE; virtual void RemoveLoginsCreatedBetweenImpl( const base::Time& delete_begin, const base::Time& delete_end) OVERRIDE; virtual void GetLoginsImpl(GetLoginsRequest* request, - const webkit::forms::PasswordForm& form) OVERRIDE; + const content::PasswordForm& form) OVERRIDE; virtual void GetAutofillableLoginsImpl(GetLoginsRequest* request) OVERRIDE; virtual void GetBlacklistLoginsImpl(GetLoginsRequest* request) OVERRIDE; virtual bool FillAutofillableLogins( - std::vector<webkit::forms::PasswordForm*>* forms) OVERRIDE; + std::vector<content::PasswordForm*>* forms) OVERRIDE; virtual bool FillBlacklistLogins( - std::vector<webkit::forms::PasswordForm*>* forms) OVERRIDE; + std::vector<content::PasswordForm*>* forms) OVERRIDE; protected: inline bool DeleteAndRecreateDatabaseFile() { diff --git a/chrome/browser/password_manager/password_store_default_unittest.cc b/chrome/browser/password_manager/password_store_default_unittest.cc index 4c99c42..32c6f43 100644 --- a/chrome/browser/password_manager/password_store_default_unittest.cc +++ b/chrome/browser/password_manager/password_store_default_unittest.cc @@ -28,13 +28,13 @@ using base::WaitableEvent; using content::BrowserThread; +using content::PasswordForm; using testing::_; using testing::DoAll; using testing::ElementsAreArray; using testing::Pointee; using testing::Property; using testing::WithArg; -using webkit::forms::PasswordForm; namespace { diff --git a/chrome/browser/password_manager/password_store_mac.cc b/chrome/browser/password_manager/password_store_mac.cc index a1cb791..5c2bb25 100644 --- a/chrome/browser/password_manager/password_store_mac.cc +++ b/chrome/browser/password_manager/password_store_mac.cc @@ -25,7 +25,7 @@ #include "crypto/apple_keychain.h" using crypto::AppleKeychain; -using webkit::forms::PasswordForm; +using content::PasswordForm; // Utility class to handle the details of constructing and running a keychain // search from a set of attributes. @@ -644,7 +644,7 @@ SecKeychainItemRef MacKeychainPasswordFormAdapter::KeychainItemForForm( std::vector<SecKeychainItemRef> MacKeychainPasswordFormAdapter::MatchingKeychainItems( const std::string& signon_realm, - webkit::forms::PasswordForm::Scheme scheme, + content::PasswordForm::Scheme scheme, const char* path, const char* username) { std::vector<SecKeychainItemRef> matches; @@ -889,7 +889,7 @@ void PasswordStoreMac::RemoveLoginsCreatedBetweenImpl( } void PasswordStoreMac::GetLoginsImpl(GetLoginsRequest* request, - const webkit::forms::PasswordForm& form) { + const content::PasswordForm& form) { MacKeychainPasswordFormAdapter keychain_adapter(keychain_.get()); std::vector<PasswordForm*> keychain_forms = keychain_adapter.PasswordsFillingForm(form); @@ -962,7 +962,7 @@ bool PasswordStoreMac::AddToKeychainIfNecessary(const PasswordForm& form) { } bool PasswordStoreMac::DatabaseHasFormMatchingKeychainForm( - const webkit::forms::PasswordForm& form) { + const content::PasswordForm& form) { bool has_match = false; std::vector<PasswordForm*> database_forms; login_metadata_db_->GetLogins(form, &database_forms); diff --git a/chrome/browser/password_manager/password_store_mac.h b/chrome/browser/password_manager/password_store_mac.h index 3974ecb..39cc572 100644 --- a/chrome/browser/password_manager/password_store_mac.h +++ b/chrome/browser/password_manager/password_store_mac.h @@ -44,44 +44,44 @@ class PasswordStoreMac : public PasswordStore { private: virtual void ReportMetricsImpl() OVERRIDE; - virtual void AddLoginImpl(const webkit::forms::PasswordForm& form) OVERRIDE; + virtual void AddLoginImpl(const content::PasswordForm& form) OVERRIDE; virtual void UpdateLoginImpl( - const webkit::forms::PasswordForm& form) OVERRIDE; + const content::PasswordForm& form) OVERRIDE; virtual void RemoveLoginImpl( - const webkit::forms::PasswordForm& form) OVERRIDE; + const content::PasswordForm& form) OVERRIDE; virtual void RemoveLoginsCreatedBetweenImpl( const base::Time& delete_begin, const base::Time& delete_end) OVERRIDE; virtual void GetLoginsImpl(GetLoginsRequest* request, - const webkit::forms::PasswordForm& form) OVERRIDE; + const content::PasswordForm& form) OVERRIDE; virtual void GetAutofillableLoginsImpl(GetLoginsRequest* request) OVERRIDE; virtual void GetBlacklistLoginsImpl(GetLoginsRequest* request) OVERRIDE; virtual bool FillAutofillableLogins( - std::vector<webkit::forms::PasswordForm*>* forms) OVERRIDE; + std::vector<content::PasswordForm*>* forms) OVERRIDE; virtual bool FillBlacklistLogins( - std::vector<webkit::forms::PasswordForm*>* forms) OVERRIDE; + std::vector<content::PasswordForm*>* forms) OVERRIDE; // Adds the given form to the Keychain if it's something we want to store // there (i.e., not a blacklist entry). Returns true if the operation // succeeded (either we added successfully, or we didn't need to). - bool AddToKeychainIfNecessary(const webkit::forms::PasswordForm& form); + bool AddToKeychainIfNecessary(const content::PasswordForm& form); // Returns true if our database contains a form that exactly matches the given // keychain form. bool DatabaseHasFormMatchingKeychainForm( - const webkit::forms::PasswordForm& form); + const content::PasswordForm& form); // Returns all the Keychain entries that we own but no longer have // corresponding metadata for in our database. // Caller is responsible for deleting the forms. - std::vector<webkit::forms::PasswordForm*> GetUnusedKeychainForms(); + std::vector<content::PasswordForm*> GetUnusedKeychainForms(); // Removes the given forms from the database. void RemoveDatabaseForms( - const std::vector<webkit::forms::PasswordForm*>& forms); + const std::vector<content::PasswordForm*>& forms); // Removes the given forms from the Keychain. void RemoveKeychainForms( - const std::vector<webkit::forms::PasswordForm*>& forms); + const std::vector<content::PasswordForm*>& forms); // Allows the creation of |notification_service_| to be scheduled on the right // thread. diff --git a/chrome/browser/password_manager/password_store_mac_internal.h b/chrome/browser/password_manager/password_store_mac_internal.h index b287557..9a01ea4 100644 --- a/chrome/browser/password_manager/password_store_mac_internal.h +++ b/chrome/browser/password_manager/password_store_mac_internal.h @@ -26,40 +26,40 @@ class MacKeychainPasswordFormAdapter { // Returns PasswordForms for each keychain entry that could be used to fill // |form|. Caller is responsible for deleting the returned forms. - std::vector<webkit::forms::PasswordForm*> PasswordsFillingForm( - const webkit::forms::PasswordForm& query_form); + std::vector<content::PasswordForm*> PasswordsFillingForm( + const content::PasswordForm& query_form); // Returns PasswordForms for each keychain entry that could be merged with // |form|. Differs from PasswordsFillingForm in that the username must match. // Caller is responsible for deleting the returned forms. - std::vector<webkit::forms::PasswordForm*> PasswordsMergeableWithForm( - const webkit::forms::PasswordForm& query_form); + std::vector<content::PasswordForm*> PasswordsMergeableWithForm( + const content::PasswordForm& query_form); // Returns the PasswordForm for the Keychain entry that matches |form| on all // of the fields that uniquely identify a Keychain item, or NULL if there is // no such entry. // Caller is responsible for deleting the returned form. - webkit::forms::PasswordForm* PasswordExactlyMatchingForm( - const webkit::forms::PasswordForm& query_form); + content::PasswordForm* PasswordExactlyMatchingForm( + const content::PasswordForm& query_form); // Returns true if PasswordsMergeableWithForm would return any items. This is // a separate method because calling PasswordsMergeableWithForm and checking // the return count would require reading the passwords from the keychain, // thus potentially triggering authorizaiton UI, whereas this won't. bool HasPasswordsMergeableWithForm( - const webkit::forms::PasswordForm& query_form); + const content::PasswordForm& query_form); // Returns all keychain items of types corresponding to password forms. - std::vector<webkit::forms::PasswordForm*> GetAllPasswordFormPasswords(); + std::vector<content::PasswordForm*> GetAllPasswordFormPasswords(); // Creates a new keychain entry from |form|, or updates the password of an // existing keychain entry if there is a collision. Returns true if a keychain // entry was successfully added/updated. - bool AddPassword(const webkit::forms::PasswordForm& form); + bool AddPassword(const content::PasswordForm& form); // Removes the keychain password matching |form| if any. Returns true if a // keychain item was found and successfully removed. - bool RemovePassword(const webkit::forms::PasswordForm& form); + bool RemovePassword(const content::PasswordForm& form); // Controls whether or not Chrome will restrict Keychain searches to items // that it created. Defaults to false. @@ -69,14 +69,14 @@ class MacKeychainPasswordFormAdapter { // Returns PasswordForms constructed from the given Keychain items, calling // AppleKeychain::Free on all of the keychain items and clearing the vector. // Caller is responsible for deleting the returned forms. - std::vector<webkit::forms::PasswordForm*> ConvertKeychainItemsToForms( + std::vector<content::PasswordForm*> ConvertKeychainItemsToForms( std::vector<SecKeychainItemRef>* items); // Searches |keychain| for the specific keychain entry that corresponds to the // given form, and returns it (or NULL if no match is found). The caller is // responsible for calling AppleKeychain::Free on on the returned item. SecKeychainItemRef KeychainItemForForm( - const webkit::forms::PasswordForm& form); + const content::PasswordForm& form); // Returns the Keychain items matching the given signon_realm, scheme, and // optionally path and username (either of both can be NULL). @@ -84,7 +84,7 @@ class MacKeychainPasswordFormAdapter { // returned items. std::vector<SecKeychainItemRef> MatchingKeychainItems( const std::string& signon_realm, - webkit::forms::PasswordForm::Scheme scheme, + content::PasswordForm::Scheme scheme, const char* path, const char* username); @@ -100,7 +100,7 @@ class MacKeychainPasswordFormAdapter { // Returns the Keychain SecAuthenticationType type corresponding to |scheme|. SecAuthenticationType AuthTypeForScheme( - webkit::forms::PasswordForm::Scheme scheme); + content::PasswordForm::Scheme scheme); // Changes the password for keychain_item to |password|; returns true if the // password was successfully changed. @@ -142,12 +142,12 @@ namespace internal_keychain_helpers { // require authorization). bool FillPasswordFormFromKeychainItem(const AppleKeychain& keychain, const SecKeychainItemRef& keychain_item, - webkit::forms::PasswordForm* form); + content::PasswordForm* form); // Returns true if the two given forms match based on signon_reaml, scheme, and // username_value, and are thus suitable for merging (see MergePasswordForms). -bool FormsMatchForMerge(const webkit::forms::PasswordForm& form_a, - const webkit::forms::PasswordForm& form_b); +bool FormsMatchForMerge(const content::PasswordForm& form_a, + const content::PasswordForm& form_b); // Populates merged_forms by combining the password data from keychain_forms and // the metadata from database_forms, removing used entries from the two source @@ -159,16 +159,16 @@ bool FormsMatchForMerge(const webkit::forms::PasswordForm& form_a, // keychain_forms its entries that weren't merged into at least one database // form. void MergePasswordForms( - std::vector<webkit::forms::PasswordForm*>* keychain_forms, - std::vector<webkit::forms::PasswordForm*>* database_forms, - std::vector<webkit::forms::PasswordForm*>* merged_forms); + std::vector<content::PasswordForm*>* keychain_forms, + std::vector<content::PasswordForm*>* database_forms, + std::vector<content::PasswordForm*>* merged_forms); // Fills in the passwords for as many of the forms in |database_forms| as // possible using entries from |keychain| and returns them. On return, // |database_forms| will contain only the forms for which no password was found. -std::vector<webkit::forms::PasswordForm*> GetPasswordsForForms( +std::vector<content::PasswordForm*> GetPasswordsForForms( const AppleKeychain& keychain, - std::vector<webkit::forms::PasswordForm*>* database_forms); + std::vector<content::PasswordForm*>* database_forms); } // internal_keychain_helpers diff --git a/chrome/browser/password_manager/password_store_mac_unittest.cc b/chrome/browser/password_manager/password_store_mac_unittest.cc index be42d3b..1a689ce 100644 --- a/chrome/browser/password_manager/password_store_mac_unittest.cc +++ b/chrome/browser/password_manager/password_store_mac_unittest.cc @@ -21,7 +21,7 @@ using content::BrowserThread; using crypto::MockAppleKeychain; -using webkit::forms::PasswordForm; +using content::PasswordForm; using testing::_; using testing::DoAll; using testing::WithArg; @@ -32,7 +32,7 @@ class MockPasswordStoreConsumer : public PasswordStoreConsumer { public: MOCK_METHOD2(OnPasswordStoreRequestDone, void(CancelableRequestProvider::Handle, - const std::vector<webkit::forms::PasswordForm*>&)); + const std::vector<content::PasswordForm*>&)); }; ACTION(STLDeleteElements0) { diff --git a/chrome/browser/password_manager/password_store_unittest.cc b/chrome/browser/password_manager/password_store_unittest.cc index f7fdc89..aec69d9 100644 --- a/chrome/browser/password_manager/password_store_unittest.cc +++ b/chrome/browser/password_manager/password_store_unittest.cc @@ -26,7 +26,7 @@ using content::BrowserThread; using testing::_; using testing::DoAll; using testing::WithArg; -using webkit::forms::PasswordForm; +using content::PasswordForm; namespace { diff --git a/chrome/browser/password_manager/password_store_win.cc b/chrome/browser/password_manager/password_store_win.cc index cdabe99..3982ec4 100644 --- a/chrome/browser/password_manager/password_store_win.cc +++ b/chrome/browser/password_manager/password_store_win.cc @@ -16,7 +16,7 @@ #include "chrome/browser/webdata/web_data_service.h" using content::BrowserThread; -using webkit::forms::PasswordForm; +using content::PasswordForm; namespace { // Subclass GetLoginsRequest in order to hold a copy of the form information diff --git a/chrome/browser/password_manager/password_store_win.h b/chrome/browser/password_manager/password_store_win.h index 22006e6..c4dae0c 100644 --- a/chrome/browser/password_manager/password_store_win.h +++ b/chrome/browser/password_manager/password_store_win.h @@ -12,11 +12,9 @@ class LoginDatabase; class Profile; class WebDataService; -namespace webkit { -namespace forms { +namespace content { struct PasswordForm; } -} // Windows PasswordStore implementation that uses the default implementation, // but also uses IE7 passwords if no others found. @@ -46,7 +44,7 @@ class PasswordStoreWin : public PasswordStoreDefault { // Overridden so that we can save the form for later use. virtual void GetLoginsImpl(GetLoginsRequest* request, - const webkit::forms::PasswordForm& form) OVERRIDE; + const content::PasswordForm& form) OVERRIDE; scoped_ptr<DBHandler> db_handler_; diff --git a/chrome/browser/password_manager/password_store_win_unittest.cc b/chrome/browser/password_manager/password_store_win_unittest.cc index 6a18b21a..e75861f 100644 --- a/chrome/browser/password_manager/password_store_win_unittest.cc +++ b/chrome/browser/password_manager/password_store_win_unittest.cc @@ -32,7 +32,7 @@ using content::BrowserThread; using testing::_; using testing::DoAll; using testing::WithArg; -using webkit::forms::PasswordForm; +using content::PasswordForm; namespace { @@ -40,7 +40,7 @@ class MockPasswordStoreConsumer : public PasswordStoreConsumer { public: MOCK_METHOD2(OnPasswordStoreRequestDone, void(CancelableRequestProvider::Handle, - const std::vector<webkit::forms::PasswordForm*>&)); + const std::vector<content::PasswordForm*>&)); }; class MockWebDataServiceConsumer : public WebDataServiceConsumer { diff --git a/chrome/browser/password_manager/password_store_x.cc b/chrome/browser/password_manager/password_store_x.cc index 13e5a98..f1e29c3 100644 --- a/chrome/browser/password_manager/password_store_x.cc +++ b/chrome/browser/password_manager/password_store_x.cc @@ -20,7 +20,7 @@ using content::BrowserThread; using std::vector; -using webkit::forms::PasswordForm; +using content::PasswordForm; PasswordStoreX::PasswordStoreX(LoginDatabase* login_db, Profile* profile, diff --git a/chrome/browser/password_manager/password_store_x.h b/chrome/browser/password_manager/password_store_x.h index 5f8e455..5caad55 100644 --- a/chrome/browser/password_manager/password_store_x.h +++ b/chrome/browser/password_manager/password_store_x.h @@ -28,18 +28,18 @@ class PasswordStoreX : public PasswordStoreDefault { // with return values rather than implicit consumer notification. class NativeBackend { public: - typedef std::vector<webkit::forms::PasswordForm*> PasswordFormList; + typedef std::vector<content::PasswordForm*> PasswordFormList; virtual ~NativeBackend() {} virtual bool Init() = 0; - virtual bool AddLogin(const webkit::forms::PasswordForm& form) = 0; - virtual bool UpdateLogin(const webkit::forms::PasswordForm& form) = 0; - virtual bool RemoveLogin(const webkit::forms::PasswordForm& form) = 0; + virtual bool AddLogin(const content::PasswordForm& form) = 0; + virtual bool UpdateLogin(const content::PasswordForm& form) = 0; + virtual bool RemoveLogin(const content::PasswordForm& form) = 0; virtual bool RemoveLoginsCreatedBetween(const base::Time& delete_begin, const base::Time& delete_end) = 0; - virtual bool GetLogins(const webkit::forms::PasswordForm& form, + virtual bool GetLogins(const content::PasswordForm& form, PasswordFormList* forms) = 0; virtual bool GetLoginsCreatedBetween(const base::Time& get_begin, const base::Time& get_end, @@ -73,21 +73,21 @@ class PasswordStoreX : public PasswordStoreDefault { virtual ~PasswordStoreX(); // Implements PasswordStore interface. - virtual void AddLoginImpl(const webkit::forms::PasswordForm& form) OVERRIDE; + virtual void AddLoginImpl(const content::PasswordForm& form) OVERRIDE; virtual void UpdateLoginImpl( - const webkit::forms::PasswordForm& form) OVERRIDE; + const content::PasswordForm& form) OVERRIDE; virtual void RemoveLoginImpl( - const webkit::forms::PasswordForm& form) OVERRIDE; + const content::PasswordForm& form) OVERRIDE; virtual void RemoveLoginsCreatedBetweenImpl( const base::Time& delete_begin, const base::Time& delete_end) OVERRIDE; virtual void GetLoginsImpl(GetLoginsRequest* request, - const webkit::forms::PasswordForm& form) OVERRIDE; + const content::PasswordForm& form) OVERRIDE; virtual void GetAutofillableLoginsImpl(GetLoginsRequest* request) OVERRIDE; virtual void GetBlacklistLoginsImpl(GetLoginsRequest* request) OVERRIDE; virtual bool FillAutofillableLogins( - std::vector<webkit::forms::PasswordForm*>* forms) OVERRIDE; + std::vector<content::PasswordForm*>* forms) OVERRIDE; virtual bool FillBlacklistLogins( - std::vector<webkit::forms::PasswordForm*>* forms) OVERRIDE; + std::vector<content::PasswordForm*>* forms) OVERRIDE; // Sort logins by origin, like the ORDER BY clause in login_database.cc. void SortLoginsByOrigin(NativeBackend::PasswordFormList* list); diff --git a/chrome/browser/password_manager/password_store_x_unittest.cc b/chrome/browser/password_manager/password_store_x_unittest.cc index 29ed91a..55d2d3c 100644 --- a/chrome/browser/password_manager/password_store_x_unittest.cc +++ b/chrome/browser/password_manager/password_store_x_unittest.cc @@ -39,7 +39,7 @@ using testing::ElementsAreArray; using testing::Pointee; using testing::Property; using testing::WithArg; -using webkit::forms::PasswordForm; +using content::PasswordForm; typedef std::vector<PasswordForm*> VectorOfForms; diff --git a/chrome/browser/sync/glue/password_change_processor.cc b/chrome/browser/sync/glue/password_change_processor.cc index d9cd1c5..5a6e456 100644 --- a/chrome/browser/sync/glue/password_change_processor.cc +++ b/chrome/browser/sync/glue/password_change_processor.cc @@ -18,12 +18,12 @@ #include "chrome/common/chrome_notification_types.h" #include "content/public/browser/notification_details.h" #include "content/public/browser/notification_source.h" +#include "content/public/common/password_form.h" #include "sync/internal_api/public/change_record.h" #include "sync/internal_api/public/read_node.h" #include "sync/internal_api/public/write_node.h" #include "sync/internal_api/public/write_transaction.h" #include "sync/protocol/password_specifics.pb.h" -#include "webkit/forms/password_form.h" using content::BrowserThread; @@ -184,7 +184,7 @@ void PasswordChangeProcessor::ApplyChangesFromSyncModel( syncer::ExtraPasswordChangeRecordData* extra = it->extra.get(); const sync_pb::PasswordSpecificsData& password = extra->unencrypted(); - webkit::forms::PasswordForm form; + content::PasswordForm form; PasswordModelAssociator::CopyPassword(password, &form); deleted_passwords_.push_back(form); model_associator_->Disassociate(it->id); @@ -204,7 +204,7 @@ void PasswordChangeProcessor::ApplyChangesFromSyncModel( const sync_pb::PasswordSpecificsData& password_data = sync_node.GetPasswordSpecifics(); - webkit::forms::PasswordForm password; + content::PasswordForm password; PasswordModelAssociator::CopyPassword(password_data, &password); if (syncer::ChangeRecord::ACTION_ADD == it->action) { diff --git a/chrome/browser/sync/glue/password_model_associator.cc b/chrome/browser/sync/glue/password_model_associator.cc index 219de0d..958c9d2 100644 --- a/chrome/browser/sync/glue/password_model_associator.cc +++ b/chrome/browser/sync/glue/password_model_associator.cc @@ -11,6 +11,7 @@ #include "base/utf_string_conversions.h" #include "chrome/browser/password_manager/password_store.h" #include "chrome/browser/sync/profile_sync_service.h" +#include "content/public/common/password_form.h" #include "net/base/escape.h" #include "sync/api/sync_error.h" #include "sync/internal_api/public/read_node.h" @@ -18,7 +19,6 @@ #include "sync/internal_api/public/write_node.h" #include "sync/internal_api/public/write_transaction.h" #include "sync/protocol/password_specifics.pb.h" -#include "webkit/forms/password_form.h" using content::BrowserThread; @@ -58,7 +58,7 @@ syncer::SyncError PasswordModelAssociator::AssociateModels() { // We must not be holding a transaction when we interact with the password // store, as it can post tasks to the UI thread which can itself be blocked // on our transaction, resulting in deadlock. (http://crbug.com/70658) - std::vector<webkit::forms::PasswordForm*> passwords; + std::vector<content::PasswordForm*> passwords; if (!password_store_->FillAutofillableLogins(&passwords) || !password_store_->FillBlacklistLogins(&passwords)) { STLDeleteElements(&passwords); @@ -83,7 +83,7 @@ syncer::SyncError PasswordModelAssociator::AssociateModels() { model_type()); } - for (std::vector<webkit::forms::PasswordForm*>::iterator ix = + for (std::vector<content::PasswordForm*>::iterator ix = passwords.begin(); ix != passwords.end(); ++ix) { if (IsAbortPending()) { @@ -98,7 +98,7 @@ syncer::SyncError PasswordModelAssociator::AssociateModels() { node.GetPasswordSpecifics(); DCHECK_EQ(tag, MakeTag(password)); - webkit::forms::PasswordForm new_password; + content::PasswordForm new_password; if (MergePasswords(password, **ix, &new_password)) { syncer::WriteNode write_node(&trans); @@ -154,7 +154,7 @@ syncer::SyncError PasswordModelAssociator::AssociateModels() { // The password only exists on the server. Add it to the local // model. if (current_passwords.find(tag) == current_passwords.end()) { - webkit::forms::PasswordForm new_password; + content::PasswordForm new_password; CopyPassword(password, &new_password); Associate(&tag, sync_child_node.GetId()); @@ -328,9 +328,9 @@ syncer::SyncError PasswordModelAssociator::WriteToPasswordStore( // static void PasswordModelAssociator::CopyPassword( const sync_pb::PasswordSpecificsData& password, - webkit::forms::PasswordForm* new_password) { + content::PasswordForm* new_password) { new_password->scheme = - static_cast<webkit::forms::PasswordForm::Scheme>(password.scheme()); + static_cast<content::PasswordForm::Scheme>(password.scheme()); new_password->signon_realm = password.signon_realm(); new_password->origin = GURL(password.origin()); new_password->action = GURL(password.action()); @@ -353,8 +353,8 @@ void PasswordModelAssociator::CopyPassword( // static bool PasswordModelAssociator::MergePasswords( const sync_pb::PasswordSpecificsData& password, - const webkit::forms::PasswordForm& password_form, - webkit::forms::PasswordForm* new_password) { + const content::PasswordForm& password_form, + content::PasswordForm* new_password) { DCHECK(new_password); if (password.scheme() == password_form.scheme && @@ -389,7 +389,7 @@ bool PasswordModelAssociator::MergePasswords( // static void PasswordModelAssociator::WriteToSyncNode( - const webkit::forms::PasswordForm& password_form, + const content::PasswordForm& password_form, syncer::WriteNode* node) { sync_pb::PasswordSpecificsData password; password.set_scheme(password_form.scheme); @@ -410,7 +410,7 @@ void PasswordModelAssociator::WriteToSyncNode( // static std::string PasswordModelAssociator::MakeTag( - const webkit::forms::PasswordForm& password) { + const content::PasswordForm& password) { return MakeTag(password.origin.spec(), UTF16ToUTF8(password.username_element), UTF16ToUTF8(password.username_value), diff --git a/chrome/browser/sync/glue/password_model_associator.h b/chrome/browser/sync/glue/password_model_associator.h index e3d14f3..5c68efa 100644 --- a/chrome/browser/sync/glue/password_model_associator.h +++ b/chrome/browser/sync/glue/password_model_associator.h @@ -21,11 +21,9 @@ class MessageLoop; class PasswordStore; class ProfileSyncService; -namespace webkit { -namespace forms { +namespace content { struct PasswordForm; } -} namespace syncer { class WriteNode; @@ -44,7 +42,7 @@ extern const char kPasswordTag[]; class PasswordModelAssociator : public PerDataTypeAssociatorInterface<std::string, std::string> { public: - typedef std::vector<webkit::forms::PasswordForm> PasswordVector; + typedef std::vector<content::PasswordForm> PasswordVector; static syncer::ModelType model_type() { return syncer::PASSWORDS; } PasswordModelAssociator(ProfileSyncService* sync_service, @@ -98,7 +96,7 @@ class PasswordModelAssociator const PasswordVector* updated_passwords, const PasswordVector* deleted_passwords); - static std::string MakeTag(const webkit::forms::PasswordForm& password); + static std::string MakeTag(const content::PasswordForm& password); static std::string MakeTag(const sync_pb::PasswordSpecificsData& password); static std::string MakeTag(const std::string& origin_url, const std::string& username_element, @@ -107,12 +105,12 @@ class PasswordModelAssociator const std::string& signon_realm); static void CopyPassword(const sync_pb::PasswordSpecificsData& password, - webkit::forms::PasswordForm* new_password); + content::PasswordForm* new_password); static bool MergePasswords(const sync_pb::PasswordSpecificsData& password, - const webkit::forms::PasswordForm& password_form, - webkit::forms::PasswordForm* new_password); - static void WriteToSyncNode(const webkit::forms::PasswordForm& password_form, + const content::PasswordForm& password_form, + content::PasswordForm* new_password); + static void WriteToSyncNode(const content::PasswordForm& password_form, syncer::WriteNode* node); // Called at various points in model association to determine if the diff --git a/chrome/browser/sync/profile_sync_service_password_unittest.cc b/chrome/browser/sync/profile_sync_service_password_unittest.cc index efe136c..b85a07c 100644 --- a/chrome/browser/sync/profile_sync_service_password_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_password_unittest.cc @@ -32,6 +32,7 @@ #include "chrome/common/pref_names.h" #include "chrome/test/base/profile_mock.h" #include "content/public/browser/notification_source.h" +#include "content/public/common/password_form.h" #include "content/public/test/mock_notification_observer.h" #include "content/public/test/test_browser_thread.h" #include "google_apis/gaia/gaia_constants.h" @@ -42,13 +43,13 @@ #include "sync/protocol/password_specifics.pb.h" #include "sync/test/engine/test_id_factory.h" #include "testing/gmock/include/gmock/gmock.h" -#include "webkit/forms/password_form.h" using base::Time; using browser_sync::PasswordChangeProcessor; using browser_sync::PasswordDataTypeController; using browser_sync::PasswordModelAssociator; using content::BrowserThread; +using content::PasswordForm; using syncer::syncable::WriteTransaction; using testing::_; using testing::AtLeast; @@ -56,7 +57,6 @@ using testing::DoAll; using testing::InvokeWithoutArgs; using testing::Return; using testing::SetArgumentPointee; -using webkit::forms::PasswordForm; ACTION_P3(MakePasswordSyncComponents, service, ps, dtc) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); diff --git a/chrome/browser/sync/test/integration/autofill_helper.cc b/chrome/browser/sync/test/integration/autofill_helper.cc index 42c32a1..82dde67 100644 --- a/chrome/browser/sync/test/integration/autofill_helper.cc +++ b/chrome/browser/sync/test/integration/autofill_helper.cc @@ -21,8 +21,8 @@ #include "chrome/browser/webdata/web_data_service_factory.h" #include "chrome/browser/webdata/web_database.h" #include "chrome/common/chrome_notification_types.h" +#include "chrome/common/form_field_data.h" #include "chrome/test/base/thread_observer_helper.h" -#include "webkit/forms/form_field.h" using base::WaitableEvent; using content::BrowserThread; @@ -159,11 +159,11 @@ PersonalDataManager* GetPersonalDataManager(int index) { } void AddKeys(int profile, const std::set<AutofillKey>& keys) { - std::vector<webkit::forms::FormField> form_fields; + std::vector<FormFieldData> form_fields; for (std::set<AutofillKey>::const_iterator i = keys.begin(); i != keys.end(); ++i) { - webkit::forms::FormField field; + FormFieldData field; field.name = i->name(); field.value = i->value(); form_fields.push_back(field); diff --git a/chrome/browser/sync/test/integration/multiple_client_passwords_sync_test.cc b/chrome/browser/sync/test/integration/multiple_client_passwords_sync_test.cc index a7b7271..f0e185f 100644 --- a/chrome/browser/sync/test/integration/multiple_client_passwords_sync_test.cc +++ b/chrome/browser/sync/test/integration/multiple_client_passwords_sync_test.cc @@ -14,7 +14,7 @@ using passwords_helper::CreateTestPasswordForm; using passwords_helper::GetPasswordCount; using passwords_helper::GetPasswordStore; -using webkit::forms::PasswordForm; +using content::PasswordForm; class MultipleClientPasswordsSyncTest : public SyncTest { public: diff --git a/chrome/browser/sync/test/integration/passwords_helper.cc b/chrome/browser/sync/test/integration/passwords_helper.cc index bd94344..e54d89d 100644 --- a/chrome/browser/sync/test/integration/passwords_helper.cc +++ b/chrome/browser/sync/test/integration/passwords_helper.cc @@ -19,7 +19,7 @@ #include "chrome/test/base/ui_test_utils.h" #include "content/public/browser/browser_thread.h" -using webkit::forms::PasswordForm; +using content::PasswordForm; using sync_datatype_helper::test; const std::string kFakeSignonRealm = "http://fake-signon-realm.google.com/"; diff --git a/chrome/browser/sync/test/integration/passwords_helper.h b/chrome/browser/sync/test/integration/passwords_helper.h index 737a811..2322944 100644 --- a/chrome/browser/sync/test/integration/passwords_helper.h +++ b/chrome/browser/sync/test/integration/passwords_helper.h @@ -11,7 +11,7 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/sync/profile_sync_service.h" #include "chrome/browser/sync/test/integration/sync_test.h" -#include "webkit/forms/password_form.h" +#include "content/public/common/password_form.h" class PasswordStore; @@ -20,21 +20,21 @@ namespace passwords_helper { // Adds the login held in |form| to the password store |store|. Even though // logins are normally added asynchronously, this method will block until the // login is added. -void AddLogin(PasswordStore* store, const webkit::forms::PasswordForm& form); +void AddLogin(PasswordStore* store, const content::PasswordForm& form); // Update the data held in password store |store| with a modified |form|. // This method blocks until the operation is complete. -void UpdateLogin(PasswordStore* store, const webkit::forms::PasswordForm& form); +void UpdateLogin(PasswordStore* store, const content::PasswordForm& form); // Searches |store| for all logins matching a fake signon realm used only by // LivePasswordsSyncTest and adds the results to |matches|. Note that the // caller is responsible for deleting the forms added to |matches|. void GetLogins(PasswordStore* store, - std::vector<webkit::forms::PasswordForm>& matches); + std::vector<content::PasswordForm>& matches); // Removes the login held in |form| from the password store |store|. This // method blocks until the operation is complete. -void RemoveLogin(PasswordStore* store, const webkit::forms::PasswordForm& form); +void RemoveLogin(PasswordStore* store, const content::PasswordForm& form); // Removes all password forms from the password store |store|. void RemoveLogins(PasswordStore* store); @@ -80,7 +80,7 @@ int GetVerifierPasswordCount(); // Creates a test password form with a well known fake signon realm used only // by LivePasswordsSyncTest based on |index|. -webkit::forms::PasswordForm CreateTestPasswordForm(int index); +content::PasswordForm CreateTestPasswordForm(int index); } // namespace passwords_helper diff --git a/chrome/browser/sync/test/integration/performance/passwords_sync_perf_test.cc b/chrome/browser/sync/test/integration/performance/passwords_sync_perf_test.cc index ffd64e9..16eb808 100644 --- a/chrome/browser/sync/test/integration/performance/passwords_sync_perf_test.cc +++ b/chrome/browser/sync/test/integration/performance/passwords_sync_perf_test.cc @@ -34,7 +34,7 @@ class PasswordsSyncPerfTest : public SyncTest { private: // Returns a new unique login. - webkit::forms::PasswordForm NextLogin(); + content::PasswordForm NextLogin(); // Returns a new unique password value. std::string NextPassword(); @@ -50,9 +50,9 @@ void PasswordsSyncPerfTest::AddLogins(int profile, int num_logins) { } void PasswordsSyncPerfTest::UpdateLogins(int profile) { - std::vector<webkit::forms::PasswordForm> logins; + std::vector<content::PasswordForm> logins; GetLogins(GetPasswordStore(profile), logins); - for (std::vector<webkit::forms::PasswordForm>::iterator it = logins.begin(); + for (std::vector<content::PasswordForm>::iterator it = logins.begin(); it != logins.end(); ++it) { (*it).password_value = ASCIIToUTF16(NextPassword()); UpdateLogin(GetPasswordStore(profile), (*it)); @@ -63,7 +63,7 @@ void PasswordsSyncPerfTest::RemoveLogins(int profile) { passwords_helper::RemoveLogins(GetPasswordStore(profile)); } -webkit::forms::PasswordForm PasswordsSyncPerfTest::NextLogin() { +content::PasswordForm PasswordsSyncPerfTest::NextLogin() { return CreateTestPasswordForm(password_number_++); } diff --git a/chrome/browser/sync/test/integration/single_client_passwords_sync_test.cc b/chrome/browser/sync/test/integration/single_client_passwords_sync_test.cc index f53955e..471146c 100644 --- a/chrome/browser/sync/test/integration/single_client_passwords_sync_test.cc +++ b/chrome/browser/sync/test/integration/single_client_passwords_sync_test.cc @@ -15,7 +15,7 @@ using passwords_helper::GetVerifierPasswordCount; using passwords_helper::GetVerifierPasswordStore; using passwords_helper::ProfileContainsSamePasswordFormsAsVerifier; -using webkit::forms::PasswordForm; +using content::PasswordForm; class SingleClientPasswordsSyncTest : public SyncTest { public: diff --git a/chrome/browser/sync/test/integration/two_client_passwords_sync_test.cc b/chrome/browser/sync/test/integration/two_client_passwords_sync_test.cc index 3b9a0ec..af281c9 100644 --- a/chrome/browser/sync/test/integration/two_client_passwords_sync_test.cc +++ b/chrome/browser/sync/test/integration/two_client_passwords_sync_test.cc @@ -24,7 +24,7 @@ using passwords_helper::SetDecryptionPassphrase; using passwords_helper::SetEncryptionPassphrase; using passwords_helper::UpdateLogin; -using webkit::forms::PasswordForm; +using content::PasswordForm; static const char* kValidPassphrase = "passphrase!"; static const char* kAnotherValidPassphrase = "another passphrase!"; diff --git a/chrome/browser/ui/autofill/tab_autofill_manager_delegate.cc b/chrome/browser/ui/autofill/tab_autofill_manager_delegate.cc index a26c3e3..f54c046 100644 --- a/chrome/browser/ui/autofill/tab_autofill_manager_delegate.cc +++ b/chrome/browser/ui/autofill/tab_autofill_manager_delegate.cc @@ -18,8 +18,8 @@ #include "chrome/browser/ui/chrome_pages.h" #include "chrome/browser/ui/tab_contents/tab_contents.h" #include "chrome/common/url_constants.h" +#include "content/public/common/password_form.h" #include "ui/gfx/rect.h" -#include "webkit/forms/password_form.h" DEFINE_WEB_CONTENTS_USER_DATA_KEY(TabAutofillManagerDelegate) @@ -74,7 +74,7 @@ void TabAutofillManagerDelegate::ShowAutofillSettings() { void TabAutofillManagerDelegate::ShowPasswordGenerationBubble( const gfx::Rect& bounds, - const webkit::forms::PasswordForm& form, + const content::PasswordForm& form, autofill::PasswordGenerator* generator) { #if defined(OS_ANDROID) NOTIMPLEMENTED(); diff --git a/chrome/browser/ui/autofill/tab_autofill_manager_delegate.h b/chrome/browser/ui/autofill/tab_autofill_manager_delegate.h index bdd5edc..020491c 100644 --- a/chrome/browser/ui/autofill/tab_autofill_manager_delegate.h +++ b/chrome/browser/ui/autofill/tab_autofill_manager_delegate.h @@ -30,7 +30,7 @@ class TabAutofillManagerDelegate virtual void ShowAutofillSettings() OVERRIDE; virtual void ShowPasswordGenerationBubble( const gfx::Rect& bounds, - const webkit::forms::PasswordForm& form, + const content::PasswordForm& form, autofill::PasswordGenerator* generator) OVERRIDE; private: diff --git a/chrome/browser/ui/browser_window.h b/chrome/browser/ui/browser_window.h index 800b046..071ce18 100644 --- a/chrome/browser/ui/browser_window.h +++ b/chrome/browser/ui/browser_window.h @@ -36,6 +36,7 @@ class PasswordGenerator; namespace content { class WebContents; struct NativeWebKeyboardEvent; +struct PasswordForm; struct SSLStatus; } @@ -48,12 +49,6 @@ class Rect; class Size; } -namespace webkit { -namespace forms { -struct PasswordForm; -} -} - enum DevToolsDockSide { DEVTOOLS_DOCK_SIDE_BOTTOM = 0, DEVTOOLS_DOCK_SIDE_RIGHT = 1 @@ -382,7 +377,7 @@ class BrowserWindow : public BaseWindow { // available on mac. virtual void ShowPasswordGenerationBubble( const gfx::Rect& rect, - const webkit::forms::PasswordForm& form, + const content::PasswordForm& form, autofill::PasswordGenerator* password_generator) {} protected: diff --git a/chrome/browser/ui/cocoa/login_prompt_cocoa.mm b/chrome/browser/ui/cocoa/login_prompt_cocoa.mm index 97db062..53f63b3 100644 --- a/chrome/browser/ui/cocoa/login_prompt_cocoa.mm +++ b/chrome/browser/ui/cocoa/login_prompt_cocoa.mm @@ -24,8 +24,8 @@ #include "ui/base/l10n/l10n_util.h" using content::BrowserThread; +using content::PasswordForm; using content::WebContents; -using webkit::forms::PasswordForm; // ---------------------------------------------------------------------------- // LoginHandlerMac diff --git a/chrome/browser/ui/gtk/autofill/autofill_external_delegate_gtk.cc b/chrome/browser/ui/gtk/autofill/autofill_external_delegate_gtk.cc index 4112e08..4323414 100644 --- a/chrome/browser/ui/gtk/autofill/autofill_external_delegate_gtk.cc +++ b/chrome/browser/ui/gtk/autofill/autofill_external_delegate_gtk.cc @@ -40,8 +40,8 @@ void AutofillExternalDelegateGtk::HideAutofillPopupInternal() { void AutofillExternalDelegateGtk::OnQueryPlatformSpecific( int query_id, - const webkit::forms::FormData& form, - const webkit::forms::FormField& field, + const FormData& form, + const FormFieldData& field, const gfx::Rect& bounds) { CreateViewIfNeeded(); view_->set_element_bounds(bounds); diff --git a/chrome/browser/ui/gtk/autofill/autofill_external_delegate_gtk.h b/chrome/browser/ui/gtk/autofill/autofill_external_delegate_gtk.h index eb477cb..0425fa9 100644 --- a/chrome/browser/ui/gtk/autofill/autofill_external_delegate_gtk.h +++ b/chrome/browser/ui/gtk/autofill/autofill_external_delegate_gtk.h @@ -26,8 +26,8 @@ class AutofillExternalDelegateGtk : public AutofillExternalDelegate { virtual void HideAutofillPopupInternal() OVERRIDE; virtual void OnQueryPlatformSpecific( int query_id, - const webkit::forms::FormData& form, - const webkit::forms::FormField& field, + const FormData& form, + const FormFieldData& field, const gfx::Rect& bounds) OVERRIDE; virtual void ApplyAutofillSuggestions( const std::vector<string16>& autofill_values, diff --git a/chrome/browser/ui/gtk/browser_window_gtk.cc b/chrome/browser/ui/gtk/browser_window_gtk.cc index 3c1cde2..bf47d93 100644 --- a/chrome/browser/ui/gtk/browser_window_gtk.cc +++ b/chrome/browser/ui/gtk/browser_window_gtk.cc @@ -1182,7 +1182,7 @@ void BrowserWindowGtk::ShowAvatarBubbleFromAvatarButton() { void BrowserWindowGtk::ShowPasswordGenerationBubble( const gfx::Rect& rect, - const webkit::forms::PasswordForm& form, + const content::PasswordForm& form, autofill::PasswordGenerator* password_generator) { WebContents* web_contents = chrome::GetActiveWebContents(browser_.get()); if (!web_contents || !web_contents->GetContentNativeView()) { diff --git a/chrome/browser/ui/gtk/browser_window_gtk.h b/chrome/browser/ui/gtk/browser_window_gtk.h index a3bbc67..189c4e3 100644 --- a/chrome/browser/ui/gtk/browser_window_gtk.h +++ b/chrome/browser/ui/gtk/browser_window_gtk.h @@ -174,7 +174,7 @@ class BrowserWindowGtk virtual void ShowAvatarBubbleFromAvatarButton() OVERRIDE; virtual void ShowPasswordGenerationBubble( const gfx::Rect& rect, - const webkit::forms::PasswordForm& form, + const content::PasswordForm& form, autofill::PasswordGenerator* password_generator) OVERRIDE; // Overridden from NotificationObserver: diff --git a/chrome/browser/ui/gtk/login_prompt_gtk.cc b/chrome/browser/ui/gtk/login_prompt_gtk.cc index 199fb41..8e114d4 100644 --- a/chrome/browser/ui/gtk/login_prompt_gtk.cc +++ b/chrome/browser/ui/gtk/login_prompt_gtk.cc @@ -25,8 +25,8 @@ #include "ui/base/l10n/l10n_util.h" using content::BrowserThread; +using content::PasswordForm; using content::WebContents; -using webkit::forms::PasswordForm; // ---------------------------------------------------------------------------- // LoginHandlerGtk diff --git a/chrome/browser/ui/gtk/password_generation_bubble_gtk.cc b/chrome/browser/ui/gtk/password_generation_bubble_gtk.cc index 774b81f..fcd85e3 100644 --- a/chrome/browser/ui/gtk/password_generation_bubble_gtk.cc +++ b/chrome/browser/ui/gtk/password_generation_bubble_gtk.cc @@ -39,7 +39,7 @@ GdkPixbuf* GetImage(int resource_id) { PasswordGenerationBubbleGtk::PasswordGenerationBubbleGtk( const gfx::Rect& anchor_rect, - const webkit::forms::PasswordForm& form, + const content::PasswordForm& form, TabContents* tab, autofill::PasswordGenerator* password_generator) : form_(form), diff --git a/chrome/browser/ui/gtk/password_generation_bubble_gtk.h b/chrome/browser/ui/gtk/password_generation_bubble_gtk.h index df1e35b..8011a49 100644 --- a/chrome/browser/ui/gtk/password_generation_bubble_gtk.h +++ b/chrome/browser/ui/gtk/password_generation_bubble_gtk.h @@ -10,9 +10,9 @@ #include "base/basictypes.h" #include "chrome/browser/ui/gtk/bubble/bubble_gtk.h" #include "chrome/common/password_generation_util.h" +#include "content/public/common/password_form.h" #include "ui/base/gtk/gtk_signal.h" #include "ui/gfx/rect.h" -#include "webkit/forms/password_form.h" namespace autofill { class PasswordGenerator; @@ -27,7 +27,7 @@ class TabContents; class PasswordGenerationBubbleGtk : public BubbleDelegateGtk { public: PasswordGenerationBubbleGtk(const gfx::Rect& anchor_rect, - const webkit::forms::PasswordForm& form, + const content::PasswordForm& form, TabContents* tab, autofill::PasswordGenerator* password_generator); virtual ~PasswordGenerationBubbleGtk(); @@ -49,7 +49,7 @@ class PasswordGenerationBubbleGtk : public BubbleDelegateGtk { // Form that contains the password field that we are generating a password // for. Used by the password_manager_. - webkit::forms::PasswordForm form_; + content::PasswordForm form_; // TabContents associated with the button that spawned this bubble. TabContents* tab_; diff --git a/chrome/browser/ui/login/login_prompt.cc b/chrome/browser/ui/login/login_prompt.cc index ca6bde1..de4e7ff 100644 --- a/chrome/browser/ui/login/login_prompt.cc +++ b/chrome/browser/ui/login/login_prompt.cc @@ -38,7 +38,7 @@ using content::RenderViewHostDelegate; using content::ResourceDispatcherHost; using content::ResourceRequestInfo; using content::WebContents; -using webkit::forms::PasswordForm; +using content::PasswordForm; class LoginHandlerImpl; @@ -115,7 +115,7 @@ void LoginHandler::OnRequestCancelled() { CancelAuth(); } -void LoginHandler::SetPasswordForm(const webkit::forms::PasswordForm& form) { +void LoginHandler::SetPasswordForm(const content::PasswordForm& form) { password_form_ = form; } diff --git a/chrome/browser/ui/login/login_prompt.h b/chrome/browser/ui/login/login_prompt.h index 416c13b..ad755a0 100644 --- a/chrome/browser/ui/login/login_prompt.h +++ b/chrome/browser/ui/login/login_prompt.h @@ -50,7 +50,7 @@ class LoginHandler : public content::ResourceDispatcherHostLoginDelegate, // Sets information about the authentication type (|form|) and the // |password_manager| for this profile. - void SetPasswordForm(const webkit::forms::PasswordForm& form); + void SetPasswordForm(const content::PasswordForm& form); void SetPasswordManager(PasswordManager* password_manager); // Returns the WebContents that needs authentication. @@ -141,7 +141,7 @@ class LoginHandler : public content::ResourceDispatcherHostLoginDelegate, // when later notifying the password manager if the credentials were accepted // or rejected. // This should only be accessed on the UI loop. - webkit::forms::PasswordForm password_form_; + content::PasswordForm password_form_; // Points to the password manager owned by the WebContents requesting auth. // This should only be accessed on the UI loop. diff --git a/chrome/browser/ui/sync/one_click_signin_helper.cc b/chrome/browser/ui/sync/one_click_signin_helper.cc index bf9472b..9563ab8 100644 --- a/chrome/browser/ui/sync/one_click_signin_helper.cc +++ b/chrome/browser/ui/sync/one_click_signin_helper.cc @@ -37,6 +37,7 @@ #include "content/public/browser/web_contents_view.h" #include "content/public/common/frame_navigate_params.h" #include "content/public/common/page_transition_types.h" +#include "content/public/common/password_form.h" #include "googleurl/src/gurl.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" @@ -45,8 +46,6 @@ #include "net/url_request/url_request.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" -#include "webkit/forms/password_form.h" -#include "webkit/forms/password_form_dom_manager.h" DEFINE_WEB_CONTENTS_USER_DATA_KEY(OneClickSigninHelper) diff --git a/chrome/browser/ui/views/autofill/autofill_external_delegate_views.cc b/chrome/browser/ui/views/autofill/autofill_external_delegate_views.cc index 424625c..0685399 100644 --- a/chrome/browser/ui/views/autofill/autofill_external_delegate_views.cc +++ b/chrome/browser/ui/views/autofill/autofill_external_delegate_views.cc @@ -39,8 +39,8 @@ void AutofillExternalDelegateViews::HideAutofillPopupInternal() { void AutofillExternalDelegateViews::OnQueryPlatformSpecific( int query_id, - const webkit::forms::FormData& form, - const webkit::forms::FormField& field, + const FormData& form, + const FormFieldData& field, const gfx::Rect& bounds) { CreateViewIfNeeded(); popup_view_->set_element_bounds(bounds); diff --git a/chrome/browser/ui/views/autofill/autofill_external_delegate_views.h b/chrome/browser/ui/views/autofill/autofill_external_delegate_views.h index a9a965b..9628571 100644 --- a/chrome/browser/ui/views/autofill/autofill_external_delegate_views.h +++ b/chrome/browser/ui/views/autofill/autofill_external_delegate_views.h @@ -35,8 +35,8 @@ class AutofillExternalDelegateViews : public AutofillExternalDelegate { // AutofillExternalDelegate implementation. virtual void OnQueryPlatformSpecific( int query_id, - const webkit::forms::FormData& form, - const webkit::forms::FormField& field, + const FormData& form, + const FormFieldData& field, const gfx::Rect& bounds) OVERRIDE; virtual void ApplyAutofillSuggestions( const std::vector<string16>& autofill_values, diff --git a/chrome/browser/ui/views/autofill/autofill_external_delegate_views_browsertest.cc b/chrome/browser/ui/views/autofill/autofill_external_delegate_views_browsertest.cc index 3c49fe6..be56a02 100644 --- a/chrome/browser/ui/views/autofill/autofill_external_delegate_views_browsertest.cc +++ b/chrome/browser/ui/views/autofill/autofill_external_delegate_views_browsertest.cc @@ -51,8 +51,8 @@ class AutofillExternalDelegateViewsBrowserTest : public InProcessBrowserTest { void GeneratePopup() { int query_id = 1; - webkit::forms::FormData form; - webkit::forms::FormField field; + FormData form; + FormFieldData field; field.is_focusable = true; field.should_autocomplete = true; gfx::Rect bounds(100, 100); diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc index c6f5b81..355dc07 100644 --- a/chrome/browser/ui/views/frame/browser_view.cc +++ b/chrome/browser/ui/views/frame/browser_view.cc @@ -2587,7 +2587,7 @@ void BrowserView::ShowAvatarBubbleFromAvatarButton() { void BrowserView::ShowPasswordGenerationBubble( const gfx::Rect& rect, - const webkit::forms::PasswordForm& form, + const content::PasswordForm& form, autofill::PasswordGenerator* password_generator) { // Create a rect in the content bounds that the bubble will point to. gfx::Point origin(rect.origin()); diff --git a/chrome/browser/ui/views/frame/browser_view.h b/chrome/browser/ui/views/frame/browser_view.h index 1074e8a..325f811 100644 --- a/chrome/browser/ui/views/frame/browser_view.h +++ b/chrome/browser/ui/views/frame/browser_view.h @@ -351,7 +351,7 @@ class BrowserView : public BrowserWindow, virtual void ShowAvatarBubbleFromAvatarButton() OVERRIDE; virtual void ShowPasswordGenerationBubble( const gfx::Rect& rect, - const webkit::forms::PasswordForm& form, + const content::PasswordForm& form, autofill::PasswordGenerator* password_generator) OVERRIDE; // Overridden from BrowserWindowTesting: diff --git a/chrome/browser/ui/views/login_prompt_views.cc b/chrome/browser/ui/views/login_prompt_views.cc index f5955a2..56ade68 100644 --- a/chrome/browser/ui/views/login_prompt_views.cc +++ b/chrome/browser/ui/views/login_prompt_views.cc @@ -20,8 +20,8 @@ #include "ui/views/window/dialog_delegate.h" using content::BrowserThread; +using content::PasswordForm; using content::WebContents; -using webkit::forms::PasswordForm; // ---------------------------------------------------------------------------- // LoginHandlerViews diff --git a/chrome/browser/ui/views/password_generation_bubble_view.cc b/chrome/browser/ui/views/password_generation_bubble_view.cc index c508f89..0d0fe46 100644 --- a/chrome/browser/ui/views/password_generation_bubble_view.cc +++ b/chrome/browser/ui/views/password_generation_bubble_view.cc @@ -118,7 +118,7 @@ gfx::Size TextfieldWrapper::GetImageSize() const { } // namespace PasswordGenerationBubbleView::PasswordGenerationBubbleView( - const webkit::forms::PasswordForm& form, + const content::PasswordForm& form, const gfx::Rect& anchor_rect, views::View* anchor_view, content::RenderViewHost* render_view_host, diff --git a/chrome/browser/ui/views/password_generation_bubble_view.h b/chrome/browser/ui/views/password_generation_bubble_view.h index d8c7853..2c7936b 100644 --- a/chrome/browser/ui/views/password_generation_bubble_view.h +++ b/chrome/browser/ui/views/password_generation_bubble_view.h @@ -6,11 +6,11 @@ #define CHROME_BROWSER_UI_VIEWS_PASSWORD_GENERATION_BUBBLE_VIEW_H_ #include "base/basictypes.h" +#include "content/public/common/password_form.h" #include "ui/gfx/rect.h" #include "ui/views/bubble/bubble_delegate.h" #include "ui/views/controls/button/button.h" #include "ui/views/view.h" -#include "webkit/forms/password_form.h" namespace autofill { class PasswordGenerator; @@ -37,7 +37,7 @@ class PasswordManager; class PasswordGenerationBubbleView : public views::BubbleDelegateView, public views::ButtonListener { public: - PasswordGenerationBubbleView(const webkit::forms::PasswordForm& form, + PasswordGenerationBubbleView(const content::PasswordForm& form, const gfx::Rect& anchor_rect, views::View* anchor_view, content::RenderViewHost* render_view_host, @@ -71,7 +71,7 @@ class PasswordGenerationBubbleView : public views::BubbleDelegateView, views::View* textfield_wrapper_; // The form associated with the password field(s) that we are generated. - webkit::forms::PasswordForm form_; + content::PasswordForm form_; // Location that the bubble points to gfx::Rect anchor_rect_; diff --git a/chrome/browser/ui/webui/options/password_manager_handler.cc b/chrome/browser/ui/webui/options/password_manager_handler.cc index bdbe4d4..73d6cb3 100644 --- a/chrome/browser/ui/webui/options/password_manager_handler.cc +++ b/chrome/browser/ui/webui/options/password_manager_handler.cc @@ -17,11 +17,11 @@ #include "content/public/browser/notification_details.h" #include "content/public/browser/notification_source.h" #include "content/public/browser/web_ui.h" +#include "content/public/common/password_form.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "net/base/net_util.h" #include "ui/base/l10n/l10n_util.h" -#include "webkit/forms/password_form.h" namespace options { @@ -241,7 +241,7 @@ void PasswordManagerHandler::PasswordListPopulater::Populate() { void PasswordManagerHandler::PasswordListPopulater:: OnPasswordStoreRequestDone( CancelableRequestProvider::Handle handle, - const std::vector<webkit::forms::PasswordForm*>& result) { + const std::vector<content::PasswordForm*>& result) { DCHECK_EQ(pending_login_query_, handle); pending_login_query_ = 0; page_->password_list_.clear(); @@ -270,7 +270,7 @@ void PasswordManagerHandler::PasswordExceptionListPopulater::Populate() { void PasswordManagerHandler::PasswordExceptionListPopulater:: OnPasswordStoreRequestDone( CancelableRequestProvider::Handle handle, - const std::vector<webkit::forms::PasswordForm*>& result) { + const std::vector<content::PasswordForm*>& result) { DCHECK_EQ(pending_login_query_, handle); pending_login_query_ = 0; page_->password_exception_list_.clear(); diff --git a/chrome/browser/ui/webui/options/password_manager_handler.h b/chrome/browser/ui/webui/options/password_manager_handler.h index 1990737..f7b7fc9 100644 --- a/chrome/browser/ui/webui/options/password_manager_handler.h +++ b/chrome/browser/ui/webui/options/password_manager_handler.h @@ -14,11 +14,9 @@ #include "chrome/browser/password_manager/password_store_consumer.h" #include "chrome/browser/ui/webui/options/options_ui.h" -namespace webkit { -namespace forms { +namespace content { struct PasswordForm; } -} namespace options { @@ -83,7 +81,7 @@ class PasswordManagerHandler : public OptionsPageUIHandler, // Send the password store's reply back to the handler. virtual void OnPasswordStoreRequestDone( CancelableRequestProvider::Handle handle, - const std::vector<webkit::forms::PasswordForm*>& result) = 0; + const std::vector<content::PasswordForm*>& result) = 0; protected: PasswordManagerHandler* page_; @@ -101,7 +99,7 @@ class PasswordManagerHandler : public OptionsPageUIHandler, // Send the password store's reply back to the handler. virtual void OnPasswordStoreRequestDone( CancelableRequestProvider::Handle handle, - const std::vector<webkit::forms::PasswordForm*>& result) OVERRIDE; + const std::vector<content::PasswordForm*>& result) OVERRIDE; }; // A short class to mediate requests to the password store for exceptions. @@ -115,15 +113,15 @@ class PasswordManagerHandler : public OptionsPageUIHandler, // Send the password store's reply back to the handler. virtual void OnPasswordStoreRequestDone( CancelableRequestProvider::Handle handle, - const std::vector<webkit::forms::PasswordForm*>& result) OVERRIDE; + const std::vector<content::PasswordForm*>& result) OVERRIDE; }; // Password store consumer for populating the password list and exceptions. PasswordListPopulater populater_; PasswordExceptionListPopulater exception_populater_; - ScopedVector<webkit::forms::PasswordForm> password_list_; - ScopedVector<webkit::forms::PasswordForm> password_exception_list_; + ScopedVector<content::PasswordForm> password_list_; + ScopedVector<content::PasswordForm> password_exception_list_; // User's pref std::string languages_; diff --git a/chrome/browser/webdata/autofill_table.cc b/chrome/browser/webdata/autofill_table.cc index f390caa..c237782 100644 --- a/chrome/browser/webdata/autofill_table.cc +++ b/chrome/browser/webdata/autofill_table.cc @@ -25,12 +25,11 @@ #include "chrome/browser/password_manager/encryptor.h" #include "chrome/browser/webdata/autofill_change.h" #include "chrome/browser/webdata/autofill_entry.h" +#include "chrome/common/form_field_data.h" #include "sql/statement.h" #include "ui/base/l10n/l10n_util.h" -#include "webkit/forms/form_field.h" using base::Time; -using webkit::forms::FormField; namespace { @@ -343,12 +342,13 @@ bool AutofillTable::IsSyncable() { return true; } -bool AutofillTable::AddFormFieldValues(const std::vector<FormField>& elements, - std::vector<AutofillChange>* changes) { +bool AutofillTable::AddFormFieldValues( + const std::vector<FormFieldData>& elements, + std::vector<AutofillChange>* changes) { return AddFormFieldValuesTime(elements, changes, Time::Now()); } -bool AutofillTable::AddFormFieldValue(const FormField& element, +bool AutofillTable::AddFormFieldValue(const FormFieldData& element, std::vector<AutofillChange>* changes) { return AddFormFieldValueTime(element, changes, Time::Now()); } @@ -566,7 +566,7 @@ bool AutofillTable::AddToCountOfFormElement(int64 pair_id, } bool AutofillTable::GetIDAndCountOfFormElement( - const FormField& element, + const FormFieldData& element, int64* pair_id, int* count) { DCHECK(pair_id); @@ -614,7 +614,7 @@ bool AutofillTable::SetCountOfFormElement(int64 pair_id, int count) { return s.Run(); } -bool AutofillTable::InsertFormElement(const FormField& element, +bool AutofillTable::InsertFormElement(const FormFieldData& element, int64* pair_id) { DCHECK(pair_id); sql::Statement s(db_->GetUniqueStatement( @@ -655,7 +655,7 @@ bool AutofillTable::DeleteLastAccess(int64 pair_id) { } bool AutofillTable::AddFormFieldValuesTime( - const std::vector<FormField>& elements, + const std::vector<FormFieldData>& elements, std::vector<AutofillChange>* changes, Time time) { // Only add one new entry for each unique element name. Use |seen_names| to @@ -663,7 +663,7 @@ bool AutofillTable::AddFormFieldValuesTime( const size_t kMaximumUniqueNames = 256; std::set<string16> seen_names; bool result = true; - for (std::vector<FormField>::const_iterator itr = elements.begin(); + for (std::vector<FormFieldData>::const_iterator itr = elements.begin(); itr != elements.end(); ++itr) { if (seen_names.size() >= kMaximumUniqueNames) break; @@ -818,7 +818,7 @@ bool AutofillTable::InsertAutofillEntry(const AutofillEntry& entry) { return true; } -bool AutofillTable::AddFormFieldValueTime(const FormField& element, +bool AutofillTable::AddFormFieldValueTime(const FormFieldData& element, std::vector<AutofillChange>* changes, Time time) { int count = 0; diff --git a/chrome/browser/webdata/autofill_table.h b/chrome/browser/webdata/autofill_table.h index 74e94ab..22196d1 100644 --- a/chrome/browser/webdata/autofill_table.h +++ b/chrome/browser/webdata/autofill_table.h @@ -18,16 +18,12 @@ class AutofillProfile; class AutofillTableTest; class CreditCard; +struct FormFieldData; + namespace base { class Time; } -namespace webkit { -namespace forms { -struct FormField; -} -} - // This class manages the various autofill tables within the SQLite database // passed to the constructor. It expects the following schemas: // @@ -126,13 +122,13 @@ class AutofillTable : public WebDatabaseTable { // Records the form elements in |elements| in the database in the // autofill table. A list of all added and updated autofill entries // is returned in the changes out parameter. - bool AddFormFieldValues(const std::vector<webkit::forms::FormField>& elements, + bool AddFormFieldValues(const std::vector<FormFieldData>& elements, std::vector<AutofillChange>* changes); // Records a single form element in the database in the autofill table. A list // of all added and updated autofill entries is returned in the changes out // parameter. - bool AddFormFieldValue(const webkit::forms::FormField& element, + bool AddFormFieldValue(const FormFieldData& element, std::vector<AutofillChange>* changes); // Retrieves a vector of all values which have been recorded in the autofill @@ -177,7 +173,7 @@ class AutofillTable : public WebDatabaseTable { // Gets the pair_id and count entries from name and value specified in // |element|. Sets *pair_id and *count to 0 if there is no such row in // the table. - bool GetIDAndCountOfFormElement(const webkit::forms::FormField& element, + bool GetIDAndCountOfFormElement(const FormFieldData& element, int64* pair_id, int* count); @@ -189,7 +185,7 @@ class AutofillTable : public WebDatabaseTable { // Adds a new row to the autofill table with name and value given in // |element|. Sets *pair_id to the pair_id of the new row. - bool InsertFormElement(const webkit::forms::FormField& element, + bool InsertFormElement(const FormFieldData& element, int64* pair_id); // Adds a new row to the autofill_dates table. @@ -325,10 +321,10 @@ class AutofillTable : public WebDatabaseTable { // Methods for adding autofill entries at a specified time. For // testing only. bool AddFormFieldValuesTime( - const std::vector<webkit::forms::FormField>& elements, + const std::vector<FormFieldData>& elements, std::vector<AutofillChange>* changes, base::Time time); - bool AddFormFieldValueTime(const webkit::forms::FormField& element, + bool AddFormFieldValueTime(const FormFieldData& element, std::vector<AutofillChange>* changes, base::Time time); diff --git a/chrome/browser/webdata/autofill_table_unittest.cc b/chrome/browser/webdata/autofill_table_unittest.cc index 23a520e..e34fec8 100644 --- a/chrome/browser/webdata/autofill_table_unittest.cc +++ b/chrome/browser/webdata/autofill_table_unittest.cc @@ -20,13 +20,12 @@ #include "chrome/browser/webdata/autofill_table.h" #include "chrome/browser/webdata/web_database.h" #include "chrome/common/chrome_paths.h" +#include "chrome/common/form_field_data.h" #include "sql/statement.h" #include "testing/gtest/include/gtest/gtest.h" -#include "webkit/forms/form_field.h" using base::Time; using base::TimeDelta; -using webkit::forms::FormField; // So we can compare AutofillKeys with EXPECT_EQ(). std::ostream& operator<<(std::ostream& os, const AutofillKey& key) { @@ -132,7 +131,7 @@ TEST_F(AutofillTableTest, Autofill) { // Simulate the submission of a handful of entries in a field called "Name", // some more often than others. AutofillChangeList changes; - FormField field; + FormFieldData field; field.name = ASCIIToUTF16("Name"); field.value = ASCIIToUTF16("Superman"); base::Time now = base::Time::Now(); @@ -290,7 +289,7 @@ TEST_F(AutofillTableTest, Autofill_RemoveBetweenChanges) { Time t2 = t1 + one_day; AutofillChangeList changes; - FormField field; + FormFieldData field; field.name = ASCIIToUTF16("Name"); field.value = ASCIIToUTF16("Superman"); EXPECT_TRUE( @@ -326,7 +325,7 @@ TEST_F(AutofillTableTest, Autofill_AddChanges) { Time t2 = t1 + one_day; AutofillChangeList changes; - FormField field; + FormFieldData field; field.name = ASCIIToUTF16("Name"); field.value = ASCIIToUTF16("Superman"); EXPECT_TRUE( @@ -356,7 +355,7 @@ TEST_F(AutofillTableTest, Autofill_UpdateOneWithOneTimestamp) { entries.push_back(entry); ASSERT_TRUE(db.GetAutofillTable()->UpdateAutofillEntries(entries)); - FormField field; + FormFieldData field; field.name = ASCIIToUTF16("foo"); field.value = ASCIIToUTF16("bar"); int64 pair_id; @@ -381,7 +380,7 @@ TEST_F(AutofillTableTest, Autofill_UpdateOneWithTwoTimestamps) { entries.push_back(entry); ASSERT_TRUE(db.GetAutofillTable()->UpdateAutofillEntries(entries)); - FormField field; + FormFieldData field; field.name = ASCIIToUTF16("foo"); field.value = ASCIIToUTF16("bar"); int64 pair_id; @@ -426,7 +425,7 @@ TEST_F(AutofillTableTest, Autofill_UpdateTwo) { entries.push_back(entry1); ASSERT_TRUE(db.GetAutofillTable()->UpdateAutofillEntries(entries)); - FormField field0; + FormFieldData field0; field0.name = ASCIIToUTF16("foo"); field0.value = ASCIIToUTF16("bar0"); int64 pair_id; @@ -436,7 +435,7 @@ TEST_F(AutofillTableTest, Autofill_UpdateTwo) { EXPECT_LE(0, pair_id); EXPECT_EQ(1, count); - FormField field1; + FormFieldData field1; field1.name = ASCIIToUTF16("foo"); field1.value = ASCIIToUTF16("bar1"); ASSERT_TRUE(db.GetAutofillTable()->GetIDAndCountOfFormElement( @@ -451,7 +450,7 @@ TEST_F(AutofillTableTest, Autofill_UpdateReplace) { AutofillChangeList changes; // Add a form field. This will be replaced. - FormField field; + FormFieldData field; field.name = ASCIIToUTF16("Name"); field.value = ASCIIToUTF16("Superman"); EXPECT_TRUE(db.GetAutofillTable()->AddFormFieldValue(field, &changes)); @@ -477,7 +476,7 @@ TEST_F(AutofillTableTest, Autofill_UpdateDontReplace) { AutofillChangeList changes; // Add a form field. This will NOT be replaced. - FormField field; + FormFieldData field; field.name = existing.key().name(); field.value = existing.key().value(); EXPECT_TRUE(db.GetAutofillTable()->AddFormFieldValueTime(field, &changes, t)); @@ -505,8 +504,8 @@ TEST_F(AutofillTableTest, Autofill_AddFormFieldValues) { // Add multiple values for "firstname" and "lastname" names. Test that only // first value of each gets added. Related to security issue: // http://crbug.com/51727. - std::vector<FormField> elements; - FormField field; + std::vector<FormFieldData> elements; + FormFieldData field; field.name = ASCIIToUTF16("firstname"); field.value = ASCIIToUTF16("Joe"); elements.push_back(field); @@ -1305,7 +1304,7 @@ TEST_F(AutofillTableTest, Autofill_GetAllAutofillEntries_OneResult) { time_t start = 0; std::vector<Time> timestamps1; - FormField field; + FormFieldData field; field.name = ASCIIToUTF16("Name"); field.value = ASCIIToUTF16("Superman"); EXPECT_TRUE( @@ -1347,7 +1346,7 @@ TEST_F(AutofillTableTest, Autofill_GetAllAutofillEntries_TwoDistinct) { time_t start = 0; std::vector<Time> timestamps1; - FormField field; + FormFieldData field; field.name = ASCIIToUTF16("Name"); field.value = ASCIIToUTF16("Superman"); EXPECT_TRUE( @@ -1405,7 +1404,7 @@ TEST_F(AutofillTableTest, Autofill_GetAllAutofillEntries_TwoSame) { time_t start = 0; std::vector<Time> timestamps; for (int i = 0; i < 2; i++) { - FormField field; + FormFieldData field; field.name = ASCIIToUTF16("Name"); field.value = ASCIIToUTF16("Superman"); EXPECT_TRUE( diff --git a/chrome/browser/webdata/autofill_web_data_service_impl.cc b/chrome/browser/webdata/autofill_web_data_service_impl.cc index 856ec96..09b083c 100644 --- a/chrome/browser/webdata/autofill_web_data_service_impl.cc +++ b/chrome/browser/webdata/autofill_web_data_service_impl.cc @@ -17,7 +17,7 @@ AutofillWebDataServiceImpl::~AutofillWebDataServiceImpl() { } void AutofillWebDataServiceImpl::AddFormFields( - const std::vector<webkit::forms::FormField>& fields) { + const std::vector<FormFieldData>& fields) { service_->AddFormFields(fields); } diff --git a/chrome/browser/webdata/autofill_web_data_service_impl.h b/chrome/browser/webdata/autofill_web_data_service_impl.h index c85c18e..768ee44 100644 --- a/chrome/browser/webdata/autofill_web_data_service_impl.h +++ b/chrome/browser/webdata/autofill_web_data_service_impl.h @@ -19,7 +19,7 @@ class AutofillWebDataServiceImpl : public AutofillWebDataService { // AutofillWebData implementation. virtual void AddFormFields( - const std::vector<webkit::forms::FormField>& fields) OVERRIDE; + const std::vector<FormFieldData>& fields) OVERRIDE; virtual WebDataServiceBase::Handle GetFormValuesForElementName( const string16& name, const string16& prefix, diff --git a/chrome/browser/webdata/web_data_service.cc b/chrome/browser/webdata/web_data_service.cc index ee8733f..50e974b 100644 --- a/chrome/browser/webdata/web_data_service.cc +++ b/chrome/browser/webdata/web_data_service.cc @@ -28,6 +28,7 @@ #include "chrome/browser/webdata/web_intents_table.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_notification_types.h" +#include "chrome/common/form_field_data.h" #ifdef DEBUG #include "content/public/browser/browser_thread.h" #endif @@ -37,7 +38,6 @@ #include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "third_party/skia/include/core/SkBitmap.h" -#include "webkit/forms/form_field.h" //////////////////////////////////////////////////////////////////////////////// // @@ -48,7 +48,6 @@ using base::Bind; using base::Time; using content::BrowserThread; -using webkit::forms::FormField; using webkit_glue::WebIntentServiceData; namespace { @@ -418,9 +417,9 @@ WebDataService::Handle WebDataService::GetAllTokens( //////////////////////////////////////////////////////////////////////////////// void WebDataService::AddFormFields( - const std::vector<FormField>& fields) { - GenericRequest<std::vector<FormField> >* request = - new GenericRequest<std::vector<FormField> >( + const std::vector<FormFieldData>& fields) { + GenericRequest<std::vector<FormFieldData> >* request = + new GenericRequest<std::vector<FormFieldData> >( this, GetNextRequestHandle(), NULL, fields); RegisterRequest(request); ScheduleTask(FROM_HERE, @@ -1067,7 +1066,7 @@ void WebDataService::GetAllTokensImpl( //////////////////////////////////////////////////////////////////////////////// void WebDataService::AddFormElementsImpl( - GenericRequest<std::vector<FormField> >* request) { + GenericRequest<std::vector<FormFieldData> >* request) { InitializeDatabaseIfNecessary(); if (db_ && !request->IsCancelled(NULL)) { AutofillChangeList changes; diff --git a/chrome/browser/webdata/web_data_service.h b/chrome/browser/webdata/web_data_service.h index e1e6087..39e0ad4 100644 --- a/chrome/browser/webdata/web_data_service.h +++ b/chrome/browser/webdata/web_data_service.h @@ -375,7 +375,7 @@ class WebDataService // AutofillWebData implementation. virtual void AddFormFields( - const std::vector<webkit::forms::FormField>& fields) OVERRIDE; + const std::vector<FormFieldData>& fields) OVERRIDE; virtual Handle GetFormValuesForElementName( const string16& name, const string16& prefix, @@ -550,7 +550,7 @@ class WebDataService // ////////////////////////////////////////////////////////////////////////////// void AddFormElementsImpl( - GenericRequest<std::vector<webkit::forms::FormField> >* request); + GenericRequest<std::vector<FormFieldData> >* request); void GetFormValuesForElementNameImpl(WebDataRequest* request, const string16& name, const string16& prefix, int limit); void RemoveFormElementsAddedBetweenImpl( diff --git a/chrome/browser/webdata/web_data_service_unittest.cc b/chrome/browser/webdata/web_data_service_unittest.cc index 0bc49f7..48a50b9 100644 --- a/chrome/browser/webdata/web_data_service_unittest.cc +++ b/chrome/browser/webdata/web_data_service_unittest.cc @@ -27,13 +27,13 @@ #include "chrome/browser/webdata/web_intents_table.h" #include "chrome/common/chrome_notification_types.h" #include "chrome/common/chrome_paths.h" +#include "chrome/common/form_field_data.h" #include "chrome/test/base/thread_observer_helper.h" #include "content/public/browser/notification_details.h" #include "content/public/browser/notification_service.h" #include "content/public/test/test_browser_thread.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -#include "webkit/forms/form_field.h" using base::Time; using base::TimeDelta; @@ -135,8 +135,8 @@ class WebDataServiceAutofillTest : public WebDataServiceTest { void AppendFormField(const string16& name, const string16& value, - std::vector<webkit::forms::FormField>* form_fields) { - webkit::forms::FormField field; + std::vector<FormFieldData>* form_fields) { + FormFieldData field; field.name = name; field.value = value; form_fields->push_back(field); @@ -245,7 +245,7 @@ TEST_F(WebDataServiceAutofillTest, FormFillAdd) { Pointee(ElementsAreArray(expected_changes))))). WillOnce(SignalEvent(&done_event_)); - std::vector<webkit::forms::FormField> form_fields; + std::vector<FormFieldData> form_fields; AppendFormField(name1_, value1_, &form_fields); AppendFormField(name2_, value2_, &form_fields); wds_->AddFormFields(form_fields); @@ -271,7 +271,7 @@ TEST_F(WebDataServiceAutofillTest, FormFillRemoveOne) { // First add some values to autofill. EXPECT_CALL(*observer_helper_->observer(), Observe(_, _, _)). WillOnce(SignalEvent(&done_event_)); - std::vector<webkit::forms::FormField> form_fields; + std::vector<FormFieldData> form_fields; AppendFormField(name1_, value1_, &form_fields); wds_->AddFormFields(form_fields); @@ -302,7 +302,7 @@ TEST_F(WebDataServiceAutofillTest, FormFillRemoveMany) { EXPECT_CALL(*observer_helper_->observer(), Observe(_, _, _)). WillOnce(SignalEvent(&done_event_)); - std::vector<webkit::forms::FormField> form_fields; + std::vector<FormFieldData> form_fields; AppendFormField(name1_, value1_, &form_fields); AppendFormField(name2_, value2_, &form_fields); wds_->AddFormFields(form_fields); |