Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2405)

Unified Diff: android_webview/native/aw_autofill_client.cc

Issue 2103243002: Factor out ContentViewAndroidDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 5c34dc4759ea2bd284dbfedcf28230e532e75a37..964db0a0c8deaad048967a4d8702e9115964121f 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;
@@ -134,13 +136,14 @@ void AwAutofillClient::ShowAutofillPopupImpl(
env, data_array.obj(), i, name.obj(), label.obj(),
suggestions[i].frontend_id);
}
-
+ if (anchor_view_.is_null()) {
+ anchor_view_.Reset(view_android_->AcquireAnchorView());
no sievers 2016/07/14 23:14:31 Does this need to also be removed again somewhere?
Jinsuk Kim 2016/07/15 05:46:26 Added |Dismissed| and hooked it up to Java layer.
+ }
+ view_android_->SetAnchorRect(anchor_view_.obj(), element_bounds);
Java_AwAutofillClient_showAutofillPopup(env,
obj.obj(),
- element_bounds.x(),
- element_bounds.y(),
+ anchor_view_.obj(),
element_bounds.width(),
- element_bounds.height(),
is_rtl,
data_array.obj());
}
@@ -213,6 +216,10 @@ void AwAutofillClient::SuggestionSelected(JNIEnv* env,
}
}
+void AwAutofillClient::SetViewAndroid(ui::ViewAndroid* view_android) {
+ view_android_ = view_android;
no sievers 2016/07/14 23:14:31 Actually, you can get ViewAndroid dynamically abov
Jinsuk Kim 2016/07/15 05:46:26 Ah, that's nice. Done.
+}
+
void AwAutofillClient::ShowAutofillSettings() {
NOTIMPLEMENTED();
}

Powered by Google App Engine
This is Rietveld 408576698