| 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 #include "chrome/browser/ui/android/autofill/card_unmask_prompt_view_android.h" | 5 #include "chrome/browser/ui/android/autofill/card_unmask_prompt_view_android.h" |
| 6 | 6 |
| 7 #include "chrome/browser/ui/autofill/card_unmask_prompt_controller.h" | 7 #include "chrome/browser/ui/autofill/card_unmask_prompt_controller.h" |
| 8 #include "content/public/browser/web_contents.h" | 8 #include "content/public/browser/web_contents.h" |
| 9 #include "jni/CardUnmaskBridge_jni.h" | 9 #include "jni/CardUnmaskBridge_jni.h" |
| 10 #include "ui/base/android/view_android.h" | 10 #include "ui/base/android/view_android.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 jobject obj, | 53 jobject obj, |
| 54 jstring response) { | 54 jstring response) { |
| 55 return controller_->InputTextIsValid( | 55 return controller_->InputTextIsValid( |
| 56 base::android::ConvertJavaStringToUTF16(env, response)); | 56 base::android::ConvertJavaStringToUTF16(env, response)); |
| 57 } | 57 } |
| 58 | 58 |
| 59 void CardUnmaskPromptViewAndroid::OnUserInput(JNIEnv* env, | 59 void CardUnmaskPromptViewAndroid::OnUserInput(JNIEnv* env, |
| 60 jobject obj, | 60 jobject obj, |
| 61 jstring response) { | 61 jstring response) { |
| 62 controller_->OnUnmaskResponse( | 62 controller_->OnUnmaskResponse( |
| 63 base::android::ConvertJavaStringToUTF16(env, response)); | 63 base::android::ConvertJavaStringToUTF16(env, response), |
| 64 base::string16(), |
| 65 base::string16()); |
| 64 } | 66 } |
| 65 | 67 |
| 66 void CardUnmaskPromptViewAndroid::PromptDismissed(JNIEnv* env, jobject obj) { | 68 void CardUnmaskPromptViewAndroid::PromptDismissed(JNIEnv* env, jobject obj) { |
| 67 delete this; | 69 delete this; |
| 68 } | 70 } |
| 69 | 71 |
| 70 void CardUnmaskPromptViewAndroid::ControllerGone() { | 72 void CardUnmaskPromptViewAndroid::ControllerGone() { |
| 71 controller_ = nullptr; | 73 controller_ = nullptr; |
| 72 JNIEnv* env = base::android::AttachCurrentThread(); | 74 JNIEnv* env = base::android::AttachCurrentThread(); |
| 73 Java_CardUnmaskBridge_dismiss(env, java_object_.obj()); | 75 Java_CardUnmaskBridge_dismiss(env, java_object_.obj()); |
| 74 } | 76 } |
| 75 | 77 |
| 76 void CardUnmaskPromptViewAndroid::DisableAndWaitForVerification() { | 78 void CardUnmaskPromptViewAndroid::DisableAndWaitForVerification() { |
| 77 JNIEnv* env = base::android::AttachCurrentThread(); | 79 JNIEnv* env = base::android::AttachCurrentThread(); |
| 78 Java_CardUnmaskBridge_disableAndWaitForVerification(env, java_object_.obj()); | 80 Java_CardUnmaskBridge_disableAndWaitForVerification(env, java_object_.obj()); |
| 79 } | 81 } |
| 80 | 82 |
| 81 void CardUnmaskPromptViewAndroid::GotVerificationResult(bool success) { | 83 void CardUnmaskPromptViewAndroid::GotVerificationResult(bool success) { |
| 82 JNIEnv* env = base::android::AttachCurrentThread(); | 84 JNIEnv* env = base::android::AttachCurrentThread(); |
| 83 Java_CardUnmaskBridge_verificationFinished(env, java_object_.obj(), success); | 85 Java_CardUnmaskBridge_verificationFinished(env, java_object_.obj(), success); |
| 84 } | 86 } |
| 85 | 87 |
| 86 // static | 88 // static |
| 87 bool CardUnmaskPromptViewAndroid::Register(JNIEnv* env) { | 89 bool CardUnmaskPromptViewAndroid::Register(JNIEnv* env) { |
| 88 return RegisterNativesImpl(env); | 90 return RegisterNativesImpl(env); |
| 89 } | 91 } |
| 90 | 92 |
| 91 } // namespace autofill | 93 } // namespace autofill |
| OLD | NEW |