Chromium Code Reviews| 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/optional.h" | |
|
sky
2017/03/20 15:50:32
The use of optional comes from chrome/browser/ui/a
csashi
2017/03/20 18:11:42
Can you confirm we don't do IWYU in chrome?
"""
F
sky
2017/03/20 20:10:49
When I asked the other members of my office of thi
| |
| 15 #include "chrome/browser/ui/autofill/autofill_popup_view.h" | 16 #include "chrome/browser/ui/autofill/autofill_popup_view.h" |
| 16 | 17 |
| 17 namespace autofill { | 18 namespace autofill { |
| 18 | 19 |
| 19 class AutofillPopupController; | 20 class AutofillPopupController; |
| 20 | 21 |
| 21 // A suggestion view that acts as an alternative to the field-attached popup | 22 // A suggestion view that acts as an alternative to the field-attached popup |
| 22 // window. This view appears above the keyboard and spans the width of the | 23 // window. This view appears above the keyboard and spans the width of the |
| 23 // screen, condensing rather than overlaying the content area. Enable via | 24 // screen, condensing rather than overlaying the content area. Enable via |
| 24 // --enable-autofill-keyboard-accessory-view. | 25 // --enable-autofill-keyboard-accessory-view. |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 43 | 44 |
| 44 void ViewDismissed(JNIEnv* env, | 45 void ViewDismissed(JNIEnv* env, |
| 45 const base::android::JavaParamRef<jobject>& obj); | 46 const base::android::JavaParamRef<jobject>& obj); |
| 46 | 47 |
| 47 static bool RegisterAutofillKeyboardAccessoryView(JNIEnv* env); | 48 static bool RegisterAutofillKeyboardAccessoryView(JNIEnv* env); |
| 48 | 49 |
| 49 protected: | 50 protected: |
| 50 // AutofillPopupView implementation. | 51 // AutofillPopupView implementation. |
| 51 void Show() override; | 52 void Show() override; |
| 52 void Hide() override; | 53 void Hide() override; |
| 53 void InvalidateRow(size_t row) override; | 54 void OnSelectedRowChanged( |
| 54 void UpdateBoundsAndRedrawPopup() override; | 55 base::Optional<int> previous_row_selection, |
| 56 base::Optional<int> current_row_selection) override {} | |
|
sky
2017/03/20 15:50:32
Don't inline overrides (see chromium style guide).
csashi
2017/03/20 18:11:42
Done.
| |
| 57 void OnSuggestionsChanged() override; | |
| 55 | 58 |
| 56 private: | 59 private: |
| 57 ~AutofillKeyboardAccessoryView() override; | 60 ~AutofillKeyboardAccessoryView() override; |
| 58 | 61 |
| 59 AutofillPopupController* controller_; // weak. | 62 AutofillPopupController* controller_; // weak. |
| 60 | 63 |
| 61 // The index of the last item the user long-pressed (they will be shown a | 64 // The index of the last item the user long-pressed (they will be shown a |
| 62 // confirmation dialog). | 65 // confirmation dialog). |
| 63 int deleting_index_; | 66 int deleting_index_; |
| 64 | 67 |
| 65 // Mapping from Java list index to autofill suggestion index. | 68 // Mapping from Java list index to autofill suggestion index. |
| 66 std::vector<int> positions_; | 69 std::vector<int> positions_; |
| 67 | 70 |
| 68 // The corresponding java object. | 71 // The corresponding java object. |
| 69 base::android::ScopedJavaGlobalRef<jobject> java_object_; | 72 base::android::ScopedJavaGlobalRef<jobject> java_object_; |
| 70 | 73 |
| 71 DISALLOW_COPY_AND_ASSIGN(AutofillKeyboardAccessoryView); | 74 DISALLOW_COPY_AND_ASSIGN(AutofillKeyboardAccessoryView); |
| 72 }; | 75 }; |
| 73 | 76 |
| 74 } // namespace autofill | 77 } // namespace autofill |
| 75 | 78 |
| 76 #endif // CHROME_BROWSER_UI_ANDROID_AUTOFILL_AUTOFILL_KEYBOARD_ACCESSORY_VIEW_H _ | 79 #endif // CHROME_BROWSER_UI_ANDROID_AUTOFILL_AUTOFILL_KEYBOARD_ACCESSORY_VIEW_H _ |
| OLD | NEW |