| Index: android_webview/native/aw_autofill_client.cc
|
| diff --git a/android_webview/native/aw_autofill_client.cc b/android_webview/native/aw_autofill_client.cc
|
| index be7a4ae631a3cf3c1b015ab91537482d51f9004f..481dfddc0d654ecadaaee5719733330f6b1dbf66 100644
|
| --- a/android_webview/native/aw_autofill_client.cc
|
| +++ b/android_webview/native/aw_autofill_client.cc
|
| @@ -20,10 +20,12 @@
|
| #include "components/prefs/pref_service.h"
|
| #include "components/prefs/pref_service_factory.h"
|
| #include "components/user_prefs/user_prefs.h"
|
| +#include "content/public/browser/android/content_view_core.h"
|
| #include "content/public/browser/navigation_entry.h"
|
| #include "content/public/browser/web_contents.h"
|
| #include "content/public/common/ssl_status.h"
|
| #include "jni/AwAutofillClient_jni.h"
|
| +#include "ui/android/view_android.h"
|
| #include "ui/gfx/geometry/rect_f.h"
|
|
|
| using base::android::AttachCurrentThread;
|
| @@ -135,13 +137,22 @@ void AwAutofillClient::ShowAutofillPopupImpl(
|
| env, data_array.obj(), i, name.obj(), label.obj(),
|
| suggestions[i].frontend_id);
|
| }
|
| + ui::ViewAndroid* view_android = web_contents_->GetNativeView();
|
| + if (!view_android)
|
| + return;
|
| +
|
| + const ScopedJavaLocalRef<jobject> current_view = anchor_view_.view();
|
| + if (current_view.is_null())
|
| + anchor_view_ = view_android->AcquireAnchorView();
|
| +
|
| + const ScopedJavaLocalRef<jobject> view = anchor_view_.view();
|
| + if (view.is_null())
|
| + return;
|
|
|
| + view_android->SetAnchorRect(view, element_bounds);
|
| Java_AwAutofillClient_showAutofillPopup(env,
|
| obj.obj(),
|
| - element_bounds.x(),
|
| - element_bounds.y(),
|
| - element_bounds.width(),
|
| - element_bounds.height(),
|
| + view.obj(),
|
| is_rtl,
|
| data_array.obj());
|
| }
|
| @@ -204,6 +215,11 @@ bool AwAutofillClient::ShouldShowSigninPromo() {
|
|
|
| void AwAutofillClient::StartSigninFlow() {}
|
|
|
| +void AwAutofillClient::Dismissed(JNIEnv* env,
|
| + const JavaParamRef<jobject>& obj) {
|
| + anchor_view_.Reset();
|
| +}
|
| +
|
| void AwAutofillClient::SuggestionSelected(JNIEnv* env,
|
| const JavaParamRef<jobject>& object,
|
| jint position) {
|
|
|