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