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

Unified Diff: blimp/engine/session/blimp_engine_session.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: blimp/engine/session/blimp_engine_session.cc
diff --git a/blimp/engine/session/blimp_engine_session.cc b/blimp/engine/session/blimp_engine_session.cc
index f4708eaa662112f412ca279c403249b77864a06e..fb919c8dfec8cba52fc06601c0dd186498b58f57 100644
--- a/blimp/engine/session/blimp_engine_session.cc
+++ b/blimp/engine/session/blimp_engine_session.cc
@@ -228,7 +228,8 @@ BlimpEngineSession::BlimpEngineSession(
settings_manager_(settings_manager),
settings_feature_(settings_manager_),
render_widget_feature_(settings_manager_),
- net_components_(new EngineNetworkComponents(net_log)) {
+ net_components_(new EngineNetworkComponents(net_log)),
+ weak_factory_(this) {
DCHECK(engine_config_);
DCHECK(settings_manager_);
@@ -402,7 +403,6 @@ void BlimpEngineSession::OnTextInputStateChanged(
ui::TextInputType type =
client ? client->GetTextInputType() : ui::TEXT_INPUT_TYPE_NONE;
- // TODO(shaktisahu): Propagate the new type to the client.
// Hide IME, when text input is out of focus, i.e. if the text input type
// changes to ui::TEXT_INPUT_TYPE_NONE. For other text input types,
// OnShowImeIfNeeded is used instead to send show IME request to client.
@@ -422,10 +422,22 @@ void BlimpEngineSession::OnShowImeIfNeeded() {
!window_tree_host_->GetInputMethod()->GetTextInputClient())
return;
+ base::Callback<void(const std::string&, const std::string&)> reply =
David Trainor- moved to gerrit 2016/10/26 01:36:42 This should probably live inside Tab so we can do
shaktisahu 2016/10/31 23:13:58 Done.
+ base::Bind(&BlimpEngineSession::FetchTextInputInfo,
+ weak_factory_.GetWeakPtr());
+
+ tab_->web_contents()->GetRenderWidgetHostView()->FetchTextInputInfo(reply);
+}
+
+void BlimpEngineSession::FetchTextInputInfo(const std::string& text,
+ const std::string& placeholder) {
+ ui::TextInputType type = window_tree_host_->GetInputMethod()
+ ->GetTextInputClient()
+ ->GetTextInputType();
render_widget_feature_.SendShowImeRequest(
tab_->tab_id(),
tab_->web_contents()->GetRenderWidgetHostView()->GetRenderWidgetHost(),
- window_tree_host_->GetInputMethod()->GetTextInputClient());
+ type, text, placeholder);
}
void BlimpEngineSession::ProcessMessage(

Powered by Google App Engine
This is Rietveld 408576698