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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/payments/AddressEditor.java

Issue 2924513002: use user chosen country code to format and validate phone number for addresses. (Closed)
Patch Set: add comments Created 3 years, 6 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: chrome/android/java/src/org/chromium/chrome/browser/payments/AddressEditor.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/AddressEditor.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/AddressEditor.java
index 804186b826fa310271e1c379236ff673cd97a597..792c7968c051e0c0ba4cd70d24790404a04d00f7 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/payments/AddressEditor.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/AddressEditor.java
@@ -123,6 +123,7 @@ public class AddressEditor
mEditor.removeAllFields();
showProgressDialog();
mRecentlySelectedCountry = eventData.first;
+ mEditorDialog.updateCountryOfPhoneFormatter(mRecentlySelectedCountry);
mCountryChangeCallback = eventData.second;
loadAdminAreasForCountry(mRecentlySelectedCountry);
}
@@ -395,7 +396,9 @@ public class AddressEditor
mPhoneValidator = new EditorFieldValidator() {
@Override
public boolean isValid(@Nullable CharSequence value) {
- return value != null && PhoneNumberUtil.isValidNumber(value.toString());
+ return value != null
+ && PhoneNumberUtil.isValidNumber(
+ value.toString(), mRecentlySelectedCountry);
gogerald1 2017/06/08 16:20:43 mRecentlySelectedCountry is null if the user doesn
wuandy1 2017/06/08 20:34:58 Which is handled by isValidNumber..do you mean a @
gogerald1 2017/06/09 13:33:46 NO, the selected country is set according to profi
wuandy1 2017/06/12 14:15:25 ok i see. what is your suggestion then?
gogerald1 2017/06/12 17:02:11 What about using 'mCountryField.getValue().toStrin
wuandy1 2017/06/13 19:47:25 Done.
}
@Override

Powered by Google App Engine
This is Rietveld 408576698