1 // Copyright 2019 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.
4 
5 #ifndef CHROME_BROWSER_ANDROID_AUTOFILL_ASSISTANT_ASSISTANT_FORM_DELEGATE_H_
6 #define CHROME_BROWSER_ANDROID_AUTOFILL_ASSISTANT_ASSISTANT_FORM_DELEGATE_H_
7 
8 #include "base/android/scoped_java_ref.h"
9 
10 namespace autofill_assistant {
11 class UiControllerAndroid;
12 // Delegate class for the assistant form.
13 class AssistantFormDelegate {
14  public:
15   explicit AssistantFormDelegate(UiControllerAndroid* ui_controller);
16   ~AssistantFormDelegate();
17 
18   void OnCounterChanged(JNIEnv* env,
19                         const base::android::JavaParamRef<jobject>& jcaller,
20                         jint input_index,
21                         jint counter_index,
22                         jint value);
23 
24   void OnChoiceSelectionChanged(
25       JNIEnv* env,
26       const base::android::JavaParamRef<jobject>& jcaller,
27       jint input_index,
28       jint choice_index,
29       jboolean selected);
30 
31   void OnLinkClicked(JNIEnv* env,
32                      const base::android::JavaParamRef<jobject>& jcaller,
33                      jint link);
34 
35   base::android::ScopedJavaGlobalRef<jobject> GetJavaObject();
36 
37  private:
38   UiControllerAndroid* ui_controller_;
39 
40   // Java-side AssistantFormDelegate object.
41   base::android::ScopedJavaGlobalRef<jobject> java_assistant_form_delegate_;
42 };
43 }  // namespace autofill_assistant
44 
45 #endif  // CHROME_BROWSER_ANDROID_AUTOFILL_ASSISTANT_ASSISTANT_FORM_DELEGATE_H_
46