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

Unified Diff: content/renderer/render_widget.cc

Issue 2681473002: Fix a recent regression in IME inside OOPIFs (Closed)
Patch Set: Fixed a comment Created 3 years, 10 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 c2a137eea5b15b32e62c95b9a770abe731ed2ed6..97cf6309e829b66d68f131eabed328dfe230e05a 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -668,7 +668,12 @@ void RenderWidget::SendOrCrash(IPC::Message* message) {
}
bool RenderWidget::ShouldHandleImeEvents() const {
- return GetWebWidget()->isWebFrameWidget() && has_focus_;
+ // TODO(ekaramad): We track page focus in all RenderViews on the page but the
+ // RenderWidgets corresponding to OOPIFs do not get the update. For now, this
+ // method returns true when the RenderWidget is for an OOPIF, i.e., IME events
+ // will be processed regardless of page focus. We should revisit this after
+ // page focus for OOPIFs has been fully resolved (https://crbug.com/689777).
+ return GetWebWidget()->isWebFrameWidget() && (has_focus_ || for_oopif_);
}
void RenderWidget::SetWindowRectSynchronously(
@@ -1601,10 +1606,11 @@ void RenderWidget::OnImeCommitText(
return;
ImeEventGuard guard(this);
input_handler_->set_handling_input_event(true);
- if (auto* controller = GetInputMethodController())
+ if (auto* controller = GetInputMethodController()) {
controller->commitText(WebString::fromUTF16(text),
WebVector<WebCompositionUnderline>(underlines),
relative_cursor_pos);
+ }
input_handler_->set_handling_input_event(false);
UpdateCompositionInfo(false /* not an immediate request */);
}

Powered by Google App Engine
This is Rietveld 408576698