Chromium Code Reviews| Index: chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorDialog.java |
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorDialog.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorDialog.java |
| index c73f27249fda9b676fc92f2ba3bf8db9181b1b26..69e6f6428bba94a2741a7f510b34e8dbfb6935a8 100644 |
| --- a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorDialog.java |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorDialog.java |
| @@ -85,7 +85,7 @@ public class EditorDialog |
| private final TextWatcher mCardNumberFormatter; |
| @Nullable |
| - private TextWatcher mPhoneFormatter; |
| + private PhoneNumberUtil.CountryAwareFormatTextWatcher mPhoneFormatter; |
| private View mLayout; |
| private EditorModel mEditorModel; |
| private Button mDoneButton; |
| @@ -155,7 +155,7 @@ public class EditorDialog |
| }; |
| mCardNumberFormatter = new CreditCardNumberFormattingTextWatcher(); |
| - mPhoneFormatter = new PhoneNumberUtil.FormatTextWatcher(); |
| + mPhoneFormatter = new PhoneNumberUtil.CountryAwareFormatTextWatcher(); |
| } |
| /** Prevents screenshots of this editor. */ |
| @@ -567,6 +567,14 @@ public class EditorDialog |
| return invalidViews; |
| } |
| + /** |
| + * Update the country code used by the phone formatter. This is called when either user |
| + * changes country or when editor is initialized with default country. |
| + */ |
| + public void updateCountryOfPhoneFormatter(String country) { |
|
gogerald1
2017/06/15 17:41:35
It looks not an ideal design to let AddressEditor
wuandy1
2017/06/19 15:11:14
separate cl?
gogerald1
2017/06/19 21:30:38
I would not, this is an important part of your des
|
| + mPhoneFormatter.setCountryCode(country); |
| + } |
| + |
| /** @return All editable text fields in the editor. Used only for tests. */ |
| @VisibleForTesting |
| public List<EditText> getEditableTextFieldsForTest() { |