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_KEYBOARD_ACCESSORY_VIEW_H_ |
6 #define CHROME_BROWSER_UI_ANDROID_AUTOFILL_AUTOFILL_POPUP_VIEW_ANDROID_H_ | 6 #define CHROME_BROWSER_UI_ANDROID_AUTOFILL_AUTOFILL_KEYBOARD_ACCESSORY_VIEW_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 namespace gfx { | 14 namespace gfx { |
15 class Rect; | 15 class Rect; |
16 } | 16 } |
17 | 17 |
18 namespace autofill { | 18 namespace autofill { |
19 | 19 |
20 class AutofillPopupController; | 20 class AutofillPopupController; |
21 | 21 |
22 class AutofillPopupViewAndroid : public AutofillPopupView { | 22 // A suggestion view that acts as an alternative to the field-attached popup |
| 23 // window. This view appears above the keyboard and spans the width of the |
| 24 // screen, condensing rather than overlaying the content area. Enable via |
| 25 // --enable-autofill-keyboard-accessory-view. |
| 26 class AutofillKeyboardAccessoryView : public AutofillPopupView { |
23 public: | 27 public: |
24 explicit AutofillPopupViewAndroid(AutofillPopupController* controller); | 28 explicit AutofillKeyboardAccessoryView(AutofillPopupController* controller); |
25 | 29 |
26 // -------------------------------------------------------------------------- | 30 // -------------------------------------------------------------------------- |
27 // Methods called from Java via JNI | 31 // Methods called from Java via JNI |
28 // -------------------------------------------------------------------------- | 32 // -------------------------------------------------------------------------- |
29 // Called when an autofill item was selected. | 33 // Called when an autofill item was selected. |
30 void SuggestionSelected(JNIEnv* env, jobject obj, jint list_index); | 34 void SuggestionSelected(JNIEnv* env, jobject obj, jint list_index); |
31 | 35 |
32 void PopupDismissed(JNIEnv* env, jobject obj); | 36 void ViewDismissed(JNIEnv* env, jobject obj); |
33 | 37 |
34 static bool RegisterAutofillPopupViewAndroid(JNIEnv* env); | 38 static bool RegisterAutofillKeyboardAccessoryView(JNIEnv* env); |
35 | 39 |
36 protected: | 40 protected: |
37 // AutofillPopupView implementation. | 41 // AutofillPopupView implementation. |
38 void Show() override; | 42 void Show() override; |
39 void Hide() override; | 43 void Hide() override; |
40 void InvalidateRow(size_t row) override; | 44 void InvalidateRow(size_t row) override; |
41 void UpdateBoundsAndRedrawPopup() override; | 45 void UpdateBoundsAndRedrawPopup() override; |
42 | 46 |
43 private: | 47 private: |
44 ~AutofillPopupViewAndroid() override; | 48 ~AutofillKeyboardAccessoryView() override; |
45 | 49 |
46 AutofillPopupController* controller_; // weak. | 50 AutofillPopupController* controller_; // weak. |
47 | 51 |
48 // The corresponding java object. | 52 // The corresponding java object. |
49 base::android::ScopedJavaGlobalRef<jobject> java_object_; | 53 base::android::ScopedJavaGlobalRef<jobject> java_object_; |
50 | 54 |
51 DISALLOW_COPY_AND_ASSIGN(AutofillPopupViewAndroid); | 55 DISALLOW_COPY_AND_ASSIGN(AutofillKeyboardAccessoryView); |
52 }; | 56 }; |
53 | 57 |
54 } // namespace autofill | 58 } // namespace autofill |
55 | 59 |
56 #endif // CHROME_BROWSER_UI_ANDROID_AUTOFILL_AUTOFILL_POPUP_VIEW_ANDROID_H_ | 60 #endif // CHROME_BROWSER_UI_ANDROID_AUTOFILL_AUTOFILL_KEYBOARD_ACCESSORY_VIEW_H
_ |
OLD | NEW |