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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 2370393002: Extracting placeholder information from Webkit to Blimp (Closed)
Patch Set: Added test 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
« content/common/frame_messages.h ('K') | « content/renderer/render_frame_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 069f57dfcf379965038604939fe59511559b28f6..8596aaaba8bff4a1629d17463c7edd065c4f79d1 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -75,6 +75,7 @@
#include "content/public/common/context_menu_params.h"
#include "content/public/common/file_chooser_file_info.h"
#include "content/public/common/file_chooser_params.h"
+#include "content/public/common/form_field_data.h"
#include "content/public/common/isolated_world_ids.h"
#include "content/public/common/page_state.h"
#include "content/public/common/resource_response.h"
@@ -1578,6 +1579,8 @@ bool RenderFrameImpl::OnMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER(FrameMsg_ReloadLoFiImages, OnReloadLoFiImages)
IPC_MESSAGE_HANDLER(FrameMsg_TextSurroundingSelectionRequest,
OnTextSurroundingSelectionRequest)
+ IPC_MESSAGE_HANDLER(FrameMsg_FocusedFormFieldDataRequest,
+ OnFocusedFormFieldDataRequest)
IPC_MESSAGE_HANDLER(FrameMsg_SetAccessibilityMode,
OnSetAccessibilityMode)
IPC_MESSAGE_HANDLER(AccessibilityMsg_SnapshotTree,
@@ -2308,6 +2311,27 @@ void RenderFrameImpl::OnTextSurroundingSelectionRequest(uint32_t max_length) {
surroundingText.endOffsetInTextContent()));
}
+void RenderFrameImpl::OnFocusedFormFieldDataRequest(int request_id) {
+ DCHECK(frame_);
+ if (frame_ != render_view_->GetWebView()->focusedFrame())
+ return;
David Trainor- moved to gerrit 2016/11/11 18:44:38 We still have to respond to the request right?
Charlie Reis 2016/11/11 22:20:46 Yes, otherwise we'll have a leak in the browser fo
shaktisahu 2016/11/15 05:44:54 Done. Sending an empty message. The blimp engine w
+
+ WebElement element = frame_->document().focusedElement();
+ if (element.isNull())
+ return;
David Trainor- moved to gerrit 2016/11/11 18:44:38 Same here.
shaktisahu 2016/11/15 05:44:54 Done.
+
+ DCHECK(GetRenderWidget()->GetWebWidget());
+ blink::WebTextInputInfo info =
+ GetRenderWidget()->GetWebWidget()->textInputInfo();
+ FormFieldData field;
+ field.text = info.value.utf8();
+ field.placeholder = element.getAttribute("placeholder").utf8();
+ field.text_input_type = GetRenderWidget()->GetTextInputType();
+
+ Send(new FrameHostMsg_FocusedFormFieldDataResponse(routing_id_, request_id,
+ field));
+}
+
bool RenderFrameImpl::RunJavaScriptMessage(JavaScriptMessageType type,
const base::string16& message,
const base::string16& default_value,
« content/common/frame_messages.h ('K') | « content/renderer/render_frame_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698