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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/autofill/PersonalDataManager.java

Issue 2636023002: [Autofill and payments] Redesign Autofill settings UIs (Closed)
Patch Set: rebase Created 3 years, 11 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/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 d0ec482cda5e3e0694cde7581c54036bb734c326..b4ee5f6dc3fcb24e75a08219fa2468bd1c33a1e7 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
@@ -12,7 +12,7 @@ import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.annotations.JNINamespace;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.ResourceId;
-import org.chromium.chrome.browser.preferences.autofill.AutofillPreferences;
+import org.chromium.chrome.browser.preferences.autofill.AutofillAndPaymentsPreferences;
import org.chromium.content_public.browser.WebContents;
import java.util.ArrayList;
@@ -131,7 +131,7 @@ public class PersonalDataManager {
* locale. All other fields are empty strings, because JNI does not handle null strings.
*/
public AutofillProfile() {
- this("" /* guid */, AutofillPreferences.SETTINGS_ORIGIN /* origin */,
+ this("" /* guid */, AutofillAndPaymentsPreferences.SETTINGS_ORIGIN /* origin */,
true /* isLocal */, "" /* fullName */, "" /* companyName */,
"" /* streetAddress */, "" /* region */, "" /* locality */,
"" /* dependentLocality */, "" /* postalCode */, "" /* sortingCode */,
@@ -373,10 +373,11 @@ public class PersonalDataManager {
}
public CreditCard() {
- this("" /* guid */, AutofillPreferences.SETTINGS_ORIGIN /*origin */, true /* isLocal */,
- false /* isCached */, "" /* name */, "" /* number */, "" /* obfuscatedNumber */,
- "" /* month */, "" /* year */, "" /* basicCardPaymentType */,
- 0 /* issuerIconDrawableId */, "" /* billingAddressId */, "" /* serverId */);
+ this("" /* guid */, AutofillAndPaymentsPreferences.SETTINGS_ORIGIN /*origin */,
+ true /* isLocal */, false /* isCached */, "" /* name */, "" /* number */,
+ "" /* obfuscatedNumber */, "" /* month */, "" /* year */,
+ "" /* basicCardPaymentType */, 0 /* issuerIconDrawableId */,
+ "" /* billingAddressId */, "" /* serverId */);
}
/** TODO(estade): remove this constructor. */
@@ -827,6 +828,24 @@ public class PersonalDataManager {
}
/**
+ * Checks whether the Autofill PersonalDataManager has profiles.
+ *
+ * @return True If there are profiles.
+ */
+ public boolean hasProfiles() {
+ return nativeHasProfiles(mPersonalDataManagerAndroid);
+ }
+
+ /**
+ * Checks whether the Autofill PersonalDataManager has credit cards.
+ *
+ * @return True If there are credit cards.
+ */
+ public boolean hasCreditCards() {
+ return nativeHasCreditCards(mPersonalDataManagerAndroid);
+ }
+
+ /**
* @return Whether the Autofill feature is enabled.
*/
public static boolean isAutofillEnabled() {
@@ -940,6 +959,8 @@ public class PersonalDataManager {
String guid, String regionCode, NormalizedAddressRequestDelegate delegate);
private native void nativeCancelPendingAddressNormalizations(
long nativePersonalDataManagerAndroid);
+ private static native boolean nativeHasProfiles(long nativePersonalDataManagerAndroid);
+ private static native boolean nativeHasCreditCards(long nativePersonalDataManagerAndroid);
private static native boolean nativeIsAutofillEnabled();
private static native void nativeSetAutofillEnabled(boolean enable);
private static native boolean nativeIsAutofillManaged();

Powered by Google App Engine
This is Rietveld 408576698