| Index: chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillDialogResult.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillDialogResult.java b/chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillDialogResult.java
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..cf46313bfc9a1cb7cfb6add100f428148439c06d
|
| --- /dev/null
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillDialogResult.java
|
| @@ -0,0 +1,232 @@
|
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +package org.chromium.chrome.browser.autofill;
|
| +
|
| +import org.chromium.base.CalledByNative;
|
| +import org.chromium.base.JNINamespace;
|
| +
|
| +
|
| +/**
|
| +* JNI call glue for AutofillDialog C++ and Java objects.
|
| +*/
|
| +@JNINamespace("autofill")
|
| +public class AutofillDialogResult {
|
| + public static class ResultCard {
|
| + private final int mExpirationMonth;
|
| + private final int mExpirationYear;
|
| + private final String mPan;
|
| + private final String mCvn;
|
| +
|
| + public ResultCard(int expirationMonth, int expirationYear, String pan, String cvn) {
|
| + mExpirationMonth = expirationMonth;
|
| + mExpirationYear = expirationYear;
|
| + mPan = pan;
|
| + mCvn = cvn;
|
| + }
|
| +
|
| + public int getExpirationMonth() {
|
| + return mExpirationMonth;
|
| + }
|
| +
|
| + public int getExpirationYear() {
|
| + return mExpirationYear;
|
| + }
|
| +
|
| + public String getPan() {
|
| + return mPan;
|
| + }
|
| +
|
| + public String getCvn() {
|
| + return mCvn;
|
| + }
|
| + }
|
| +
|
| + public static class ResultAddress {
|
| + private final String mName;
|
| + private final String mPhoneNumber;
|
| + private final String mAddress1;
|
| + private final String mAddress2;
|
| + private final String mCity;
|
| + private final String mState;
|
| + private final String mPostalCode;
|
| + private final String mCountryCode;
|
| +
|
| + public ResultAddress(
|
| + String name, String phoneNumber,
|
| + String address1, String address2,
|
| + String city, String state, String postalCode,
|
| + String countryCode) {
|
| + mName = name;
|
| + mPhoneNumber = phoneNumber;
|
| + mAddress1 = address1;
|
| + mAddress2 = address2;
|
| + mCity = city;
|
| + mState = state;
|
| + mPostalCode = postalCode;
|
| + mCountryCode = countryCode;
|
| + }
|
| +
|
| + public String getName() {
|
| + return mName;
|
| + }
|
| +
|
| + public String getPhoneNumber() {
|
| + return mPhoneNumber;
|
| + }
|
| +
|
| + public String getAddress1() {
|
| + return mAddress1;
|
| + }
|
| +
|
| + public String getAddress2() {
|
| + return mAddress2;
|
| + }
|
| +
|
| + public String getCity() {
|
| + return mCity;
|
| + }
|
| +
|
| + public String getState() {
|
| + return mState;
|
| + }
|
| +
|
| + public String getPostalCode() {
|
| + return mPostalCode;
|
| + }
|
| +
|
| + public String getCountryCode() {
|
| + return mCountryCode;
|
| + }
|
| + }
|
| +
|
| + public static class ResultWallet {
|
| + private final String mEmail;
|
| + private final String mGoogleTransactionId;
|
| + private final ResultCard mCard;
|
| + private final ResultAddress mBillingAddress;
|
| + private final ResultAddress mShippingAddress;
|
| +
|
| + public ResultWallet(
|
| + String email, String googleTransactionId,
|
| + ResultCard card, ResultAddress billingAddress, ResultAddress shippingAddress) {
|
| + mEmail = email;
|
| + mGoogleTransactionId = googleTransactionId;
|
| + mCard = card;
|
| + mBillingAddress = billingAddress;
|
| + mShippingAddress = shippingAddress;
|
| + }
|
| +
|
| + public String getEmail() {
|
| + return mEmail;
|
| + }
|
| +
|
| + public String getGoogleTransactionId() {
|
| + return mGoogleTransactionId;
|
| + }
|
| +
|
| + public ResultCard getCard() {
|
| + return mCard;
|
| + }
|
| +
|
| + public ResultAddress getBillingAddress() {
|
| + return mBillingAddress;
|
| + }
|
| +
|
| + public ResultAddress getShippingAddress() {
|
| + return mShippingAddress;
|
| + }
|
| + }
|
| +
|
| + // JNI ResultWallet.
|
| +
|
| + @CalledByNative
|
| + private static String getWalletEmail(Object fullWallet) {
|
| + return((ResultWallet) fullWallet).getEmail();
|
| + }
|
| +
|
| + @CalledByNative
|
| + private static String getWalletGoogleTransactionId(Object fullWallet) {
|
| + return ((ResultWallet) fullWallet).getGoogleTransactionId();
|
| + }
|
| +
|
| + @CalledByNative
|
| + private static Object getWalletBillingAddress(Object fullWallet) {
|
| + return ((ResultWallet) fullWallet).getBillingAddress();
|
| + }
|
| +
|
| + @CalledByNative
|
| + private static Object getWalletShippingAddress(Object fullWallet) {
|
| + return ((ResultWallet) fullWallet).getShippingAddress();
|
| + }
|
| +
|
| + @CalledByNative
|
| + private static Object getWalletCardInformation(Object fullWallet) {
|
| + return ((ResultWallet) fullWallet).getCard();
|
| + }
|
| +
|
| + // JNI ResultAddress.
|
| +
|
| + @CalledByNative
|
| + private static String getWalletAddressLine1(Object address) {
|
| + return ((ResultAddress) address).getAddress1();
|
| + }
|
| +
|
| + @CalledByNative
|
| + private static String getWalletAddressLine2(Object address) {
|
| + return ((ResultAddress) address).getAddress2();
|
| + }
|
| +
|
| + @CalledByNative
|
| + private static String getWalletAddressCity(Object address) {
|
| + return ((ResultAddress) address).getCity();
|
| + }
|
| +
|
| + @CalledByNative
|
| + private static String getWalletAddressState(Object address) {
|
| + return ((ResultAddress) address).getState();
|
| + }
|
| +
|
| + @CalledByNative
|
| + private static String getWalletAddressPostalCode(Object address) {
|
| + return ((ResultAddress) address).getPostalCode();
|
| + }
|
| +
|
| + @CalledByNative
|
| + private static String getWalletAddressCountryCode(Object address) {
|
| + return ((ResultAddress) address).getCountryCode();
|
| + }
|
| +
|
| + @CalledByNative
|
| + private static String getWalletAddressPhoneNumber(Object address) {
|
| + return ((ResultAddress) address).getPhoneNumber();
|
| + }
|
| +
|
| + @CalledByNative
|
| + private static String getWalletAddressFullName(Object address) {
|
| + return ((ResultAddress) address).getName();
|
| + }
|
| +
|
| + // JNI ResultCard.
|
| +
|
| + @CalledByNative
|
| + private static int getWalletCardExpirationMonth(Object card) {
|
| + return ((ResultCard) card).getExpirationMonth();
|
| + }
|
| +
|
| + @CalledByNative
|
| + private static int getWalletCardExpirationYear(Object card) {
|
| + return ((ResultCard) card).getExpirationYear();
|
| + }
|
| +
|
| + @CalledByNative
|
| + private static String getWalletCardPan(Object card) {
|
| + return ((ResultCard) card).getPan();
|
| + }
|
| +
|
| + @CalledByNative
|
| + private static String getWalletCardCvn(Object card) {
|
| + return ((ResultCard) card).getCvn();
|
| + }
|
| +}
|
|
|