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. | 27 // Called when an autofill item was selected. TODO(estade): remove |name| and |
| 28 // |unique_id|. |
28 void SuggestionSelected(JNIEnv* env, | 29 void SuggestionSelected(JNIEnv* env, |
29 jobject obj, | 30 jobject obj, |
30 jint list_index, | 31 jint list_index, |
31 jstring value, | 32 jstring name, |
32 jint unique_id); | 33 jint unique_id); |
33 | 34 |
34 void Dismissed(JNIEnv *env, jobject obj); | 35 void Dismissed(JNIEnv *env, jobject obj); |
35 | 36 |
36 static bool RegisterAutofillPopupViewAndroid(JNIEnv* env); | 37 static bool RegisterAutofillPopupViewAndroid(JNIEnv* env); |
37 | 38 |
38 protected: | 39 protected: |
39 // AutofillPopupView implementation. | 40 // AutofillPopupView implementation. |
40 virtual void Show() OVERRIDE; | 41 virtual void Show() OVERRIDE; |
41 virtual void Hide() OVERRIDE; | 42 virtual void Hide() OVERRIDE; |
42 virtual void InvalidateRow(size_t row) OVERRIDE; | 43 virtual void InvalidateRow(size_t row) OVERRIDE; |
43 virtual void UpdateBoundsAndRedrawPopup() OVERRIDE; | 44 virtual void UpdateBoundsAndRedrawPopup() OVERRIDE; |
44 | 45 |
45 private: | 46 private: |
46 virtual ~AutofillPopupViewAndroid(); | 47 virtual ~AutofillPopupViewAndroid(); |
47 | 48 |
48 AutofillPopupController* controller_; // weak. | 49 AutofillPopupController* controller_; // weak. |
49 | 50 |
50 // The corresponding java object. | 51 // The corresponding java object. |
51 base::android::ScopedJavaGlobalRef<jobject> java_object_; | 52 base::android::ScopedJavaGlobalRef<jobject> java_object_; |
52 | 53 |
53 DISALLOW_COPY_AND_ASSIGN(AutofillPopupViewAndroid); | 54 DISALLOW_COPY_AND_ASSIGN(AutofillPopupViewAndroid); |
54 }; | 55 }; |
55 | 56 |
56 #endif // CHROME_BROWSER_UI_ANDROID_AUTOFILL_AUTOFILL_POPUP_VIEW_ANDROID_H_ | 57 #endif // CHROME_BROWSER_UI_ANDROID_AUTOFILL_AUTOFILL_POPUP_VIEW_ANDROID_H_ |
OLD | NEW |