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

Unified Diff: content/browser/renderer_host/render_widget_host_view_base.cc

Issue 2370393002: Extracting placeholder information from Webkit to Blimp (Closed)
Patch Set: Extracting info through RHVW 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/browser/renderer_host/render_widget_host_view_base.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_base.cc b/content/browser/renderer_host/render_widget_host_view_base.cc
index 24129edc19f8293342b6b580c309a230d6b7d9ee..762f7b5f655dc3218d56135d579ff4f30e78433a 100644
--- a/content/browser/renderer_host/render_widget_host_view_base.cc
+++ b/content/browser/renderer_host/render_widget_host_view_base.cc
@@ -15,6 +15,7 @@
#include "content/browser/renderer_host/render_widget_host_view_base_observer.h"
#include "content/browser/renderer_host/text_input_manager.h"
#include "content/common/content_switches_internal.h"
+#include "content/common/view_messages.h"
#include "content/public/browser/render_widget_host_view_frame_subscriber.h"
#include "ui/display/display.h"
#include "ui/display/screen.h"
@@ -45,6 +46,7 @@ RenderWidgetHostViewBase::RenderWidgetHostViewBase()
current_display_rotation_(display::Display::ROTATE_0),
text_input_manager_(nullptr),
renderer_frame_number_(0),
+ next_request_id_(0),
weak_factory_(this) {
}
@@ -157,6 +159,26 @@ ui::TextInputClient* RenderWidgetHostViewBase::GetTextInputClient() {
return NULL;
}
+void RenderWidgetHostViewBase::OnTextInputInfoReply(
+ int request_id,
+ const std::string& text,
+ const std::string& placeholder) {
+ DCHECK(text_input_callbacks_.find(request_id) != text_input_callbacks_.end());
+ text_input_callbacks_[request_id].Run(text, placeholder);
+ text_input_callbacks_.erase(request_id);
+}
+
+void RenderWidgetHostViewBase::FetchTextInputInfo(
+ base::Callback<void(const std::string&, const std::string&)>& reply) {
+ if (!GetRenderWidgetHost())
David Trainor- moved to gerrit 2016/10/26 01:36:42 I would trigger the callback with an empty struct
shaktisahu 2016/10/31 23:13:58 Done.
+ return;
+
+ int request_id = ++next_request_id_;
+ text_input_callbacks_[request_id] = reply;
+ GetRenderWidgetHost()->Send(new ViewMsg_GetFormTextInputInfo(
+ GetRenderWidgetHost()->GetRoutingID(), request_id));
+}
+
bool RenderWidgetHostViewBase::IsShowingContextMenu() const {
return showing_context_menu_;
}

Powered by Google App Engine
This is Rietveld 408576698