OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.chrome.browser.autofill; | 5 package org.chromium.chrome.browser.autofill; |
6 | 6 |
7 import org.chromium.base.CalledByNative; | 7 import org.chromium.base.CalledByNative; |
8 import org.chromium.base.JNINamespace; | 8 import org.chromium.base.JNINamespace; |
9 import org.chromium.base.ThreadUtils; | 9 import org.chromium.base.ThreadUtils; |
10 | 10 |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 public String setCreditCard(CreditCard card) { | 415 public String setCreditCard(CreditCard card) { |
416 ThreadUtils.assertOnUiThread(); | 416 ThreadUtils.assertOnUiThread(); |
417 return nativeSetCreditCard(mPersonalDataManagerAndroid, card); | 417 return nativeSetCreditCard(mPersonalDataManagerAndroid, card); |
418 } | 418 } |
419 | 419 |
420 public void deleteCreditCard(String guid) { | 420 public void deleteCreditCard(String guid) { |
421 ThreadUtils.assertOnUiThread(); | 421 ThreadUtils.assertOnUiThread(); |
422 nativeRemoveByGUID(mPersonalDataManagerAndroid, guid); | 422 nativeRemoveByGUID(mPersonalDataManagerAndroid, guid); |
423 } | 423 } |
424 | 424 |
| 425 public void clearUnmaskedCache() { |
| 426 nativeClearUnmaskedCache(mPersonalDataManagerAndroid); |
| 427 } |
| 428 |
425 /** | 429 /** |
426 * @return Whether the Autofill feature is enabled. | 430 * @return Whether the Autofill feature is enabled. |
427 */ | 431 */ |
428 public static boolean isAutofillEnabled() { | 432 public static boolean isAutofillEnabled() { |
429 return nativeIsAutofillEnabled(); | 433 return nativeIsAutofillEnabled(); |
430 } | 434 } |
431 | 435 |
432 /** | 436 /** |
433 * Enables or disables the Autofill feature. | 437 * Enables or disables the Autofill feature. |
434 * @param enable True to disable Autofill, false otherwise. | 438 * @param enable True to disable Autofill, false otherwise. |
435 */ | 439 */ |
436 public static void setAutofillEnabled(boolean enable) { | 440 public static void setAutofillEnabled(boolean enable) { |
437 nativeSetAutofillEnabled(enable); | 441 nativeSetAutofillEnabled(enable); |
438 } | 442 } |
439 | 443 |
440 /** | 444 /** |
441 * @return Whether the Autofill feature is managed. | 445 * @return Whether the Autofill feature is managed. |
442 */ | 446 */ |
443 public static boolean isAutofillManaged() { | 447 public static boolean isAutofillManaged() { |
444 return nativeIsAutofillManaged(); | 448 return nativeIsAutofillManaged(); |
445 } | 449 } |
446 | 450 |
| 451 /** |
| 452 * @return Whether to offer the Wallet import feature. |
| 453 */ |
| 454 public static boolean isWalletImportFeatureAvailable() { |
| 455 return nativeIsWalletImportFeatureAvailable(); |
| 456 } |
| 457 |
| 458 /** |
| 459 * @return Whether the Wallet import feature is enabled. |
| 460 */ |
| 461 public static boolean isWalletImportEnabled() { |
| 462 return nativeIsWalletImportEnabled(); |
| 463 } |
| 464 |
| 465 /** |
| 466 * Enables or disables the Autofill Wallet integration. |
| 467 * @param enable True to enable Wallet data import. |
| 468 */ |
| 469 public static void setWalletImportEnabled(boolean enable) { |
| 470 nativeSetWalletImportEnabled(enable); |
| 471 } |
| 472 |
447 private native long nativeInit(); | 473 private native long nativeInit(); |
448 private native int nativeGetProfileCount(long nativePersonalDataManagerAndro
id); | 474 private native int nativeGetProfileCount(long nativePersonalDataManagerAndro
id); |
449 private native String[] nativeGetProfileLabels(long nativePersonalDataManage
rAndroid); | 475 private native String[] nativeGetProfileLabels(long nativePersonalDataManage
rAndroid); |
450 private native AutofillProfile nativeGetProfileByIndex(long nativePersonalDa
taManagerAndroid, | 476 private native AutofillProfile nativeGetProfileByIndex(long nativePersonalDa
taManagerAndroid, |
451 int index); | 477 int index); |
452 private native AutofillProfile nativeGetProfileByGUID(long nativePersonalDat
aManagerAndroid, | 478 private native AutofillProfile nativeGetProfileByGUID(long nativePersonalDat
aManagerAndroid, |
453 String guid); | 479 String guid); |
454 private native String nativeSetProfile(long nativePersonalDataManagerAndroid
, | 480 private native String nativeSetProfile(long nativePersonalDataManagerAndroid
, |
455 AutofillProfile profile); | 481 AutofillProfile profile); |
456 private native int nativeGetCreditCardCount(long nativePersonalDataManagerAn
droid); | 482 private native int nativeGetCreditCardCount(long nativePersonalDataManagerAn
droid); |
457 private native CreditCard nativeGetCreditCardByIndex(long nativePersonalData
ManagerAndroid, | 483 private native CreditCard nativeGetCreditCardByIndex(long nativePersonalData
ManagerAndroid, |
458 int index); | 484 int index); |
459 private native CreditCard nativeGetCreditCardByGUID(long nativePersonalDataM
anagerAndroid, | 485 private native CreditCard nativeGetCreditCardByGUID(long nativePersonalDataM
anagerAndroid, |
460 String guid); | 486 String guid); |
461 private native String nativeSetCreditCard(long nativePersonalDataManagerAndr
oid, | 487 private native String nativeSetCreditCard(long nativePersonalDataManagerAndr
oid, |
462 CreditCard card); | 488 CreditCard card); |
463 private native void nativeRemoveByGUID(long nativePersonalDataManagerAndroid
, String guid); | 489 private native void nativeRemoveByGUID(long nativePersonalDataManagerAndroid
, String guid); |
| 490 private native void nativeClearUnmaskedCache(long nativePersonalDataManagerA
ndroid); |
464 private static native boolean nativeIsAutofillEnabled(); | 491 private static native boolean nativeIsAutofillEnabled(); |
465 private static native void nativeSetAutofillEnabled(boolean enable); | 492 private static native void nativeSetAutofillEnabled(boolean enable); |
466 private static native boolean nativeIsAutofillManaged(); | 493 private static native boolean nativeIsAutofillManaged(); |
| 494 private static native boolean nativeIsWalletImportFeatureAvailable(); |
| 495 private static native boolean nativeIsWalletImportEnabled(); |
| 496 private static native void nativeSetWalletImportEnabled(boolean enable); |
467 private static native String nativeToCountryCode(String countryName); | 497 private static native String nativeToCountryCode(String countryName); |
468 } | 498 } |
OLD | NEW |