cygprofile: increase timeouts to allow showing web contents
[chromium-blink-merge.git] / chrome / browser / ui / android / autofill / credit_card_scanner_view_android.h
blob8bfb3be651f21e22869f0c804cc36c5589d82d48
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
3 // found in the LICENSE file.
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_
8 #include <jni.h>
10 #include "base/android/scoped_java_ref.h"
11 #include "base/macros.h"
12 #include "base/memory/weak_ptr.h"
13 #include "chrome/browser/ui/autofill/credit_card_scanner_view.h"
15 namespace content {
16 class WebContents;
19 namespace autofill {
21 class CreditCardScannerViewDelegate;
23 // Android implementation of the view for credit card scanner UI. Uses Android
24 // APIs through JNI service.
25 class CreditCardScannerViewAndroid : public CreditCardScannerView {
26 public:
27 // Registers with JNI services.
28 static bool Register(JNIEnv* env);
30 CreditCardScannerViewAndroid(
31 const base::WeakPtr<CreditCardScannerViewDelegate>& delegate,
32 content::WebContents* web_contents);
33 ~CreditCardScannerViewAndroid() override;
35 // Called by JNI when user cancelled credit card scan.
36 void ScanCancelled(JNIEnv* env, jobject object);
38 // Called by JNI when credit card scan completed successfully.
39 void ScanCompleted(JNIEnv* env,
40 jobject object,
41 jstring card_number,
42 jint expiration_month,
43 jint expiration_year);
44 private:
45 // CreditCardScannerView implementation.
46 void Show() override;
48 // The object to be notified when scanning was cancelled or completed.
49 base::WeakPtr<CreditCardScannerViewDelegate> delegate_;
51 // The corresponding Java object that uses Android APIs for scanning.
52 base::android::ScopedJavaGlobalRef<jobject> java_object_;
54 DISALLOW_COPY_AND_ASSIGN(CreditCardScannerViewAndroid);
57 } // namespace autofill
59 #endif // CHROME_BROWSER_UI_ANDROID_AUTOFILL_CREDIT_CARD_SCANNER_VIEW_ANDROID_H_