Index: chrome/browser/autofill/android/personal_data_manager_android.h |
diff --git a/chrome/browser/autofill/android/personal_data_manager_android.h b/chrome/browser/autofill/android/personal_data_manager_android.h |
index d16287395e10d000d414c7cd22b7d66866f1e968..f88843a22ceaf22d9cb88726d90fd3d243d070ae 100644 |
--- a/chrome/browser/autofill/android/personal_data_manager_android.h |
+++ b/chrome/browser/autofill/android/personal_data_manager_android.h |
@@ -15,6 +15,7 @@ |
#include "components/autofill/core/browser/personal_data_manager.h" |
#include "components/autofill/core/browser/personal_data_manager_observer.h" |
#include "components/payments/core/address_normalizer_impl.h" |
+#include "components/payments/core/subkey_requester.h" |
#include "third_party/libaddressinput/chromium/chrome_address_validator.h" |
namespace autofill { |
@@ -24,16 +25,8 @@ namespace autofill { |
// therefore a single instance of this wrapper. |
class PersonalDataManagerAndroid |
: public PersonalDataManagerObserver, |
- public LoadRulesListener, |
public base::SupportsWeakPtr<PersonalDataManagerAndroid> { |
public: |
- // The interface for the sub-key request. |
- class SubKeyRequestDelegate { |
- public: |
- virtual void OnRulesSuccessfullyLoaded() = 0; |
- virtual ~SubKeyRequestDelegate() {} |
- }; |
- |
// Registers the JNI bindings for this class. |
static bool Register(JNIEnv* env); |
@@ -305,7 +298,7 @@ class PersonalDataManagerAndroid |
const base::android::JavaParamRef<jstring>& region_code); |
// Starts loading the rules for the specified |region_code| for the further |
- // sub-key request. |
+ // subkey request. |
void LoadRulesForSubKeys( |
JNIEnv* env, |
const base::android::JavaParamRef<jobject>& unused_obj, |
@@ -334,27 +327,17 @@ class PersonalDataManagerAndroid |
JNIEnv* env, |
const base::android::JavaParamRef<jobject>& unused_obj); |
- // Gets the sub-keys for the region with |jregion_code| code, if the |
+ // Gets the subkeys for the region with |jregion_code| code, if the |
// |jregion_code| rules have finished loading. Otherwise, sets up a task to |
- // get the sub-keys, when the rules are loaded. |
+ // get the subkeys, when the rules are loaded. |
void StartRegionSubKeysRequest( |
JNIEnv* env, |
const base::android::JavaParamRef<jobject>& unused_obj, |
const base::android::JavaParamRef<jstring>& jregion_code, |
+ jint jtimeout_seconds, |
const base::android::JavaParamRef<jobject>& jdelegate); |
- // Gets the sub-keys of the rule associated with |jregion_code|. Should only |
- // be called when the rules are loaded. |
- base::android::ScopedJavaLocalRef<jobjectArray> GetSubKeys( |
- JNIEnv* env, |
- const std::string& jregion_code); |
- |
- // Callback of the sub-keys request. |
- // This is called when the sub-keys are loaded. |
- void OnAddressValidationRulesLoaded(const std::string& region_code, |
- bool success) override; |
- |
- // Cancels the pending sub-key request task. |
+ // Cancels the pending subkey request task. |
void CancelPendingGetSubKeys( |
JNIEnv* env, |
const base::android::JavaParamRef<jobject>& unused_obj); |
@@ -372,9 +355,6 @@ class PersonalDataManagerAndroid |
JNIEnv* env, |
const std::vector<CreditCard*>& credit_cards); |
- // Returns whether the rules are loaded for the specified |region_code|. |
- bool AreRulesLoadedForRegion(const std::string& region_code); |
- |
// Gets the labels for the |profiles| passed as parameters. These labels are |
// useful for distinguishing the profiles from one another. |
// |
@@ -409,12 +389,8 @@ class PersonalDataManagerAndroid |
// The address validator used to normalize addresses. |
payments::AddressNormalizerImpl address_normalizer_; |
- // The address validator used for sub-key request. |
- AddressValidator address_validator_; |
- |
- // The region code and the request for the pending sub-key request. |
- std::unique_ptr<SubKeyRequestDelegate> pending_subkey_request_; |
- std::string pending_subkey_region_code_; |
+ // Used for subkey request. |
+ payments::SubKeyRequester subkey_requester_; |
DISALLOW_COPY_AND_ASSIGN(PersonalDataManagerAndroid); |
}; |