diff options
author | georgey@chromium.org <georgey@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-03 18:12:54 +0000 |
---|---|---|
committer | georgey@chromium.org <georgey@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-03 18:12:54 +0000 |
commit | f8e7b62dd159148eccfc779d599300e27fdf8a0d (patch) | |
tree | bb5621051845f8be667b3b6b6690737dad4b87d2 /chrome/browser/autofill | |
parent | a471e9c8828edff914937df14c1998d4bc3dff72 (diff) | |
download | chromium_src-f8e7b62dd159148eccfc779d599300e27fdf8a0d.zip chromium_src-f8e7b62dd159148eccfc779d599300e27fdf8a0d.tar.gz chromium_src-f8e7b62dd159148eccfc779d599300e27fdf8a0d.tar.bz2 |
New autofill UI. Still not done:
1. Countries ComboBox - need countries list.
2. Correct icons size.
TEST=in the mocks.
BUG=37816,39238,41232,41793,36601
Review URL: http://codereview.chromium.org/2500002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48849 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autofill')
-rw-r--r-- | chrome/browser/autofill/phone_number.cc | 9 | ||||
-rw-r--r-- | chrome/browser/autofill/phone_number.h | 3 |
2 files changed, 7 insertions, 5 deletions
diff --git a/chrome/browser/autofill/phone_number.cc b/chrome/browser/autofill/phone_number.cc index a32bb57..2c541b4 100644 --- a/chrome/browser/autofill/phone_number.cc +++ b/chrome/browser/autofill/phone_number.cc @@ -123,7 +123,7 @@ void PhoneNumber::SetInfo(const AutoFillType& type, const string16& value) { } // Static. -void PhoneNumber::ParsePhoneNumber(const string16& value, +bool PhoneNumber::ParsePhoneNumber(const string16& value, string16* number, string16* city_code, string16* country_code) { @@ -142,24 +142,25 @@ void PhoneNumber::ParsePhoneNumber(const string16& value, StripPunctuation(&working); if (working.size() < kPhoneNumberLength) - return; + return false; // Treat the last 7 digits as the number. *number = working.substr(working.size() - kPhoneNumberLength, kPhoneNumberLength); working.resize(working.size() - kPhoneNumberLength); if (working.size() < kPhoneCityCodeLength) - return; + return true; // Treat the next three digits as the city code. *city_code = working.substr(working.size() - kPhoneCityCodeLength, kPhoneCityCodeLength); working.resize(working.size() - kPhoneCityCodeLength); if (working.empty()) - return; + return true; // Treat any remaining digits as the country code. *country_code = working; + return true; } string16 PhoneNumber::WholeNumber() const { diff --git a/chrome/browser/autofill/phone_number.h b/chrome/browser/autofill/phone_number.h index da6f051..9da3b98 100644 --- a/chrome/browser/autofill/phone_number.h +++ b/chrome/browser/autofill/phone_number.h @@ -30,7 +30,8 @@ class PhoneNumber : public FormGroup { // returns the trailing 7 digits, |city_code| returns the next 3 digits, and // |country_code| returns any remaining digits. // Separator characters are stripped before parsing the digits. - static void ParsePhoneNumber(const string16& value, + // Returns true if parsing was successfull, false otherwise. + static bool ParsePhoneNumber(const string16& value, string16* number, string16* city_code, string16* country_code); |