| 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 #ifndef CHROME_BROWSER_UI_ANDROID_AUTOFILL_CARD_UNMASK_PROMPT_VIEW_ANDROID_H_ | 5 #ifndef CHROME_BROWSER_UI_ANDROID_AUTOFILL_CARD_UNMASK_PROMPT_VIEW_ANDROID_H_ |
| 6 #define CHROME_BROWSER_UI_ANDROID_AUTOFILL_CARD_UNMASK_PROMPT_VIEW_ANDROID_H_ | 6 #define CHROME_BROWSER_UI_ANDROID_AUTOFILL_CARD_UNMASK_PROMPT_VIEW_ANDROID_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 | 9 |
| 10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
| 11 #include "base/android/scoped_java_ref.h" | 11 #include "base/android/scoped_java_ref.h" |
| 12 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
| 13 #include "components/autofill/core/browser/ui/card_unmask_prompt_view.h" | 13 #include "components/autofill/core/browser/ui/card_unmask_prompt_view.h" |
| 14 | 14 |
| 15 namespace content { | 15 namespace content { |
| 16 class WebContents; | 16 class WebContents; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace autofill { | 19 namespace autofill { |
| 20 | 20 |
| 21 class CardUnmaskPromptViewAndroid : public CardUnmaskPromptView { | 21 class CardUnmaskPromptViewAndroid : public CardUnmaskPromptView { |
| 22 public: | 22 public: |
| 23 explicit CardUnmaskPromptViewAndroid(CardUnmaskPromptController* controller, | 23 explicit CardUnmaskPromptViewAndroid(CardUnmaskPromptController* controller, |
| 24 content::WebContents* web_contents); | 24 content::WebContents* web_contents); |
| 25 | 25 |
| 26 bool CheckUserInputValidity(JNIEnv* env, jobject obj, jstring response); | 26 bool CheckUserInputValidity( |
| 27 JNIEnv* env, |
| 28 const base::android::JavaParamRef<jobject>& obj, |
| 29 const base::android::JavaParamRef<jstring>& response); |
| 27 void OnUserInput(JNIEnv* env, | 30 void OnUserInput(JNIEnv* env, |
| 28 jobject obj, | 31 const base::android::JavaParamRef<jobject>& obj, |
| 29 jstring cvc, | 32 const base::android::JavaParamRef<jstring>& cvc, |
| 30 jstring month, | 33 const base::android::JavaParamRef<jstring>& month, |
| 31 jstring year, | 34 const base::android::JavaParamRef<jstring>& year, |
| 32 jboolean should_store_locally); | 35 jboolean should_store_locally); |
| 33 void OnNewCardLinkClicked(JNIEnv* env, jobject obj); | 36 void OnNewCardLinkClicked(JNIEnv* env, |
| 34 void PromptDismissed(JNIEnv* env, jobject obj); | 37 const base::android::JavaParamRef<jobject>& obj); |
| 38 void PromptDismissed(JNIEnv* env, |
| 39 const base::android::JavaParamRef<jobject>& obj); |
| 35 | 40 |
| 36 // CardUnmaskPromptView implementation. | 41 // CardUnmaskPromptView implementation. |
| 37 void Show() override; | 42 void Show() override; |
| 38 void ControllerGone() override; | 43 void ControllerGone() override; |
| 39 void DisableAndWaitForVerification() override; | 44 void DisableAndWaitForVerification() override; |
| 40 void GotVerificationResult(const base::string16& error_message, | 45 void GotVerificationResult(const base::string16& error_message, |
| 41 bool allow_retry) override; | 46 bool allow_retry) override; |
| 42 | 47 |
| 43 static bool Register(JNIEnv* env); | 48 static bool Register(JNIEnv* env); |
| 44 | 49 |
| 45 private: | 50 private: |
| 46 ~CardUnmaskPromptViewAndroid() override; | 51 ~CardUnmaskPromptViewAndroid() override; |
| 47 | 52 |
| 48 // The corresponding java object. | 53 // The corresponding java object. |
| 49 base::android::ScopedJavaGlobalRef<jobject> java_object_; | 54 base::android::ScopedJavaGlobalRef<jobject> java_object_; |
| 50 | 55 |
| 51 CardUnmaskPromptController* controller_; | 56 CardUnmaskPromptController* controller_; |
| 52 content::WebContents* web_contents_; | 57 content::WebContents* web_contents_; |
| 53 | 58 |
| 54 DISALLOW_COPY_AND_ASSIGN(CardUnmaskPromptViewAndroid); | 59 DISALLOW_COPY_AND_ASSIGN(CardUnmaskPromptViewAndroid); |
| 55 }; | 60 }; |
| 56 | 61 |
| 57 } // namespace autofill | 62 } // namespace autofill |
| 58 | 63 |
| 59 #endif // CHROME_BROWSER_UI_ANDROID_AUTOFILL_CARD_UNMASK_PROMPT_VIEW_ANDROID_H_ | 64 #endif // CHROME_BROWSER_UI_ANDROID_AUTOFILL_CARD_UNMASK_PROMPT_VIEW_ANDROID_H_ |
| OLD | NEW |