Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2042)

Unified Diff: chrome/browser/autofill/phone_number.h

Issue 11783045: [Autofill] Ensure that clients pass the correct region info when parsing phone numbers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/autofill/personal_data_manager.cc ('k') | chrome/browser/autofill/phone_number.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autofill/phone_number.h
diff --git a/chrome/browser/autofill/phone_number.h b/chrome/browser/autofill/phone_number.h
index e2f203b246c423c610bd903c81172bbcd9b3beb0..ac02ed768cf3f214dd6f3e0b051f1734977e8796 100644
--- a/chrome/browser/autofill/phone_number.h
+++ b/chrome/browser/autofill/phone_number.h
@@ -56,8 +56,13 @@ class PhoneNumber : public FormGroup {
// returns true. For all other field types returs false.
bool SetInfo(AutofillFieldType type, const string16& value);
- // Returns true if parsing was successful, false otherwise.
- bool ParseNumber(const std::string& region, string16* value);
+ // Parses the number built up from pieces stored via SetInfo() according to
+ // the specified |profile|'s country code, falling back to the given
+ // |app_locale| if the |profile| has no associated country code. Returns
+ // true if parsing was successful, false otherwise.
+ bool ParseNumber(const AutofillProfile& profile,
+ const std::string& app_locale,
+ string16* value);
// Returns true if both |phone_| and |whole_number_| are empty.
bool IsEmpty() const;
@@ -73,13 +78,6 @@ class PhoneNumber : public FormGroup {
// FormGroup:
virtual void GetSupportedTypes(FieldTypeSet* supported_types) const OVERRIDE;
- // 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_|; 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 std::string& app_locale) const;
« no previous file with comments | « chrome/browser/autofill/personal_data_manager.cc ('k') | chrome/browser/autofill/phone_number.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698