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

Unified Diff: blimp/engine/session/blimp_engine_session.cc

Issue 2370393002: Extracting placeholder information from Webkit to Blimp (Closed)
Patch Set: Observing InputMethod 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 33fac46bf27e5bccfaa1bae6aa0cebd32cbc72b3..67e3e1937ce915b0c1f572c5bd049f7f099018bf 100644
--- a/blimp/engine/session/blimp_engine_session.cc
+++ b/blimp/engine/session/blimp_engine_session.cc
@@ -402,10 +402,9 @@ 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.
+ // OnUpdateTextInputState is used instead to send show IME request to client.
if (type == ui::TEXT_INPUT_TYPE_NONE)
render_widget_feature_.SendHideImeRequest(
tab_->tab_id(),
@@ -415,17 +414,27 @@ void BlimpEngineSession::OnTextInputStateChanged(
void BlimpEngineSession::OnInputMethodDestroyed(
const ui::InputMethod* input_method) {}
-// Called when a user input should trigger showing the IME.
-void BlimpEngineSession::OnShowImeIfNeeded() {
- TRACE_EVENT0("blimp", "BlimpEngineSession::OnShowImeIfNeeded");
- if (!tab_ || !tab_->web_contents()->GetRenderWidgetHostView() ||
- !window_tree_host_->GetInputMethod()->GetTextInputClient())
- return;
+void BlimpEngineSession::OnShowImeIfNeeded() {}
- render_widget_feature_.SendShowImeRequest(
- tab_->tab_id(),
- tab_->web_contents()->GetRenderWidgetHostView()->GetRenderWidgetHost(),
- window_tree_host_->GetInputMethod()->GetTextInputClient());
+// Called when:
+// - a text area is focused.
+// - text entered by the user is submitted.
+void BlimpEngineSession::OnUpdateTextInputState(
+ content::RenderWidgetHost* render_widget_host,
+ ui::TextInputType type,
+ const std::string& text,
+ const std::string& placeholder,
+ bool show_ime_if_needed) {
+ if (show_ime_if_needed) {
+ render_widget_feature_.SendShowImeRequest(
+ tab_->tab_id(),
+ tab_->web_contents()->GetRenderWidgetHostView()->GetRenderWidgetHost(),
Charlie Reis 2016/10/05 21:19:33 Sanity check: I'm not sure where this is running,
+ type, text, placeholder);
+ } else {
+ render_widget_feature_.SendHideImeRequest(
+ tab_->tab_id(),
+ tab_->web_contents()->GetRenderWidgetHostView()->GetRenderWidgetHost());
+ }
}
void BlimpEngineSession::ProcessMessage(

Powered by Google App Engine
This is Rietveld 408576698