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

Unified Diff: content/renderer/render_view_impl.cc

Issue 2370393002: Extracting placeholder information from Webkit to Blimp (Closed)
Patch Set: Addressed some comments Created 4 years, 1 month 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: content/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 93479bcf1bd718cd0da2355b5ca3a92d82777561..52ac40983659d964bdaa59f7f83eafe5dc1d2a99 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -63,6 +63,7 @@
#include "content/public/common/content_switches.h"
#include "content/public/common/drop_data.h"
#include "content/public/common/favicon_url.h"
+#include "content/public/common/form_field_data.h"
#include "content/public/common/page_importance_signals.h"
#include "content/public/common/page_state.h"
#include "content/public/common/page_zoom.h"
@@ -1350,6 +1351,8 @@ bool RenderViewImpl::OnMessageReceived(const IPC::Message& message) {
OnReleaseDisambiguationPopupBitmap)
IPC_MESSAGE_HANDLER(ViewMsg_ForceRedraw, OnForceRedraw)
IPC_MESSAGE_HANDLER(ViewMsg_SelectWordAroundCaret, OnSelectWordAroundCaret)
+ IPC_MESSAGE_HANDLER(ViewMsg_GetFocusedFormFieldData,
+ OnFocusedFormFieldDataRequested)
// Page messages.
IPC_MESSAGE_HANDLER(PageMsg_UpdateWindowScreenRect,
@@ -1389,6 +1392,20 @@ void RenderViewImpl::OnSelectWordAroundCaret() {
input_handler_->set_handling_input_event(false);
}
+void RenderViewImpl::OnFocusedFormFieldDataRequested(int request_id) {
+ blink::WebFrame* web_frame = webview()->focusedFrame();
Charlie Reis 2016/11/04 20:59:46 This looks wrong for OOPIFs. We should be sending
EhsanK 2016/11/08 15:52:45 I think, if needed, this can be tested for OOPIF i
shaktisahu 2016/11/11 01:15:03 Done.
+ WebElement element = web_frame->document().focusedElement();
+
+ blink::WebTextInputInfo info = GetWebWidget()->textInputInfo();
+ FormFieldData field;
+ field.text = info.value.utf8();
+ field.placeholder = element.getAttribute("placeholder").utf8();
+ field.text_input_type = GetTextInputType();
+
+ Send(new ViewHostMsg_SetFocusedFormFieldDataReply(routing_id(), request_id,
+ field));
+}
+
void RenderViewImpl::OnUpdateTargetURLAck() {
// Check if there is a targeturl waiting to be sent.
if (target_url_status_ == TARGET_PENDING)
« content/public/browser/render_widget_host_view.h ('K') | « content/renderer/render_view_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698