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

Unified Diff: content/renderer/render_widget.cc

Issue 2696883002: Fix a recent regression in IME inside OOPIFs (Merge to M-57) (Closed)
Patch Set: 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
« no previous file with comments | « content/public/test/text_input_test_utils.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_widget.cc
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index c928346d809a471d5ff37a400145acbae194807d..ac6f63108036e4bde831e5d6b142cfd7052e4c6e 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -663,7 +663,13 @@ 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() && GetWebWidget()->isWebFrameWidget() &&
+ (has_focus_ || for_oopif_);
}
void RenderWidget::SetWindowRectSynchronously(
@@ -1570,9 +1576,10 @@ void RenderWidget::OnImeCommitText(
return;
ImeEventGuard guard(this);
input_handler_->set_handling_input_event(true);
- if (auto* controller = GetInputMethodController())
+ if (auto* controller = GetInputMethodController()) {
controller->commitText(text, WebVector<WebCompositionUnderline>(underlines),
relative_cursor_pos);
+ }
input_handler_->set_handling_input_event(false);
UpdateCompositionInfo(false /* not an immediate request */);
}
« no previous file with comments | « content/public/test/text_input_test_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698