diff options
author | isherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-05 05:34:48 +0000 |
---|---|---|
committer | isherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-05 05:34:48 +0000 |
commit | 4d11fcde4d6bb6d2a98fedff9e3a4812b0c24e89 (patch) | |
tree | b44a155924fac62ab8872adc1a22169f598ec3e4 /chrome/browser/autofill/phone_number.h | |
parent | 0e7f2b7f4023f10cc1d4d4a9eabca701faedec01 (diff) | |
download | chromium_src-4d11fcde4d6bb6d2a98fedff9e3a4812b0c24e89.zip chromium_src-4d11fcde4d6bb6d2a98fedff9e3a4812b0c24e89.tar.gz chromium_src-4d11fcde4d6bb6d2a98fedff9e3a4812b0c24e89.tar.bz2 |
[Autofill] Rename {Get,Set}CanonicalizedInfo() to {Get,Set}Info(), and pass in the app locale.
Also:
* Pass the app locale to FormGroup::GetMatchingTypes(), FormGroup::GetNonEmptyTypes(), and CreditCard::UpdateFromImportedCard().
* Update PhoneNumber::GetRawInfo() to not rely on knowing the locale, and move all the code that depended on knowing the locale into PhoneNumber::GetInfo().
* Within the AutofillManager code, read the app locale on the UI thread, and pass it as a parameter to the worker thread.
BUG=100845
TEST=none (this is a refactoring change)
Review URL: https://chromiumcodereview.appspot.com/11417131
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171166 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autofill/phone_number.h')
-rw-r--r-- | chrome/browser/autofill/phone_number.h | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/chrome/browser/autofill/phone_number.h b/chrome/browser/autofill/phone_number.h index 192b4a83..a4ce5c6 100644 --- a/chrome/browser/autofill/phone_number.h +++ b/chrome/browser/autofill/phone_number.h @@ -29,13 +29,16 @@ class PhoneNumber : public FormGroup { // FormGroup implementation: virtual void GetMatchingTypes(const string16& text, + const std::string& app_locale, FieldTypeSet* matching_types) const OVERRIDE; virtual string16 GetRawInfo(AutofillFieldType type) const OVERRIDE; virtual void SetRawInfo(AutofillFieldType type, const string16& value) OVERRIDE; - virtual string16 GetCanonicalizedInfo(AutofillFieldType type) const OVERRIDE; - virtual bool SetCanonicalizedInfo(AutofillFieldType type, - const string16& value) OVERRIDE; + virtual string16 GetInfo(AutofillFieldType type, + const std::string& app_locale) const OVERRIDE; + virtual bool SetInfo(AutofillFieldType type, + const string16& value, + const std::string& app_locale) OVERRIDE; // Size and offset of the prefix and suffix portions of phone numbers. static const size_t kPrefixOffset = 0; @@ -70,18 +73,16 @@ class PhoneNumber : public FormGroup { // FormGroup: virtual void GetSupportedTypes(FieldTypeSet* supported_types) const OVERRIDE; - // Validates |number_| and translates it into digits-only format. - bool NormalizePhone(); - // Returns the region code for this phone number, which is an ISO 3166 // 2-letter country code. The name "region" is chosen since "country code" // already refers to part of a phone number. The returned value is based on - // the |profile_|. - std::string GetRegion() const; + // the |profile_|; if the |profile_| does not have a country code associated + // with it, falls back to the country code corresponding to the |app_locale|. + std::string GetRegion(const std::string& app_locale) const; // Updates the cached parsed number if the profile's region has changed // since the last time the cache was updated. - void UpdateCacheIfNeeded() const; + void UpdateCacheIfNeeded(const std::string& app_locale) const; // The phone number. string16 number_; |