Index: chrome/browser/ui/android/autofill/password_generation_popup_view_android.cc |
diff --git a/chrome/browser/ui/android/autofill/password_generation_popup_view_android.cc b/chrome/browser/ui/android/autofill/password_generation_popup_view_android.cc |
index a0f48c64dd42dbb5412ee65323d26e9fada2def1..4e5bb839ae1533953a48d4a29fc156c8a5d8883e 100644 |
--- a/chrome/browser/ui/android/autofill/password_generation_popup_view_android.cc |
+++ b/chrome/browser/ui/android/autofill/password_generation_popup_view_android.cc |
@@ -61,8 +61,11 @@ void PasswordGenerationPopupViewAndroid::Show() { |
DCHECK(view_android); |
+ ScopedJavaLocalRef<jobject> anchor_view = |
+ view_android->AcquireAnchorView(controller_->element_bounds()); |
java_object_.Reset(Java_PasswordGenerationPopupBridge_create( |
- env, reinterpret_cast<intptr_t>(this), |
+ env, anchor_view.obj(), controller_->element_bounds().width(), |
+ reinterpret_cast<intptr_t>(this), |
view_android->GetWindowAndroid()->GetJavaObject().obj(), |
view_android->GetViewAndroidDelegate().obj())); |
@@ -82,14 +85,6 @@ gfx::Size PasswordGenerationPopupViewAndroid::GetPreferredSizeOfPasswordView() { |
void PasswordGenerationPopupViewAndroid::UpdateBoundsAndRedrawPopup() { |
JNIEnv* env = base::android::AttachCurrentThread(); |
- Java_PasswordGenerationPopupBridge_setAnchorRect( |
- env, |
- java_object_.obj(), |
- controller_->element_bounds().x(), |
- controller_->element_bounds().y(), |
- controller_->element_bounds().width(), |
- controller_->element_bounds().height()); |
- |
ScopedJavaLocalRef<jstring> password = |
base::android::ConvertUTF16ToJavaString(env, controller_->password()); |
ScopedJavaLocalRef<jstring> suggestion = |