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

Unified Diff: content/renderer/render_widget.cc

Issue 2681473002: Fix a recent regression in IME inside OOPIFs (Closed)
Patch Set: Formatting and comments 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 645363b23a98c2597bbdd5e3c0d4e5e6b0d40ea5..36d244c9b8729f7c6b892cdff6089eef794f2bdc 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -670,7 +670,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(
@@ -1616,10 +1621,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