| Index: chrome/android/java/src/org/chromium/chrome/browser/autofill/PersonalDataManager.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/autofill/PersonalDataManager.java b/chrome/android/java/src/org/chromium/chrome/browser/autofill/PersonalDataManager.java
|
| index a04a76d1241607815c223dc6565d396b55826d19..b7a4e57103bded1bfe591705206a1cbac670f2f0 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/autofill/PersonalDataManager.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/autofill/PersonalDataManager.java
|
| @@ -62,11 +62,24 @@ public class PersonalDataManager {
|
| }
|
|
|
| /**
|
| + * Callback for sub-keys' request.
|
| + */
|
| + public interface GetSubKeysRequestDelegate {
|
| + /**
|
| + * Called when the sub-keys are received successfully.
|
| + *
|
| + * @param subKeys The sub-keys.
|
| + */
|
| + @CalledByNative("GetSubKeysRequestDelegate")
|
| + void onSubKeysReceived(String[] subKeys);
|
| + }
|
| +
|
| + /**
|
| * Callback for normalized addresses.
|
| */
|
| public interface NormalizedAddressRequestDelegate {
|
| /**
|
| - * Called when the address has been sucessfully normalized.
|
| + * Called when the address has been successfully normalized.
|
| *
|
| * @param profile The profile with the normalized address.
|
| */
|
| @@ -828,6 +841,22 @@ public class PersonalDataManager {
|
| }
|
|
|
| /**
|
| + * Starts loading the sub-keys for the specified {@code regionCode}.
|
| + *
|
| + * @param regionCode The region code for which sub-keys will be loaded.
|
| + */
|
| + public void getRegionSubKeys(String regionCode, GetSubKeysRequestDelegate delegate) {
|
| + ThreadUtils.assertOnUiThread();
|
| + nativeStartGettingRegionSubKeys(mPersonalDataManagerAndroid, regionCode, delegate);
|
| + }
|
| +
|
| + /** Cancels the pending request for sub-keys. */
|
| + public void cancelPendingGetSubKeys() {
|
| + ThreadUtils.assertOnUiThread();
|
| + nativeCancelPendingGetSubKeys(mPersonalDataManagerAndroid);
|
| + }
|
| +
|
| + /**
|
| * @return Whether the Autofill feature is enabled.
|
| */
|
| public static boolean isAutofillEnabled() {
|
| @@ -937,6 +966,8 @@ public class PersonalDataManager {
|
| WebContents webContents, CreditCard card, FullCardRequestDelegate delegate);
|
| private native void nativeLoadRulesForRegion(
|
| long nativePersonalDataManagerAndroid, String regionCode);
|
| + private native void nativeStartGettingRegionSubKeys(long nativePersonalDataManagerAndroid,
|
| + String regionCode, GetSubKeysRequestDelegate delegate);
|
| private native boolean nativeStartAddressNormalization(long nativePersonalDataManagerAndroid,
|
| String guid, String regionCode, NormalizedAddressRequestDelegate delegate);
|
| private native void nativeCancelPendingAddressNormalizations(
|
| @@ -947,4 +978,5 @@ public class PersonalDataManager {
|
| private static native boolean nativeIsPaymentsIntegrationEnabled();
|
| private static native void nativeSetPaymentsIntegrationEnabled(boolean enable);
|
| private static native String nativeToCountryCode(String countryName);
|
| + private static native void nativeCancelPendingGetSubKeys(long nativePersonalDataManagerAndroid);
|
| }
|
|
|