| 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_CREDIT_CARD_SCANNER_VIEW_ANDROID_H_ | 5 #ifndef CHROME_BROWSER_UI_ANDROID_AUTOFILL_CREDIT_CARD_SCANNER_VIEW_ANDROID_H_ |
| 6 #define CHROME_BROWSER_UI_ANDROID_AUTOFILL_CREDIT_CARD_SCANNER_VIEW_ANDROID_H_ | 6 #define CHROME_BROWSER_UI_ANDROID_AUTOFILL_CREDIT_CARD_SCANNER_VIEW_ANDROID_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 | 9 |
| 10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 public: | 26 public: |
| 27 // Registers with JNI services. | 27 // Registers with JNI services. |
| 28 static bool Register(JNIEnv* env); | 28 static bool Register(JNIEnv* env); |
| 29 | 29 |
| 30 CreditCardScannerViewAndroid( | 30 CreditCardScannerViewAndroid( |
| 31 const base::WeakPtr<CreditCardScannerViewDelegate>& delegate, | 31 const base::WeakPtr<CreditCardScannerViewDelegate>& delegate, |
| 32 content::WebContents* web_contents); | 32 content::WebContents* web_contents); |
| 33 ~CreditCardScannerViewAndroid() override; | 33 ~CreditCardScannerViewAndroid() override; |
| 34 | 34 |
| 35 // Called by JNI when user cancelled credit card scan. | 35 // Called by JNI when user cancelled credit card scan. |
| 36 void ScanCancelled(JNIEnv* env, jobject object); | 36 void ScanCancelled(JNIEnv* env, |
| 37 const base::android::JavaParamRef<jobject>& object); |
| 37 | 38 |
| 38 // Called by JNI when credit card scan completed successfully. | 39 // Called by JNI when credit card scan completed successfully. |
| 39 void ScanCompleted(JNIEnv* env, | 40 void ScanCompleted(JNIEnv* env, |
| 40 jobject object, | 41 const base::android::JavaParamRef<jobject>& object, |
| 41 jstring card_number, | 42 const base::android::JavaParamRef<jstring>& card_number, |
| 42 jint expiration_month, | 43 jint expiration_month, |
| 43 jint expiration_year); | 44 jint expiration_year); |
| 45 |
| 44 private: | 46 private: |
| 45 // CreditCardScannerView implementation. | 47 // CreditCardScannerView implementation. |
| 46 void Show() override; | 48 void Show() override; |
| 47 | 49 |
| 48 // The object to be notified when scanning was cancelled or completed. | 50 // The object to be notified when scanning was cancelled or completed. |
| 49 base::WeakPtr<CreditCardScannerViewDelegate> delegate_; | 51 base::WeakPtr<CreditCardScannerViewDelegate> delegate_; |
| 50 | 52 |
| 51 // The corresponding Java object that uses Android APIs for scanning. | 53 // The corresponding Java object that uses Android APIs for scanning. |
| 52 base::android::ScopedJavaGlobalRef<jobject> java_object_; | 54 base::android::ScopedJavaGlobalRef<jobject> java_object_; |
| 53 | 55 |
| 54 DISALLOW_COPY_AND_ASSIGN(CreditCardScannerViewAndroid); | 56 DISALLOW_COPY_AND_ASSIGN(CreditCardScannerViewAndroid); |
| 55 }; | 57 }; |
| 56 | 58 |
| 57 } // namespace autofill | 59 } // namespace autofill |
| 58 | 60 |
| 59 #endif // CHROME_BROWSER_UI_ANDROID_AUTOFILL_CREDIT_CARD_SCANNER_VIEW_ANDROID_H
_ | 61 #endif // CHROME_BROWSER_UI_ANDROID_AUTOFILL_CREDIT_CARD_SCANNER_VIEW_ANDROID_H
_ |
| OLD | NEW |