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_KEYBOARD_ACCESSORY_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_ANDROID_AUTOFILL_AUTOFILL_KEYBOARD_ACCESSORY_VIEW_H_ |
6 #define CHROME_BROWSER_UI_ANDROID_AUTOFILL_AUTOFILL_KEYBOARD_ACCESSORY_VIEW_H_ | 6 #define CHROME_BROWSER_UI_ANDROID_AUTOFILL_AUTOFILL_KEYBOARD_ACCESSORY_VIEW_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 #include <stddef.h> | 9 #include <stddef.h> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/android/scoped_java_ref.h" | 12 #include "base/android/scoped_java_ref.h" |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "chrome/browser/ui/autofill/autofill_popup_view.h" | 15 #include "chrome/browser/ui/autofill/autofill_popup_view.h" |
| 16 #include "chrome/browser/ui/autofill/autofill_popup_view_helper.h" |
16 | 17 |
17 namespace gfx { | 18 namespace gfx { |
18 class Rect; | 19 class Rect; |
19 } | 20 } |
20 | 21 |
21 namespace autofill { | 22 namespace autofill { |
22 | 23 |
23 class AutofillPopupController; | 24 class AutofillPopupController; |
24 | 25 |
25 // A suggestion view that acts as an alternative to the field-attached popup | 26 // A suggestion view that acts as an alternative to the field-attached popup |
(...skipping 23 matching lines...) Expand all Loading... |
49 const base::android::JavaParamRef<jobject>& obj); | 50 const base::android::JavaParamRef<jobject>& obj); |
50 | 51 |
51 static bool RegisterAutofillKeyboardAccessoryView(JNIEnv* env); | 52 static bool RegisterAutofillKeyboardAccessoryView(JNIEnv* env); |
52 | 53 |
53 protected: | 54 protected: |
54 // AutofillPopupView implementation. | 55 // AutofillPopupView implementation. |
55 void Show() override; | 56 void Show() override; |
56 void Hide() override; | 57 void Hide() override; |
57 void InvalidateRow(size_t row) override; | 58 void InvalidateRow(size_t row) override; |
58 void UpdateBoundsAndRedrawPopup() override; | 59 void UpdateBoundsAndRedrawPopup() override; |
| 60 int LineFromY(int y) override; |
| 61 gfx::Rect GetPopupBounds() override; |
59 | 62 |
60 private: | 63 private: |
61 ~AutofillKeyboardAccessoryView() override; | 64 ~AutofillKeyboardAccessoryView() override; |
62 | 65 |
| 66 AutofillPopupViewHelper view_helper_; |
| 67 |
63 AutofillPopupController* controller_; // weak. | 68 AutofillPopupController* controller_; // weak. |
64 | 69 |
65 // The index of the last item the user long-pressed (they will be shown a | 70 // The index of the last item the user long-pressed (they will be shown a |
66 // confirmation dialog). | 71 // confirmation dialog). |
67 int deleting_index_; | 72 int deleting_index_; |
68 | 73 |
69 // Mapping from Java list index to autofill suggestion index. | 74 // Mapping from Java list index to autofill suggestion index. |
70 std::vector<int> positions_; | 75 std::vector<int> positions_; |
71 | 76 |
72 // The corresponding java object. | 77 // The corresponding java object. |
73 base::android::ScopedJavaGlobalRef<jobject> java_object_; | 78 base::android::ScopedJavaGlobalRef<jobject> java_object_; |
74 | 79 |
75 DISALLOW_COPY_AND_ASSIGN(AutofillKeyboardAccessoryView); | 80 DISALLOW_COPY_AND_ASSIGN(AutofillKeyboardAccessoryView); |
76 }; | 81 }; |
77 | 82 |
78 } // namespace autofill | 83 } // namespace autofill |
79 | 84 |
80 #endif // CHROME_BROWSER_UI_ANDROID_AUTOFILL_AUTOFILL_KEYBOARD_ACCESSORY_VIEW_H
_ | 85 #endif // CHROME_BROWSER_UI_ANDROID_AUTOFILL_AUTOFILL_KEYBOARD_ACCESSORY_VIEW_H
_ |
OLD | NEW |