| 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" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 class AutofillPopupViewAndroid : public AutofillPopupView { | 22 class AutofillPopupViewAndroid : public AutofillPopupView { |
| 23 public: | 23 public: |
| 24 explicit AutofillPopupViewAndroid(AutofillPopupController* controller); | 24 explicit AutofillPopupViewAndroid(AutofillPopupController* controller); |
| 25 | 25 |
| 26 // -------------------------------------------------------------------------- | 26 // -------------------------------------------------------------------------- |
| 27 // Methods called from Java via JNI | 27 // Methods called from Java via JNI |
| 28 // -------------------------------------------------------------------------- | 28 // -------------------------------------------------------------------------- |
| 29 // Called when an autofill item was selected. | 29 // Called when an autofill item was selected. |
| 30 void SuggestionSelected(JNIEnv* env, jobject obj, jint list_index); | 30 void SuggestionSelected(JNIEnv* env, jobject obj, jint list_index); |
| 31 | 31 |
| 32 void DeletionRequested(JNIEnv* env, jobject obj, jint list_index); |
| 33 |
| 34 void DeletionConfirmed(JNIEnv* env, jobject obj); |
| 35 |
| 32 void PopupDismissed(JNIEnv* env, jobject obj); | 36 void PopupDismissed(JNIEnv* env, jobject obj); |
| 33 | 37 |
| 34 static bool RegisterAutofillPopupViewAndroid(JNIEnv* env); | 38 static bool RegisterAutofillPopupViewAndroid(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 ~AutofillPopupViewAndroid() override; |
| 45 | 49 |
| 46 AutofillPopupController* controller_; // weak. | 50 AutofillPopupController* controller_; // weak. |
| 47 | 51 |
| 52 // The index of the last item the user long-pressed (they will be shown a |
| 53 // confirmation dialog). |
| 54 int deleting_index_; |
| 55 |
| 48 // The corresponding java object. | 56 // The corresponding java object. |
| 49 base::android::ScopedJavaGlobalRef<jobject> java_object_; | 57 base::android::ScopedJavaGlobalRef<jobject> java_object_; |
| 50 | 58 |
| 51 DISALLOW_COPY_AND_ASSIGN(AutofillPopupViewAndroid); | 59 DISALLOW_COPY_AND_ASSIGN(AutofillPopupViewAndroid); |
| 52 }; | 60 }; |
| 53 | 61 |
| 54 } // namespace autofill | 62 } // namespace autofill |
| 55 | 63 |
| 56 #endif // CHROME_BROWSER_UI_ANDROID_AUTOFILL_AUTOFILL_POPUP_VIEW_ANDROID_H_ | 64 #endif // CHROME_BROWSER_UI_ANDROID_AUTOFILL_AUTOFILL_POPUP_VIEW_ANDROID_H_ |
| OLD | NEW |