OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_AUTOFILL_POPUP_VIEW_ANDROID_H_ | 5 #ifndef CHROME_BROWSER_UI_ANDROID_AUTOFILL_AUTOFILL_POPUP_VIEW_ANDROID_H_ |
6 #define CHROME_BROWSER_UI_ANDROID_AUTOFILL_AUTOFILL_POPUP_VIEW_ANDROID_H_ | 6 #define CHROME_BROWSER_UI_ANDROID_AUTOFILL_AUTOFILL_POPUP_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" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "chrome/browser/ui/autofill/autofill_popup_view.h" | 12 #include "chrome/browser/ui/autofill/autofill_popup_view.h" |
13 | 13 |
14 class AutofillPopupController; | 14 class AutofillPopupController; |
15 | 15 |
16 namespace gfx { | 16 namespace gfx { |
17 class Rect; | 17 class Rect; |
18 } | 18 } |
19 | 19 |
20 class AutofillPopupViewAndroid : public AutofillPopupView { | 20 class AutofillPopupViewAndroid : public AutofillPopupView { |
21 public: | 21 public: |
22 explicit AutofillPopupViewAndroid(AutofillPopupController* controller); | 22 explicit AutofillPopupViewAndroid(AutofillPopupController* controller); |
23 | 23 |
24 // -------------------------------------------------------------------------- | 24 // -------------------------------------------------------------------------- |
25 // Methods called from Java via JNI | 25 // Methods called from Java via JNI |
26 // -------------------------------------------------------------------------- | 26 // -------------------------------------------------------------------------- |
27 // Called when an autofill item was selected. TODO(estade): remove |name| and | 27 // Called when an autofill item was selected. |
28 // |unique_id|. | 28 void SuggestionSelected(JNIEnv* env, jobject obj, jint list_index); |
29 void SuggestionSelected(JNIEnv* env, | |
30 jobject obj, | |
31 jint list_index, | |
32 jstring name, | |
33 jint unique_id); | |
34 | 29 |
35 void Dismissed(JNIEnv *env, jobject obj); | 30 void Dismissed(JNIEnv *env, jobject obj); |
36 | 31 |
37 static bool RegisterAutofillPopupViewAndroid(JNIEnv* env); | 32 static bool RegisterAutofillPopupViewAndroid(JNIEnv* env); |
38 | 33 |
39 protected: | 34 protected: |
40 // AutofillPopupView implementation. | 35 // AutofillPopupView implementation. |
41 virtual void Show() OVERRIDE; | 36 virtual void Show() OVERRIDE; |
42 virtual void Hide() OVERRIDE; | 37 virtual void Hide() OVERRIDE; |
43 virtual void InvalidateRow(size_t row) OVERRIDE; | 38 virtual void InvalidateRow(size_t row) OVERRIDE; |
44 virtual void UpdateBoundsAndRedrawPopup() OVERRIDE; | 39 virtual void UpdateBoundsAndRedrawPopup() OVERRIDE; |
45 | 40 |
46 private: | 41 private: |
47 virtual ~AutofillPopupViewAndroid(); | 42 virtual ~AutofillPopupViewAndroid(); |
48 | 43 |
49 AutofillPopupController* controller_; // weak. | 44 AutofillPopupController* controller_; // weak. |
50 | 45 |
51 // The corresponding java object. | 46 // The corresponding java object. |
52 base::android::ScopedJavaGlobalRef<jobject> java_object_; | 47 base::android::ScopedJavaGlobalRef<jobject> java_object_; |
53 | 48 |
54 DISALLOW_COPY_AND_ASSIGN(AutofillPopupViewAndroid); | 49 DISALLOW_COPY_AND_ASSIGN(AutofillPopupViewAndroid); |
55 }; | 50 }; |
56 | 51 |
57 #endif // CHROME_BROWSER_UI_ANDROID_AUTOFILL_AUTOFILL_POPUP_VIEW_ANDROID_H_ | 52 #endif // CHROME_BROWSER_UI_ANDROID_AUTOFILL_AUTOFILL_POPUP_VIEW_ANDROID_H_ |
OLD | NEW |