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

Unified Diff: third_party/libaddressinput/chromium/chrome_address_validator.cc

Issue 2338283003: [Payments] Normalize addresses before passing them to merchants. (Closed)
Patch Set: Addressed vabr@'s comments Created 4 years, 3 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
Index: third_party/libaddressinput/chromium/chrome_address_validator.cc
diff --git a/third_party/libaddressinput/chromium/chrome_address_validator.cc b/third_party/libaddressinput/chromium/chrome_address_validator.cc
index ef11a62fb1c818c77e6613710bd2ab8041ca4b31..ce660c7394a567c8a8d8dcba5a4bd21e9d01aeee 100644
--- a/third_party/libaddressinput/chromium/chrome_address_validator.cc
+++ b/third_party/libaddressinput/chromium/chrome_address_validator.cc
@@ -112,19 +112,18 @@ AddressValidator::Status AddressValidator::GetSuggestions(
return SUCCESS;
}
-bool AddressValidator::CanonicalizeAdministrativeArea(
- AddressData* address) const {
+bool AddressValidator::NormalizeAddress(AddressData* address) const {
if (!supplier_->IsLoaded(address->region_code))
return false;
- // TODO: It would probably be beneficial to use the full canonicalization.
- AddressData tmp(*address);
- normalizer_->Normalize(&tmp);
- address->administrative_area = tmp.administrative_area;
-
+ normalizer_->Normalize(address);
return true;
}
+bool AddressValidator::AreRulesLoadedForRegion(const std::string& region_code) {
+ return supplier_->IsLoaded(region_code);
+}
+
AddressValidator::AddressValidator()
: load_rules_listener_(NULL), weak_factory_(this) {}

Powered by Google App Engine
This is Rietveld 408576698