summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autofill
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-01 22:21:10 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-01 22:21:10 +0000
commit0f9141e83df10e173bc04fa57b11483ab4d5bde3 (patch)
tree8197705a9cc5bc1a57ff83215f4677d36705d311 /chrome/browser/autofill
parent9b9ae9556a0b51fc0201e925624ae6bd76686536 (diff)
downloadchromium_src-0f9141e83df10e173bc04fa57b11483ab4d5bde3.zip
chromium_src-0f9141e83df10e173bc04fa57b11483ab4d5bde3.tar.gz
chromium_src-0f9141e83df10e173bc04fa57b11483ab4d5bde3.tar.bz2
The Chrome form autofill code defines a number of static string16 objects in the header file resulting in
these objects being initialized wherever the form_field.h is included. All this happens during LoadLibrary of chrome.dll. Moving the definitions of the string objects to the source file. Bug=48097 Review URL: http://codereview.chromium.org/2883016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51435 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autofill')
-rw-r--r--chrome/browser/autofill/form_field.cc47
-rw-r--r--chrome/browser/autofill/form_field.h79
2 files changed, 84 insertions, 42 deletions
diff --git a/chrome/browser/autofill/form_field.cc b/chrome/browser/autofill/form_field.cc
index e4f9a36..e3fc2bf 100644
--- a/chrome/browser/autofill/form_field.cc
+++ b/chrome/browser/autofill/form_field.cc
@@ -14,6 +14,53 @@
#include "third_party/WebKit/WebKit/chromium/public/WebRegularExpression.h"
#include "third_party/WebKit/WebKit/chromium/public/WebString.h"
+// Field names from the ECML specification; see RFC 3106. We've
+// made these names lowercase since we convert labels and field names to
+// lowercase before searching.
+
+// shipping name/address fields
+string16 kEcmlShipToTitle = ASCIIToUTF16("ecom_shipto_postal_name_prefix");
+string16 kEcmlShipToFirstName = ASCIIToUTF16("ecom_shipto_postal_name_first");
+string16 kEcmlShipToMiddleName = ASCIIToUTF16("ecom_shipto_postal_name_middle");
+string16 kEcmlShipToLastName = ASCIIToUTF16("ecom_shipto_postal_name_last");
+string16 kEcmlShipToNameSuffix = ASCIIToUTF16("ecom_shipto_postal_name_suffix");
+string16 kEcmlShipToCompanyName = ASCIIToUTF16("ecom_shipto_postal_company");
+string16 kEcmlShipToAddress1 = ASCIIToUTF16("ecom_shipto_postal_street_line1");
+string16 kEcmlShipToAddress2 = ASCIIToUTF16("ecom_shipto_postal_street_line2");
+string16 kEcmlShipToAddress3 = ASCIIToUTF16("ecom_shipto_postal_street_line3");
+string16 kEcmlShipToCity = ASCIIToUTF16("ecom_shipto_postal_city");
+string16 kEcmlShipToStateProv = ASCIIToUTF16("ecom_shipto_postal_stateprov");
+string16 kEcmlShipToPostalCode = ASCIIToUTF16("ecom_shipto_postal_postalcode");
+string16 kEcmlShipToCountry = ASCIIToUTF16("ecom_shipto_postal_countrycode");
+string16 kEcmlShipToPhone = ASCIIToUTF16("ecom_shipto_telecom_phone_number");
+string16 kEcmlShipToEmail = ASCIIToUTF16("ecom_shipto_online_email");
+
+// billing name/address fields
+string16 kEcmlBillToTitle = ASCIIToUTF16("ecom_billto_postal_name_prefix");
+string16 kEcmlBillToFirstName = ASCIIToUTF16("ecom_billto_postal_name_first");
+string16 kEcmlBillToMiddleName = ASCIIToUTF16("ecom_billto_postal_name_middle");
+string16 kEcmlBillToLastName = ASCIIToUTF16("ecom_billto_postal_name_last");
+string16 kEcmlBillToNameSuffix = ASCIIToUTF16("ecom_billto_postal_name_suffix");
+string16 kEcmlBillToCompanyName = ASCIIToUTF16("ecom_billto_postal_company");
+string16 kEcmlBillToAddress1 = ASCIIToUTF16("ecom_billto_postal_street_line1");
+string16 kEcmlBillToAddress2 = ASCIIToUTF16("ecom_billto_postal_street_line2");
+string16 kEcmlBillToAddress3 = ASCIIToUTF16("ecom_billto_postal_street_line3");
+string16 kEcmlBillToCity = ASCIIToUTF16("ecom_billto_postal_city");
+string16 kEcmlBillToStateProv = ASCIIToUTF16("ecom_billto_postal_stateprov");
+string16 kEcmlBillToPostalCode = ASCIIToUTF16("ecom_billto_postal_postalcode");
+string16 kEcmlBillToCountry = ASCIIToUTF16("ecom_billto_postal_countrycode");
+string16 kEcmlBillToPhone = ASCIIToUTF16("ecom_billto_telecom_phone_number");
+string16 kEcmlBillToEmail = ASCIIToUTF16("ecom_billto_online_email");
+
+// credit card fields
+string16 kEcmlCardHolder = ASCIIToUTF16("ecom_payment_card_name");
+string16 kEcmlCardType = ASCIIToUTF16("ecom_payment_card_type");
+string16 kEcmlCardNumber = ASCIIToUTF16("ecom_payment_card_number");
+string16 kEcmlCardVerification = ASCIIToUTF16("ecom_payment_card_verification");
+string16 kEcmlCardExpireDay = ASCIIToUTF16("ecom_payment_card_expdate_day");
+string16 kEcmlCardExpireMonth = ASCIIToUTF16("ecom_payment_card_expdate_month");
+string16 kEcmlCardExpireYear = ASCIIToUTF16("ecom_payment_card_expdate_year");
+
namespace {
// The name of the hidden form control element.
diff --git a/chrome/browser/autofill/form_field.h b/chrome/browser/autofill/form_field.h
index 8e4ae80..afe5a18 100644
--- a/chrome/browser/autofill/form_field.h
+++ b/chrome/browser/autofill/form_field.h
@@ -12,52 +12,47 @@
#include "chrome/browser/autofill/autofill_type.h"
#include "chrome/browser/autofill/form_structure.h"
-// Field names from the ECML specification; see RFC 3106. We've
-// made these names lowercase since we convert labels and field names to
-// lowercase before searching.
-
-// shipping name/address fields
-static string16 kEcmlShipToTitle = ASCIIToUTF16("ecom_shipto_postal_name_prefix");
-static string16 kEcmlShipToFirstName = ASCIIToUTF16("ecom_shipto_postal_name_first");
-static string16 kEcmlShipToMiddleName = ASCIIToUTF16("ecom_shipto_postal_name_middle");
-static string16 kEcmlShipToLastName = ASCIIToUTF16("ecom_shipto_postal_name_last");
-static string16 kEcmlShipToNameSuffix = ASCIIToUTF16("ecom_shipto_postal_name_suffix");
-static string16 kEcmlShipToCompanyName = ASCIIToUTF16("ecom_shipto_postal_company");
-static string16 kEcmlShipToAddress1 = ASCIIToUTF16("ecom_shipto_postal_street_line1");
-static string16 kEcmlShipToAddress2 = ASCIIToUTF16("ecom_shipto_postal_street_line2");
-static string16 kEcmlShipToAddress3 = ASCIIToUTF16("ecom_shipto_postal_street_line3");
-static string16 kEcmlShipToCity = ASCIIToUTF16("ecom_shipto_postal_city");
-static string16 kEcmlShipToStateProv = ASCIIToUTF16("ecom_shipto_postal_stateprov");
-static string16 kEcmlShipToPostalCode = ASCIIToUTF16("ecom_shipto_postal_postalcode");
-static string16 kEcmlShipToCountry = ASCIIToUTF16("ecom_shipto_postal_countrycode");
-static string16 kEcmlShipToPhone = ASCIIToUTF16("ecom_shipto_telecom_phone_number");
-static string16 kEcmlShipToEmail = ASCIIToUTF16("ecom_shipto_online_email");
+extern string16 kEcmlShipToTitle;
+extern string16 kEcmlShipToFirstName;
+extern string16 kEcmlShipToMiddleName;
+extern string16 kEcmlShipToLastName;
+extern string16 kEcmlShipToNameSuffix;
+extern string16 kEcmlShipToCompanyName;
+extern string16 kEcmlShipToAddress1;
+extern string16 kEcmlShipToAddress2;
+extern string16 kEcmlShipToAddress3;
+extern string16 kEcmlShipToCity;
+extern string16 kEcmlShipToStateProv;
+extern string16 kEcmlShipToPostalCode;
+extern string16 kEcmlShipToCountry;
+extern string16 kEcmlShipToPhone;
+extern string16 kEcmlShipToEmail;
// billing name/address fields
-static string16 kEcmlBillToTitle = ASCIIToUTF16("ecom_billto_postal_name_prefix");
-static string16 kEcmlBillToFirstName = ASCIIToUTF16("ecom_billto_postal_name_first");
-static string16 kEcmlBillToMiddleName = ASCIIToUTF16("ecom_billto_postal_name_middle");
-static string16 kEcmlBillToLastName = ASCIIToUTF16("ecom_billto_postal_name_last");
-static string16 kEcmlBillToNameSuffix = ASCIIToUTF16("ecom_billto_postal_name_suffix");
-static string16 kEcmlBillToCompanyName = ASCIIToUTF16("ecom_billto_postal_company");
-static string16 kEcmlBillToAddress1 = ASCIIToUTF16("ecom_billto_postal_street_line1");
-static string16 kEcmlBillToAddress2 = ASCIIToUTF16("ecom_billto_postal_street_line2");
-static string16 kEcmlBillToAddress3 = ASCIIToUTF16("ecom_billto_postal_street_line3");
-static string16 kEcmlBillToCity = ASCIIToUTF16("ecom_billto_postal_city");
-static string16 kEcmlBillToStateProv = ASCIIToUTF16("ecom_billto_postal_stateprov");
-static string16 kEcmlBillToPostalCode = ASCIIToUTF16("ecom_billto_postal_postalcode");
-static string16 kEcmlBillToCountry = ASCIIToUTF16("ecom_billto_postal_countrycode");
-static string16 kEcmlBillToPhone = ASCIIToUTF16("ecom_billto_telecom_phone_number");
-static string16 kEcmlBillToEmail = ASCIIToUTF16("ecom_billto_online_email");
+extern string16 kEcmlBillToTitle;
+extern string16 kEcmlBillToFirstName;
+extern string16 kEcmlBillToMiddleName;
+extern string16 kEcmlBillToLastName;
+extern string16 kEcmlBillToNameSuffix;
+extern string16 kEcmlBillToCompanyName;
+extern string16 kEcmlBillToAddress1;
+extern string16 kEcmlBillToAddress2;
+extern string16 kEcmlBillToAddress3;
+extern string16 kEcmlBillToCity;
+extern string16 kEcmlBillToStateProv;
+extern string16 kEcmlBillToPostalCode;
+extern string16 kEcmlBillToCountry;
+extern string16 kEcmlBillToPhone;
+extern string16 kEcmlBillToEmail;
// credit card fields
-static string16 kEcmlCardHolder = ASCIIToUTF16("ecom_payment_card_name");
-static string16 kEcmlCardType = ASCIIToUTF16("ecom_payment_card_type");
-static string16 kEcmlCardNumber = ASCIIToUTF16("ecom_payment_card_number");
-static string16 kEcmlCardVerification = ASCIIToUTF16("ecom_payment_card_verification");
-static string16 kEcmlCardExpireDay = ASCIIToUTF16("ecom_payment_card_expdate_day");
-static string16 kEcmlCardExpireMonth = ASCIIToUTF16("ecom_payment_card_expdate_month");
-static string16 kEcmlCardExpireYear = ASCIIToUTF16("ecom_payment_card_expdate_year");
+extern string16 kEcmlCardHolder;
+extern string16 kEcmlCardType;
+extern string16 kEcmlCardNumber;
+extern string16 kEcmlCardVerification;
+extern string16 kEcmlCardExpireDay;
+extern string16 kEcmlCardExpireMonth;
+extern string16 kEcmlCardExpireYear;
enum FormFieldType {
kAddressType,