summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autofill
diff options
context:
space:
mode:
authorisherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-15 02:25:08 +0000
committerisherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-15 02:25:08 +0000
commit9c4bf23a4cde497b8bad3f89b60457841470618c (patch)
tree9674d3732608fb126f685bd9b780fe5a8bd7fe14 /chrome/browser/autofill
parent57dcbc4dd5cbb0f88b348b775ad0a2b130bcafdd (diff)
downloadchromium_src-9c4bf23a4cde497b8bad3f89b60457841470618c.zip
chromium_src-9c4bf23a4cde497b8bad3f89b60457841470618c.tar.gz
chromium_src-9c4bf23a4cde497b8bad3f89b60457841470618c.tar.bz2
Group forms-related files in webkit/glue in a forms/ subdirectory.
BUG=none TEST=compiles Review URL: http://codereview.chromium.org/8680040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114581 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autofill')
-rw-r--r--chrome/browser/autofill/address_field_unittest.cc26
-rw-r--r--chrome/browser/autofill/autofill_common_test.cc4
-rw-r--r--chrome/browser/autofill/autofill_common_test.h8
-rw-r--r--chrome/browser/autofill/autofill_download_unittest.cc6
-rw-r--r--chrome/browser/autofill/autofill_external_delegate.cc4
-rw-r--r--chrome/browser/autofill/autofill_external_delegate.h21
-rw-r--r--chrome/browser/autofill/autofill_field.cc4
-rw-r--r--chrome/browser/autofill/autofill_field.h6
-rw-r--r--chrome/browser/autofill/autofill_manager.cc22
-rw-r--r--chrome/browser/autofill/autofill_manager.h40
-rw-r--r--chrome/browser/autofill/autofill_manager_unittest.cc32
-rw-r--r--chrome/browser/autofill/autofill_merge_unittest.cc6
-rw-r--r--chrome/browser/autofill/autofill_metrics.cc4
-rw-r--r--chrome/browser/autofill/autofill_metrics_unittest.cc8
-rw-r--r--chrome/browser/autofill/credit_card_field_unittest.cc20
-rw-r--r--chrome/browser/autofill/form_structure.cc20
-rw-r--r--chrome/browser/autofill/form_structure.h12
-rw-r--r--chrome/browser/autofill/form_structure_unittest.cc14
-rw-r--r--chrome/browser/autofill/name_field_unittest.cc22
-rw-r--r--chrome/browser/autofill/personal_data_manager_unittest.cc42
-rw-r--r--chrome/browser/autofill/phone_field_unittest.cc14
-rw-r--r--chrome/browser/autofill/select_control_handler.cc12
-rw-r--r--chrome/browser/autofill/select_control_handler.h8
-rw-r--r--chrome/browser/autofill/select_control_handler_unittest.cc22
24 files changed, 195 insertions, 182 deletions
diff --git a/chrome/browser/autofill/address_field_unittest.cc b/chrome/browser/autofill/address_field_unittest.cc
index b8d3865..0bc6567 100644
--- a/chrome/browser/autofill/address_field_unittest.cc
+++ b/chrome/browser/autofill/address_field_unittest.cc
@@ -10,7 +10,7 @@
#include "chrome/browser/autofill/autofill_field.h"
#include "chrome/browser/autofill/autofill_scanner.h"
#include "testing/gtest/include/gtest/gtest.h"
-#include "webkit/glue/form_field.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_glue::FormField field;
+ webkit::forms::FormField field;
field.form_control_type = ASCIIToUTF16("text");
field.label = ASCIIToUTF16("Address");
@@ -62,7 +62,7 @@ TEST_F(AddressFieldTest, ParseOneLineAddress) {
}
TEST_F(AddressFieldTest, ParseOneLineAddressBilling) {
- webkit_glue::FormField field;
+ webkit::forms::FormField field;
field.form_control_type = ASCIIToUTF16("text");
field.label = ASCIIToUTF16("Address");
@@ -80,7 +80,7 @@ TEST_F(AddressFieldTest, ParseOneLineAddressBilling) {
}
TEST_F(AddressFieldTest, ParseOneLineAddressShipping) {
- webkit_glue::FormField field;
+ webkit::forms::FormField field;
field.form_control_type = ASCIIToUTF16("text");
field.label = ASCIIToUTF16("Address");
@@ -98,7 +98,7 @@ TEST_F(AddressFieldTest, ParseOneLineAddressShipping) {
}
TEST_F(AddressFieldTest, ParseTwoLineAddress) {
- webkit_glue::FormField field;
+ webkit::forms::FormField field;
field.form_control_type = ASCIIToUTF16("text");
field.label = ASCIIToUTF16("Address");
@@ -123,7 +123,7 @@ TEST_F(AddressFieldTest, ParseTwoLineAddress) {
}
TEST_F(AddressFieldTest, ParseThreeLineAddress) {
- webkit_glue::FormField field;
+ webkit::forms::FormField 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_glue::FormField field;
+ webkit::forms::FormField field;
field.form_control_type = ASCIIToUTF16("text");
field.label = ASCIIToUTF16("City");
@@ -172,7 +172,7 @@ TEST_F(AddressFieldTest, ParseCity) {
}
TEST_F(AddressFieldTest, ParseState) {
- webkit_glue::FormField field;
+ webkit::forms::FormField field;
field.form_control_type = ASCIIToUTF16("text");
field.label = ASCIIToUTF16("State");
@@ -190,7 +190,7 @@ TEST_F(AddressFieldTest, ParseState) {
}
TEST_F(AddressFieldTest, ParseZip) {
- webkit_glue::FormField field;
+ webkit::forms::FormField field;
field.form_control_type = ASCIIToUTF16("text");
field.label = ASCIIToUTF16("Zip");
@@ -208,7 +208,7 @@ TEST_F(AddressFieldTest, ParseZip) {
}
TEST_F(AddressFieldTest, ParseStateAndZipOneLabel) {
- webkit_glue::FormField field;
+ webkit::forms::FormField 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_glue::FormField field;
+ webkit::forms::FormField field;
field.form_control_type = ASCIIToUTF16("text");
field.label = ASCIIToUTF16("Country");
@@ -251,7 +251,7 @@ TEST_F(AddressFieldTest, ParseCountry) {
}
TEST_F(AddressFieldTest, ParseTwoLineAddressMissingLabel) {
- webkit_glue::FormField field;
+ webkit::forms::FormField field;
field.form_control_type = ASCIIToUTF16("text");
field.label = ASCIIToUTF16("Address");
@@ -276,7 +276,7 @@ TEST_F(AddressFieldTest, ParseTwoLineAddressMissingLabel) {
}
TEST_F(AddressFieldTest, ParseCompany) {
- webkit_glue::FormField field;
+ webkit::forms::FormField field;
field.form_control_type = ASCIIToUTF16("text");
field.label = ASCIIToUTF16("Company");
diff --git a/chrome/browser/autofill/autofill_common_test.cc b/chrome/browser/autofill/autofill_common_test.cc
index b4c3ad7..99ff3ac 100644
--- a/chrome/browser/autofill/autofill_common_test.cc
+++ b/chrome/browser/autofill/autofill_common_test.cc
@@ -11,7 +11,7 @@
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/pref_names.h"
-#include "webkit/glue/form_field.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_glue::FormField* field) {
+ webkit::forms::FormField* 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 4b224b8..84a14fe 100644
--- a/chrome/browser/autofill/autofill_common_test.h
+++ b/chrome/browser/autofill/autofill_common_test.h
@@ -10,9 +10,11 @@ class AutofillProfile;
class CreditCard;
class Profile;
-namespace webkit_glue {
+namespace webkit {
+namespace forms {
struct FormField;
-} // namespace webkit_glue
+}
+}
// Common utilities shared amongst Autofill tests.
namespace autofill_test {
@@ -22,7 +24,7 @@ void CreateTestFormField(const char* label,
const char* name,
const char* value,
const char* type,
- webkit_glue::FormField* field);
+ webkit::forms::FormField* 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 2dd1eea..dab40ce 100644
--- a/chrome/browser/autofill/autofill_download_unittest.cc
+++ b/chrome/browser/autofill/autofill_download_unittest.cc
@@ -22,11 +22,11 @@
#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/glue/form_data.h"
+#include "webkit/forms/form_data.h"
using content::BrowserThread;
-using webkit_glue::FormData;
-using webkit_glue::FormField;
+using webkit::forms::FormData;
+using webkit::forms::FormField;
using WebKit::WebInputElement;
namespace {
diff --git a/chrome/browser/autofill/autofill_external_delegate.cc b/chrome/browser/autofill/autofill_external_delegate.cc
index 16d3ff5..a9d6a13 100644
--- a/chrome/browser/autofill/autofill_external_delegate.cc
+++ b/chrome/browser/autofill/autofill_external_delegate.cc
@@ -33,8 +33,8 @@ void AutofillExternalDelegate::SelectAutofillSuggestionAtIndex(int listIndex) {
}
void AutofillExternalDelegate::OnQuery(int query_id,
- const webkit_glue::FormData& form,
- const webkit_glue::FormField& field,
+ const webkit::forms::FormData& form,
+ const webkit::forms::FormField& field,
const gfx::Rect& bounds,
bool display_warning_if_disabled) {
autofill_query_field_ = field;
diff --git a/chrome/browser/autofill/autofill_external_delegate.h b/chrome/browser/autofill/autofill_external_delegate.h
index c9bc4dc..4890565 100644
--- a/chrome/browser/autofill/autofill_external_delegate.h
+++ b/chrome/browser/autofill/autofill_external_delegate.h
@@ -9,7 +9,7 @@
#include <vector>
#include "base/string16.h"
-#include "webkit/glue/form_field.h"
+#include "webkit/forms/form_field.h"
class AutofillManager;
class TabContentsWrapper;
@@ -18,9 +18,11 @@ namespace gfx {
class Rect;
}
-namespace webkit_glue {
+namespace webkit {
+namespace forms {
struct FormData;
-} // namespace webkit_glue
+}
+}
// TODO(csharp): A lot of the logic in this class is copied from autofillagent.
// Once Autofill is moved out of WebKit this class should be the only home for
@@ -45,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_glue::FormData& form,
- const webkit_glue::FormField& field,
+ const webkit::forms::FormData& form,
+ const webkit::forms::FormField& field,
const gfx::Rect& bounds,
bool display_warning_if_disabled);
@@ -87,9 +89,10 @@ class AutofillExternalDelegate {
int separator_index) = 0;
// Handle instance specific OnQueryCode.
- virtual void OnQueryPlatformSpecific(int query_id,
- const webkit_glue::FormData& form,
- const webkit_glue::FormField& field) = 0;
+ virtual void OnQueryPlatformSpecific(
+ int query_id,
+ const webkit::forms::FormData& form,
+ const webkit::forms::FormField& field) = 0;
private:
TabContentsWrapper* tab_contents_wrapper_; // weak; owns me.
@@ -99,7 +102,7 @@ class AutofillExternalDelegate {
int autofill_query_id_;
// The current field selected by Autofill.
- webkit_glue::FormField autofill_query_field_;
+ webkit::forms::FormField autofill_query_field_;
// Should we display a warning if Autofill is disabled?
bool display_warning_if_disabled_;
diff --git a/chrome/browser/autofill/autofill_field.cc b/chrome/browser/autofill/autofill_field.cc
index cabffef..174d88a 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_glue::FormField& field,
+AutofillField::AutofillField(const webkit::forms::FormField& field,
const string16& unique_name)
- : webkit_glue::FormField(field),
+ : webkit::forms::FormField(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 92826f6..035862c 100644
--- a/chrome/browser/autofill/autofill_field.h
+++ b/chrome/browser/autofill/autofill_field.h
@@ -11,9 +11,9 @@
#include "base/basictypes.h"
#include "base/string16.h"
#include "chrome/browser/autofill/field_types.h"
-#include "webkit/glue/form_field.h"
+#include "webkit/forms/form_field.h"
-class AutofillField : public webkit_glue::FormField {
+class AutofillField : public webkit::forms::FormField {
public:
enum PhonePart {
IGNORED = 0,
@@ -22,7 +22,7 @@ class AutofillField : public webkit_glue::FormField {
};
AutofillField();
- AutofillField(const webkit_glue::FormField& field,
+ AutofillField(const webkit::forms::FormField& field,
const string16& unique_name);
virtual ~AutofillField();
diff --git a/chrome/browser/autofill/autofill_manager.cc b/chrome/browser/autofill/autofill_manager.cc
index 29a3961..cf61b57 100644
--- a/chrome/browser/autofill/autofill_manager.cc
+++ b/chrome/browser/autofill/autofill_manager.cc
@@ -19,8 +19,8 @@
#include "base/utf_string_conversions.h"
#include "chrome/browser/autocomplete_history_manager.h"
#include "chrome/browser/autofill/autofill_cc_infobar_delegate.h"
-#include "chrome/browser/autofill/autofill_feedback_infobar_delegate.h"
#include "chrome/browser/autofill/autofill_external_delegate.h"
+#include "chrome/browser/autofill/autofill_feedback_infobar_delegate.h"
#include "chrome/browser/autofill/autofill_field.h"
#include "chrome/browser/autofill/autofill_metrics.h"
#include "chrome/browser/autofill/autofill_profile.h"
@@ -54,16 +54,16 @@
#include "ipc/ipc_message_macros.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/rect.h"
-#include "webkit/glue/form_data.h"
-#include "webkit/glue/form_data_predictions.h"
-#include "webkit/glue/form_field.h"
+#include "webkit/forms/form_data.h"
+#include "webkit/forms/form_data_predictions.h"
+#include "webkit/forms/form_field.h"
using base::TimeTicks;
using content::BrowserThread;
using switches::kEnableAutofillFeedback;
-using webkit_glue::FormData;
-using webkit_glue::FormDataPredictions;
-using webkit_glue::FormField;
+using webkit::forms::FormData;
+using webkit::forms::FormDataPredictions;
+using webkit::forms::FormField;
namespace {
@@ -115,7 +115,7 @@ void RemoveDuplicateSuggestions(std::vector<string16>* values,
// logical form. Returns true if any field in the given |section| within |form|
// is auto-filled.
bool SectionIsAutofilled(const FormStructure& form_structure,
- const webkit_glue::FormData& form,
+ const FormData& form,
const string16& section) {
DCHECK_EQ(form_structure.field_count(), form.fields.size());
for (size_t i = 0; i < form_structure.field_count(); ++i) {
@@ -1130,7 +1130,7 @@ void AutofillManager::GetCreditCardSuggestions(
void AutofillManager::FillCreditCardFormField(const CreditCard& credit_card,
AutofillFieldType type,
- webkit_glue::FormField* field) {
+ FormField* field) {
DCHECK_EQ(AutofillType::CREDIT_CARD, AutofillType(type).group());
DCHECK(field);
@@ -1154,7 +1154,7 @@ void AutofillManager::FillCreditCardFormField(const CreditCard& credit_card,
void AutofillManager::FillFormField(const AutofillProfile& profile,
const AutofillField& cached_field,
size_t variant,
- webkit_glue::FormField* field) {
+ FormField* field) {
AutofillFieldType type = cached_field.type();
DCHECK_NE(AutofillType::CREDIT_CARD, AutofillType(type).group());
DCHECK(field);
@@ -1181,7 +1181,7 @@ void AutofillManager::FillFormField(const AutofillProfile& profile,
void AutofillManager::FillPhoneNumberField(const AutofillProfile& profile,
const AutofillField& cached_field,
size_t variant,
- webkit_glue::FormField* field) {
+ FormField* 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 1777e1c..7460232 100644
--- a/chrome/browser/autofill/autofill_manager.h
+++ b/chrome/browser/autofill/autofill_manager.h
@@ -44,10 +44,12 @@ namespace IPC {
class Message;
}
-namespace webkit_glue {
+namespace webkit {
+namespace forms {
struct FormData;
struct FormField;
}
+}
// Manages saving and restoring the user's personal information entered into web
// forms.
@@ -70,8 +72,8 @@ class AutofillManager : public TabContentsObserver,
// Called from our external delegate so they cannot be private.
void OnFillAutofillFormData(int query_id,
- const webkit_glue::FormData& form,
- const webkit_glue::FormField& field,
+ const webkit::forms::FormData& form,
+ const webkit::forms::FormField& field,
int unique_id);
void OnDidShowAutofillSuggestions(bool is_new_popup);
void OnDidFillAutofillFormData(const base::TimeTicks& timestamp);
@@ -130,7 +132,7 @@ class AutofillManager : public TabContentsObserver,
// 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_glue::FormData& form,
+ bool OnFormSubmitted(const webkit::forms::FormData& form,
const base::TimeTicks& timestamp);
private:
@@ -144,16 +146,16 @@ class AutofillManager : public TabContentsObserver,
virtual void OnLoadedServerPredictions(
const std::string& response_xml) OVERRIDE;
- void OnFormsSeen(const std::vector<webkit_glue::FormData>& forms,
+ void OnFormsSeen(const std::vector<webkit::forms::FormData>& forms,
const base::TimeTicks& timestamp);
- void OnTextFieldDidChange(const webkit_glue::FormData& form,
- const webkit_glue::FormField& field,
+ void OnTextFieldDidChange(const webkit::forms::FormData& form,
+ const webkit::forms::FormField& field,
const base::TimeTicks& timestamp);
// The |bounding_box| is a window relative value.
void OnQueryFormFieldAutofill(int query_id,
- const webkit_glue::FormData& form,
- const webkit_glue::FormField& field,
+ const webkit::forms::FormData& form,
+ const webkit::forms::FormField& field,
const gfx::Rect& bounding_box,
bool display_warning);
void OnShowAutofillDialog();
@@ -178,15 +180,15 @@ class AutofillManager : public TabContentsObserver,
// Fills |form_structure| cached element corresponding to |form|.
// Returns false if the cached element was not found.
- bool FindCachedForm(const webkit_glue::FormData& form,
+ bool FindCachedForm(const webkit::forms::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_glue::FormData& form,
- const webkit_glue::FormField& field,
+ bool GetCachedFormAndField(const webkit::forms::FormData& form,
+ const webkit::forms::FormField& field,
FormStructure** form_structure,
AutofillField** autofill_field) WARN_UNUSED_RESULT;
@@ -194,7 +196,7 @@ class AutofillManager : public TabContentsObserver,
// |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_glue::FormData& live_form,
+ bool UpdateCachedForm(const webkit::forms::FormData& live_form,
const FormStructure* cached_form,
FormStructure** updated_form) WARN_UNUSED_RESULT;
@@ -202,7 +204,7 @@ class AutofillManager : public TabContentsObserver,
// value of |field| and returns the labels of the matching profiles. |labels|
// is filled with the Profile label.
void GetProfileSuggestions(FormStructure* form,
- const webkit_glue::FormField& field,
+ const webkit::forms::FormField& field,
AutofillFieldType type,
std::vector<string16>* values,
std::vector<string16>* labels,
@@ -212,7 +214,7 @@ class AutofillManager : public TabContentsObserver,
// 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_glue::FormField& field,
+ const webkit::forms::FormField& field,
AutofillFieldType type,
std::vector<string16>* values,
std::vector<string16>* labels,
@@ -222,7 +224,7 @@ class AutofillManager : public TabContentsObserver,
// Set |field|'s value based on |type| and contents of the |credit_card|.
void FillCreditCardFormField(const CreditCard& credit_card,
AutofillFieldType type,
- webkit_glue::FormField* field);
+ webkit::forms::FormField* 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
@@ -230,7 +232,7 @@ class AutofillManager : public TabContentsObserver,
void FillFormField(const AutofillProfile& profile,
const AutofillField& cached_field,
size_t variant,
- webkit_glue::FormField* field);
+ webkit::forms::FormField* 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
@@ -239,10 +241,10 @@ class AutofillManager : public TabContentsObserver,
void FillPhoneNumberField(const AutofillProfile& profile,
const AutofillField& cached_field,
size_t variant,
- webkit_glue::FormField* field);
+ webkit::forms::FormField* field);
// Parses the forms using heuristic matching and querying the Autofill server.
- void ParseForms(const std::vector<webkit_glue::FormData>& forms);
+ void ParseForms(const std::vector<webkit::forms::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_unittest.cc b/chrome/browser/autofill/autofill_manager_unittest.cc
index a3ad503..22abbf0 100644
--- a/chrome/browser/autofill/autofill_manager_unittest.cc
+++ b/chrome/browser/autofill/autofill_manager_unittest.cc
@@ -39,13 +39,13 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/rect.h"
-#include "webkit/glue/form_data.h"
-#include "webkit/glue/form_field.h"
+#include "webkit/forms/form_data.h"
+#include "webkit/forms/form_field.h"
using content::BrowserThread;
using testing::_;
-using webkit_glue::FormData;
-using webkit_glue::FormField;
+using webkit::forms::FormData;
+using webkit::forms::FormField;
namespace {
@@ -269,7 +269,7 @@ void ExpectFilledField(const char* expected_label,
const char* expected_name,
const char* expected_value,
const char* expected_form_control_type,
- const webkit_glue::FormField& field) {
+ const webkit::forms::FormField& field) {
SCOPED_TRACE(expected_label);
EXPECT_EQ(UTF8ToUTF16(expected_label), field.label);
EXPECT_EQ(UTF8ToUTF16(expected_name), field.name);
@@ -566,8 +566,8 @@ class AutofillManagerTest : public TabContentsWrapperTestHarness {
}
void GetAutofillSuggestions(int query_id,
- const webkit_glue::FormData& form,
- const webkit_glue::FormField& field) {
+ const webkit::forms::FormData& form,
+ const webkit::forms::FormField& field) {
autofill_manager_->OnQueryFormFieldAutofill(query_id,
form,
field,
@@ -575,8 +575,8 @@ class AutofillManagerTest : public TabContentsWrapperTestHarness {
false);
}
- void GetAutofillSuggestions(const webkit_glue::FormData& form,
- const webkit_glue::FormField& field) {
+ void GetAutofillSuggestions(const webkit::forms::FormData& form,
+ const webkit::forms::FormField& field) {
GetAutofillSuggestions(kDefaultPageID, form, field);
}
@@ -585,7 +585,7 @@ class AutofillManagerTest : public TabContentsWrapperTestHarness {
SendSuggestions(&result);
}
- void FormsSeen(const std::vector<webkit_glue::FormData>& forms) {
+ void FormsSeen(const std::vector<webkit::forms::FormData>& forms) {
autofill_manager_->OnFormsSeen(forms, base::TimeTicks());
}
@@ -595,8 +595,8 @@ class AutofillManagerTest : public TabContentsWrapperTestHarness {
}
void FillAutofillFormData(int query_id,
- const webkit_glue::FormData& form,
- const webkit_glue::FormField& field,
+ const webkit::forms::FormData& form,
+ const webkit::forms::FormField& field,
int unique_id) {
autofill_manager_->OnFillAutofillFormData(query_id, form, field, unique_id);
}
@@ -2869,8 +2869,8 @@ class MockAutofillExternalDelegate : public AutofillExternalDelegate {
virtual ~MockAutofillExternalDelegate() {}
MOCK_METHOD5(OnQuery, void(int query_id,
- const webkit_glue::FormData& form,
- const webkit_glue::FormField& field,
+ const webkit::forms::FormData& form,
+ const webkit::forms::FormField& field,
const gfx::Rect& bounds,
bool display_warning));
@@ -2885,8 +2885,8 @@ class MockAutofillExternalDelegate : public AutofillExternalDelegate {
virtual void OnQueryPlatformSpecific(
int query_id,
- const webkit_glue::FormData& form,
- const webkit_glue::FormField& field) OVERRIDE {}
+ const webkit::forms::FormData& form,
+ const webkit::forms::FormField& field) OVERRIDE {}
private:
DISALLOW_COPY_AND_ASSIGN(MockAutofillExternalDelegate);
diff --git a/chrome/browser/autofill/autofill_merge_unittest.cc b/chrome/browser/autofill/autofill_merge_unittest.cc
index f232f2a..73552af 100644
--- a/chrome/browser/autofill/autofill_merge_unittest.cc
+++ b/chrome/browser/autofill/autofill_merge_unittest.cc
@@ -16,7 +16,7 @@
#include "googleurl/src/gurl.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebInputElement.h"
-#include "webkit/glue/form_data.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_glue::FormData form;
+ webkit::forms::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_glue::FormField field;
+ webkit::forms::FormField 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 4c1ab65..b99da96f 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/glue/form_data.h"
+#include "webkit/forms/form_data.h"
namespace {
@@ -202,7 +202,7 @@ void LogServerExperimentId(const std::string& histogram_name,
ServerExperiment metric = UNKNOWN_EXPERIMENT;
const std::string default_experiment_name =
- FormStructure(webkit_glue::FormData()).server_experiment_id();
+ FormStructure(webkit::forms::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 826c39df..b588c8c 100644
--- a/chrome/browser/autofill/autofill_metrics_unittest.cc
+++ b/chrome/browser/autofill/autofill_metrics_unittest.cc
@@ -23,8 +23,8 @@
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/rect.h"
-#include "webkit/glue/form_data.h"
-#include "webkit/glue/form_field.h"
+#include "webkit/forms/form_data.h"
+#include "webkit/forms/form_field.h"
using content::BrowserThread;
using ::testing::_;
@@ -32,8 +32,8 @@ using ::testing::AnyNumber;
using ::testing::Mock;
using base::TimeTicks;
using base::TimeDelta;
-using webkit_glue::FormData;
-using webkit_glue::FormField;
+using webkit::forms::FormData;
+using webkit::forms::FormField;
namespace {
diff --git a/chrome/browser/autofill/credit_card_field_unittest.cc b/chrome/browser/autofill/credit_card_field_unittest.cc
index c03c772..37bd16d 100644
--- a/chrome/browser/autofill/credit_card_field_unittest.cc
+++ b/chrome/browser/autofill/credit_card_field_unittest.cc
@@ -9,7 +9,7 @@
#include "chrome/browser/autofill/autofill_scanner.h"
#include "chrome/browser/autofill/credit_card_field.h"
#include "testing/gtest/include/gtest/gtest.h"
-#include "webkit/glue/form_field.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_glue::FormField field;
+ webkit::forms::FormField 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_glue::FormField field;
+ webkit::forms::FormField 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_glue::FormField field;
+ webkit::forms::FormField 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_glue::FormField field;
+ webkit::forms::FormField 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_glue::FormField field;
+ webkit::forms::FormField 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_glue::FormField field;
+ webkit::forms::FormField 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_glue::FormField field;
+ webkit::forms::FormField 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_glue::FormField field;
+ webkit::forms::FormField 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_glue::FormField field;
+ webkit::forms::FormField 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 33a2768..4229af3 100644
--- a/chrome/browser/autofill/form_structure.cc
+++ b/chrome/browser/autofill/form_structure.cc
@@ -9,9 +9,9 @@
#include "base/basictypes.h"
#include "base/logging.h"
#include "base/sha1.h"
-#include "base/stringprintf.h"
#include "base/string_number_conversions.h"
#include "base/string_util.h"
+#include "base/stringprintf.h"
#include "base/time.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/autofill/autofill_metrics.h"
@@ -20,14 +20,14 @@
#include "chrome/browser/autofill/field_types.h"
#include "chrome/browser/autofill/form_field.h"
#include "third_party/libjingle/source/talk/xmllite/xmlelement.h"
-#include "webkit/glue/form_data.h"
-#include "webkit/glue/form_data_predictions.h"
-#include "webkit/glue/form_field.h"
-#include "webkit/glue/form_field_predictions.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_glue::FormData;
-using webkit_glue::FormDataPredictions;
-using webkit_glue::FormFieldPredictions;
+using webkit::forms::FormData;
+using webkit::forms::FormDataPredictions;
+using webkit::forms::FormFieldPredictions;
namespace {
@@ -243,7 +243,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_glue::FormField>::const_iterator field =
+ for (std::vector<webkit::forms::FormField>::const_iterator field =
form.fields.begin();
field != form.fields.end(); field++) {
// Add all supported form fields (including with empty names) to the
@@ -486,7 +486,7 @@ 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_glue::FormField(**field));
+ form.data.fields.push_back(webkit::forms::FormField(**field));
FormFieldPredictions annotated_field;
annotated_field.signature = (*field)->FieldSignature();
diff --git a/chrome/browser/autofill/form_structure.h b/chrome/browser/autofill/form_structure.h
index db38b95..0f8b3ce 100644
--- a/chrome/browser/autofill/form_structure.h
+++ b/chrome/browser/autofill/form_structure.h
@@ -38,16 +38,18 @@ namespace buzz {
class XmlElement;
}
-namespace webkit_glue {
+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_glue::FormData& form);
+ explicit FormStructure(const webkit::forms::FormData& form);
virtual ~FormStructure();
// Runs several heuristics against the form fields to determine their possible
@@ -78,7 +80,7 @@ class FormStructure {
// fields' predicted types.
static void GetFieldTypePredictions(
const std::vector<FormStructure*>& form_structures,
- std::vector<webkit_glue::FormDataPredictions>* forms);
+ std::vector<webkit::forms::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.
@@ -139,8 +141,8 @@ class FormStructure {
virtual std::string server_experiment_id() const;
- bool operator==(const webkit_glue::FormData& form) const;
- bool operator!=(const webkit_glue::FormData& form) const;
+ bool operator==(const webkit::forms::FormData& form) const;
+ bool operator!=(const webkit::forms::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 dfb00e6..811c69e 100644
--- a/chrome/browser/autofill/form_structure_unittest.cc
+++ b/chrome/browser/autofill/form_structure_unittest.cc
@@ -9,14 +9,15 @@
#include "googleurl/src/gurl.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebInputElement.h"
-#include "webkit/glue/form_data.h"
-#include "webkit/glue/form_field.h"
+#include "webkit/forms/form_data.h"
+#include "webkit/forms/form_field.h"
-using webkit_glue::FormData;
-using webkit_glue::FormField;
+using webkit::forms::FormData;
+using webkit::forms::FormField;
using WebKit::WebInputElement;
-namespace webkit_glue {
+namespace webkit {
+namespace forms {
std::ostream& operator<<(std::ostream& os, const FormData& form) {
os << UTF16ToUTF8(form.name)
@@ -28,7 +29,7 @@ std::ostream& operator<<(std::ostream& os, const FormData& form) {
<< form.action.spec()
<< " ";
- for (std::vector<webkit_glue::FormField>::const_iterator iter =
+ for (std::vector<webkit::forms::FormField>::const_iterator iter =
form.fields.begin();
iter != form.fields.end(); ++iter) {
os << *iter
@@ -38,6 +39,7 @@ std::ostream& operator<<(std::ostream& os, const FormData& form) {
return os;
}
+} // namespace forms
} // namespace webkit_glue
class FormStructureTest {
diff --git a/chrome/browser/autofill/name_field_unittest.cc b/chrome/browser/autofill/name_field_unittest.cc
index f89d9de..3c703f3 100644
--- a/chrome/browser/autofill/name_field_unittest.cc
+++ b/chrome/browser/autofill/name_field_unittest.cc
@@ -9,7 +9,7 @@
#include "chrome/browser/autofill/autofill_scanner.h"
#include "chrome/browser/autofill/name_field.h"
#include "testing/gtest/include/gtest/gtest.h"
-#include "webkit/glue/form_field.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_glue::FormField field;
+ webkit::forms::FormField 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_glue::FormField field;
+ webkit::forms::FormField field;
field.form_control_type = ASCIIToUTF16("text");
field.label = string16();
@@ -92,7 +92,7 @@ TEST_F(NameFieldTest, FirstMiddleLast2) {
}
TEST_F(NameFieldTest, FirstLast) {
- webkit_glue::FormField field;
+ webkit::forms::FormField field;
field.form_control_type = ASCIIToUTF16("text");
field.label = string16();
@@ -116,7 +116,7 @@ TEST_F(NameFieldTest, FirstLast) {
}
TEST_F(NameFieldTest, FirstLast2) {
- webkit_glue::FormField field;
+ webkit::forms::FormField field;
field.form_control_type = ASCIIToUTF16("text");
field.label = ASCIIToUTF16("Name");
@@ -140,7 +140,7 @@ TEST_F(NameFieldTest, FirstLast2) {
}
TEST_F(NameFieldTest, FirstLastMiddleWithSpaces) {
- webkit_glue::FormField field;
+ webkit::forms::FormField 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_glue::FormField field;
+ webkit::forms::FormField field;
field.form_control_type = ASCIIToUTF16("text");
field.label = ASCIIToUTF16("Name");
@@ -195,7 +195,7 @@ TEST_F(NameFieldTest, FirstLastEmpty) {
}
TEST_F(NameFieldTest, FirstMiddleLastEmpty) {
- webkit_glue::FormField field;
+ webkit::forms::FormField field;
field.form_control_type = ASCIIToUTF16("text");
field.label = ASCIIToUTF16("Name");
@@ -226,7 +226,7 @@ TEST_F(NameFieldTest, FirstMiddleLastEmpty) {
}
TEST_F(NameFieldTest, MiddleInitial) {
- webkit_glue::FormField field;
+ webkit::forms::FormField 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_glue::FormField field;
+ webkit::forms::FormField 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_glue::FormField field;
+ webkit::forms::FormField field;
field.form_control_type = ASCIIToUTF16("text");
field.label = string16();
diff --git a/chrome/browser/autofill/personal_data_manager_unittest.cc b/chrome/browser/autofill/personal_data_manager_unittest.cc
index 630b1eb..90f8d81 100644
--- a/chrome/browser/autofill/personal_data_manager_unittest.cc
+++ b/chrome/browser/autofill/personal_data_manager_unittest.cc
@@ -25,10 +25,10 @@
#include "content/test/test_browser_thread.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
-#include "webkit/glue/form_data.h"
+#include "webkit/forms/form_data.h"
using content::BrowserThread;
-using webkit_glue::FormData;
+using webkit::forms::FormData;
ACTION(QuitUIMessageLoop) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
@@ -480,7 +480,7 @@ TEST_F(PersonalDataManagerTest, Refresh) {
TEST_F(PersonalDataManagerTest, ImportFormData) {
FormData form;
- webkit_glue::FormField field;
+ webkit::forms::FormField field;
autofill_test::CreateTestFormField(
"First name:", "first_name", "George", "text", &field);
form.fields.push_back(field);
@@ -525,7 +525,7 @@ TEST_F(PersonalDataManagerTest, ImportFormData) {
TEST_F(PersonalDataManagerTest, ImportFormDataBadEmail) {
FormData form;
- webkit_glue::FormField field;
+ webkit::forms::FormField field;
autofill_test::CreateTestFormField(
"First name:", "first_name", "George", "text", &field);
form.fields.push_back(field);
@@ -560,7 +560,7 @@ TEST_F(PersonalDataManagerTest, ImportFormDataBadEmail) {
TEST_F(PersonalDataManagerTest, ImportFormDataNotEnoughFilledFields) {
FormData form;
- webkit_glue::FormField field;
+ webkit::forms::FormField field;
autofill_test::CreateTestFormField(
"First name:", "first_name", "George", "text", &field);
form.fields.push_back(field);
@@ -585,7 +585,7 @@ TEST_F(PersonalDataManagerTest, ImportFormDataNotEnoughFilledFields) {
TEST_F(PersonalDataManagerTest, ImportPhoneNumberSplitAcrossMultipleFields) {
FormData form;
- webkit_glue::FormField field;
+ webkit::forms::FormField field;
autofill_test::CreateTestFormField(
"First name:", "first_name", "George", "text", &field);
form.fields.push_back(field);
@@ -676,7 +676,7 @@ TEST_F(PersonalDataManagerTest, SetUniqueCreditCardLabels) {
TEST_F(PersonalDataManagerTest, AggregateTwoDifferentProfiles) {
FormData form1;
- webkit_glue::FormField field;
+ webkit::forms::FormField field;
autofill_test::CreateTestFormField(
"First name:", "first_name", "George", "text", &field);
form1.fields.push_back(field);
@@ -767,7 +767,7 @@ TEST_F(PersonalDataManagerTest, AggregateTwoDifferentProfiles) {
TEST_F(PersonalDataManagerTest, AggregateTwoProfilesWithMultiValue) {
FormData form1;
- webkit_glue::FormField field;
+ webkit::forms::FormField field;
autofill_test::CreateTestFormField(
"First name:", "first_name", "George", "text", &field);
form1.fields.push_back(field);
@@ -862,7 +862,7 @@ TEST_F(PersonalDataManagerTest, AggregateTwoProfilesWithMultiValue) {
TEST_F(PersonalDataManagerTest, AggregateSameProfileWithConflict) {
FormData form1;
- webkit_glue::FormField field;
+ webkit::forms::FormField field;
autofill_test::CreateTestFormField(
"First name:", "first_name", "George", "text", &field);
form1.fields.push_back(field);
@@ -972,7 +972,7 @@ TEST_F(PersonalDataManagerTest, AggregateSameProfileWithConflict) {
TEST_F(PersonalDataManagerTest, AggregateProfileWithMissingInfoInOld) {
FormData form1;
- webkit_glue::FormField field;
+ webkit::forms::FormField field;
autofill_test::CreateTestFormField(
"First name:", "first_name", "George", "text", &field);
form1.fields.push_back(field);
@@ -1059,7 +1059,7 @@ TEST_F(PersonalDataManagerTest, AggregateProfileWithMissingInfoInOld) {
TEST_F(PersonalDataManagerTest, AggregateProfileWithMissingInfoInNew) {
FormData form1;
- webkit_glue::FormField field;
+ webkit::forms::FormField field;
autofill_test::CreateTestFormField(
"First name:", "first_name", "George", "text", &field);
form1.fields.push_back(field);
@@ -1150,7 +1150,7 @@ TEST_F(PersonalDataManagerTest, AggregateProfileWithMissingInfoInNew) {
TEST_F(PersonalDataManagerTest, AggregateProfileWithInsufficientAddress) {
FormData form1;
- webkit_glue::FormField field;
+ webkit::forms::FormField field;
autofill_test::CreateTestFormField(
"First name:", "first_name", "George", "text", &field);
form1.fields.push_back(field);
@@ -1200,7 +1200,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_glue::FormField field;
+ webkit::forms::FormField field;
autofill_test::CreateTestFormField(
"First name:", "first_name", "Tester", "text", &field);
form.fields.push_back(field);
@@ -1247,7 +1247,7 @@ TEST_F(PersonalDataManagerTest, AggregateTwoDifferentCreditCards) {
FormData form1;
// Start with a single valid credit card form.
- webkit_glue::FormField field;
+ webkit::forms::FormField field;
autofill_test::CreateTestFormField(
"Name on card:", "name_on_card", "Biggie Smalls", "text", &field);
form1.fields.push_back(field);
@@ -1323,7 +1323,7 @@ TEST_F(PersonalDataManagerTest, AggregateInvalidCreditCard) {
FormData form1;
// Start with a single valid credit card form.
- webkit_glue::FormField field;
+ webkit::forms::FormField field;
autofill_test::CreateTestFormField(
"Name on card:", "name_on_card", "Biggie Smalls", "text", &field);
form1.fields.push_back(field);
@@ -1390,7 +1390,7 @@ TEST_F(PersonalDataManagerTest, AggregateSameCreditCardWithConflict) {
FormData form1;
// Start with a single valid credit card form.
- webkit_glue::FormField field;
+ webkit::forms::FormField field;
autofill_test::CreateTestFormField(
"Name on card:", "name_on_card", "Biggie Smalls", "text", &field);
form1.fields.push_back(field);
@@ -1466,7 +1466,7 @@ TEST_F(PersonalDataManagerTest, AggregateEmptyCreditCardWithConflict) {
FormData form1;
// Start with a single valid credit card form.
- webkit_glue::FormField field;
+ webkit::forms::FormField field;
autofill_test::CreateTestFormField(
"Name on card:", "name_on_card", "Biggie Smalls", "text", &field);
form1.fields.push_back(field);
@@ -1534,7 +1534,7 @@ TEST_F(PersonalDataManagerTest, AggregateCreditCardWithMissingInfoInNew) {
FormData form1;
// Start with a single valid credit card form.
- webkit_glue::FormField field;
+ webkit::forms::FormField field;
autofill_test::CreateTestFormField(
"Name on card:", "name_on_card", "Biggie Smalls", "text", &field);
form1.fields.push_back(field);
@@ -1650,7 +1650,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_glue::FormField field;
+ webkit::forms::FormField field;
autofill_test::CreateTestFormField(
"Name on card:", "name_on_card", "Biggie Smalls", "text", &field);
form.fields.push_back(field);
@@ -1707,7 +1707,7 @@ TEST_F(PersonalDataManagerTest, AggregateSameCreditCardWithSeparators) {
// Import the same card info, but with different separators in the number.
FormData form;
- webkit_glue::FormField field;
+ webkit::forms::FormField field;
autofill_test::CreateTestFormField(
"Name on card:", "name_on_card", "Biggie Smalls", "text", &field);
form.fields.push_back(field);
@@ -1861,7 +1861,7 @@ TEST_F(PersonalDataManagerTest, GetNonEmptyTypes) {
TEST_F(PersonalDataManagerTest, CaseInsensitiveMultiValueAggregation) {
FormData form1;
- webkit_glue::FormField field;
+ webkit::forms::FormField 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 4f8dbd1..cd8baf5 100644
--- a/chrome/browser/autofill/phone_field_unittest.cc
+++ b/chrome/browser/autofill/phone_field_unittest.cc
@@ -9,7 +9,7 @@
#include "chrome/browser/autofill/autofill_scanner.h"
#include "chrome/browser/autofill/phone_field.h"
#include "testing/gtest/include/gtest/gtest.h"
-#include "webkit/glue/form_field.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_glue::FormField field;
+ webkit::forms::FormField field;
field.form_control_type = ASCIIToUTF16("text");
field.label = ASCIIToUTF16("Phone");
@@ -60,7 +60,7 @@ TEST_F(PhoneFieldTest, ParseOneLinePhone) {
}
TEST_F(PhoneFieldTest, ParseTwoLinePhone) {
- webkit_glue::FormField field;
+ webkit::forms::FormField 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_glue::FormField field;
+ webkit::forms::FormField 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_glue::FormField field;
+ webkit::forms::FormField field;
field.form_control_type = ASCIIToUTF16("text");
field.label = ASCIIToUTF16("Phone:");
@@ -164,7 +164,7 @@ TEST_F(PhoneFieldTest, ThreePartPhoneNumberPrefixSuffix) {
}
TEST_F(PhoneFieldTest, ThreePartPhoneNumberPrefixSuffix2) {
- webkit_glue::FormField field;
+ webkit::forms::FormField 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_glue::FormField field;
+ webkit::forms::FormField 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 f2cf81d..682ebff 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/glue/form_field.h"
+#include "webkit/forms/form_field.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_glue::FormField* field) {
+ webkit::forms::FormField* 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_glue::FormField* field) {
+ webkit::forms::FormField* 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_glue::FormField* field) {
+ webkit::forms::FormField* 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_glue::FormField* field) {
+ webkit::forms::FormField* 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_glue::FormField* field) {
+ webkit::forms::FormField* 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 1793c70..b4cacf7 100644
--- a/chrome/browser/autofill/select_control_handler.h
+++ b/chrome/browser/autofill/select_control_handler.h
@@ -11,9 +11,11 @@
class FormGroup;
-namespace webkit_glue {
+namespace webkit {
+namespace forms {
struct FormField;
-} // namespace webkit_glue
+}
+}
namespace autofill {
@@ -23,7 +25,7 @@ namespace autofill {
// months, e.g., (04, April).
void FillSelectControl(const FormGroup& form_group,
AutofillFieldType type,
- webkit_glue::FormField* field);
+ webkit::forms::FormField* 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 fc7577c..2977655 100644
--- a/chrome/browser/autofill/select_control_handler_unittest.cc
+++ b/chrome/browser/autofill/select_control_handler_unittest.cc
@@ -9,7 +9,7 @@
#include "chrome/browser/autofill/credit_card.h"
#include "chrome/browser/autofill/select_control_handler.h"
#include "testing/gtest/include/gtest/gtest.h"
-#include "webkit/glue/form_field.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_glue::FormField field;
+ webkit::forms::FormField 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_glue::FormField field;
+ webkit::forms::FormField 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_glue::FormField field;
+ webkit::forms::FormField 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_glue::FormField field;
+ webkit::forms::FormField 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_glue::FormField field;
+ webkit::forms::FormField 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_glue::FormField field;
+ webkit::forms::FormField 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_glue::FormField field;
+ webkit::forms::FormField 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_glue::FormField field;
+ webkit::forms::FormField 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_glue::FormField field;
+ webkit::forms::FormField 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_glue::FormField field;
+ webkit::forms::FormField field;
field.form_control_type = ASCIIToUTF16("select-one");
field.option_values = values;
field.option_contents = contents;