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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_ANDROID_AUTOFILL_AUTOFILL_POPUP_VIEW_ANDROID_H_
6 #define CHROME_BROWSER_UI_ANDROID_AUTOFILL_AUTOFILL_POPUP_VIEW_ANDROID_H_
10 #include "base/android/scoped_java_ref.h"
11 #include "base/compiler_specific.h"
12 #include "chrome/browser/ui/autofill/autofill_popup_view.h"
20 class AutofillPopupController
;
22 class AutofillPopupViewAndroid
: public AutofillPopupView
{
24 explicit AutofillPopupViewAndroid(AutofillPopupController
* controller
);
26 // --------------------------------------------------------------------------
27 // Methods called from Java via JNI
28 // --------------------------------------------------------------------------
29 // Called when an autofill item was selected.
30 void SuggestionSelected(JNIEnv
* env
, jobject obj
, jint list_index
);
32 void DeletionRequested(JNIEnv
* env
, jobject obj
, jint list_index
);
34 void DeletionConfirmed(JNIEnv
* env
, jobject obj
);
36 void PopupDismissed(JNIEnv
* env
, jobject obj
);
38 static bool RegisterAutofillPopupViewAndroid(JNIEnv
* env
);
41 // AutofillPopupView implementation.
44 void InvalidateRow(size_t row
) override
;
45 void UpdateBoundsAndRedrawPopup() override
;
48 ~AutofillPopupViewAndroid() override
;
50 AutofillPopupController
* controller_
; // weak.
52 // The index of the last item the user long-pressed (they will be shown a
53 // confirmation dialog).
56 // The corresponding java object.
57 base::android::ScopedJavaGlobalRef
<jobject
> java_object_
;
59 DISALLOW_COPY_AND_ASSIGN(AutofillPopupViewAndroid
);
62 } // namespace autofill
64 #endif // CHROME_BROWSER_UI_ANDROID_AUTOFILL_AUTOFILL_POPUP_VIEW_ANDROID_H_