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

Unified Diff: content/renderer/render_widget.cc

Issue 2370393002: Extracting placeholder information from Webkit to Blimp (Closed)
Patch Set: dtrainor comments Created 4 years, 2 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: content/renderer/render_widget.cc
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index 9bccbfc603193a9c0e6dac8cfa7eaa3aedec2754..879e7a30a9484099b8294809caa19a560c853e49 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -35,6 +35,7 @@
#include "content/public/common/content_features.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/context_menu_params.h"
+#include "content/public/common/form_field_data.h"
#include "content/renderer/cursor_utils.h"
#include "content/renderer/devtools/render_widget_screen_metrics_emulator.h"
#include "content/renderer/external_popup_menu.h"
@@ -533,6 +534,8 @@ bool RenderWidget::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(ViewMsg_ShowImeIfNeeded, OnShowImeIfNeeded)
#endif
IPC_MESSAGE_HANDLER(ViewMsg_HandleCompositorProto, OnHandleCompositorProto)
+ IPC_MESSAGE_HANDLER(ViewMsg_GetFocusedFormFieldData,
+ OnFocusedFormFieldDataRequested)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;
@@ -1532,6 +1535,16 @@ void RenderWidget::OnHandleCompositorProto(const std::vector<uint8_t>& proto) {
compositor_->OnHandleCompositorProto(proto);
}
+void RenderWidget::OnFocusedFormFieldDataRequested(int request_id) {
+ blink::WebTextInputInfo info = GetWebWidget()->textInputInfo();
+ FormFieldData field;
+ field.text = info.value.utf8();
+ field.placeholder = info.placeholder.utf8();
+ field.text_input_type = GetTextInputType();
+ Send(
+ new ViewHostMsg_SetFocusedFormFieldData(routing_id(), request_id, field));
+}
+
void RenderWidget::showImeIfNeeded() {
OnShowImeIfNeeded();
}

Powered by Google App Engine
This is Rietveld 408576698