OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 android.app.Activity; | 7 import android.app.Activity; |
8 import android.os.Handler; | 8 import android.os.Handler; |
9 | 9 |
10 import org.chromium.base.CalledByNative; | 10 import org.chromium.base.CalledByNative; |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 @Override | 60 @Override |
61 public boolean checkUserInputValidity(String userResponse) { | 61 public boolean checkUserInputValidity(String userResponse) { |
62 return nativeCheckUserInputValidity(mNativeCardUnmaskPromptViewAndroid,
userResponse); | 62 return nativeCheckUserInputValidity(mNativeCardUnmaskPromptViewAndroid,
userResponse); |
63 } | 63 } |
64 | 64 |
65 @Override | 65 @Override |
66 public void onUserInput(String cvc, String month, String year, boolean shoul
dStoreLocally) { | 66 public void onUserInput(String cvc, String month, String year, boolean shoul
dStoreLocally) { |
67 nativeOnUserInput(mNativeCardUnmaskPromptViewAndroid, cvc, month, year,
shouldStoreLocally); | 67 nativeOnUserInput(mNativeCardUnmaskPromptViewAndroid, cvc, month, year,
shouldStoreLocally); |
68 } | 68 } |
69 | 69 |
| 70 @Override |
| 71 public void onNewCardLinkClicked() { |
| 72 nativeOnNewCardLinkClicked(mNativeCardUnmaskPromptViewAndroid); |
| 73 } |
| 74 |
70 /** | 75 /** |
71 * Shows a prompt for unmasking a Wallet credit card. | 76 * Shows a prompt for unmasking a Wallet credit card. |
72 */ | 77 */ |
73 @CalledByNative | 78 @CalledByNative |
74 private void show() { | 79 private void show() { |
75 if (mCardUnmaskPrompt != null) mCardUnmaskPrompt.show(); | 80 if (mCardUnmaskPrompt != null) mCardUnmaskPrompt.show(); |
76 } | 81 } |
77 | 82 |
78 /** | 83 /** |
| 84 * After a prompt is already showing, update some UI elements. |
| 85 * @param title The dialog title. |
| 86 * @param instructions Expository text. |
| 87 * @param shouldRequestExpirationDate Whether to show the Update + Verify UI
or just the |
| 88 * Verify UI. |
| 89 */ |
| 90 @CalledByNative |
| 91 private void update(String title, String instructions, boolean shouldRequest
ExpirationDate) { |
| 92 if (mCardUnmaskPrompt != null) { |
| 93 mCardUnmaskPrompt.update(title, instructions, shouldRequestExpiratio
nDate); |
| 94 } |
| 95 } |
| 96 |
| 97 /** |
79 * Dismisses the prompt without returning any user response. | 98 * Dismisses the prompt without returning any user response. |
80 */ | 99 */ |
81 @CalledByNative | 100 @CalledByNative |
82 private void dismiss() { | 101 private void dismiss() { |
83 if (mCardUnmaskPrompt != null) mCardUnmaskPrompt.dismiss(); | 102 if (mCardUnmaskPrompt != null) mCardUnmaskPrompt.dismiss(); |
84 } | 103 } |
85 | 104 |
86 /** | 105 /** |
87 * Disables input and visually indicates that verification is ongoing. | 106 * Disables input and visually indicates that verification is ongoing. |
88 */ | 107 */ |
(...skipping 13 matching lines...) Expand all Loading... |
102 mCardUnmaskPrompt.verificationFinished(errorMessage, allowRetry); | 121 mCardUnmaskPrompt.verificationFinished(errorMessage, allowRetry); |
103 } | 122 } |
104 } | 123 } |
105 | 124 |
106 private native void nativePromptDismissed(long nativeCardUnmaskPromptViewAnd
roid); | 125 private native void nativePromptDismissed(long nativeCardUnmaskPromptViewAnd
roid); |
107 private native boolean nativeCheckUserInputValidity( | 126 private native boolean nativeCheckUserInputValidity( |
108 long nativeCardUnmaskPromptViewAndroid, String userResponse); | 127 long nativeCardUnmaskPromptViewAndroid, String userResponse); |
109 private native void nativeOnUserInput( | 128 private native void nativeOnUserInput( |
110 long nativeCardUnmaskPromptViewAndroid, String cvc, String month, St
ring year, | 129 long nativeCardUnmaskPromptViewAndroid, String cvc, String month, St
ring year, |
111 boolean shouldStoreLocally); | 130 boolean shouldStoreLocally); |
| 131 private native void nativeOnNewCardLinkClicked(long nativeCardUnmaskPromptVi
ewAndroid); |
112 } | 132 } |
OLD | NEW |