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

Unified Diff: content/browser/renderer_host/render_widget_host_view_mac.mm

Issue 2337783004: Fix the wrong candidate window on Mac OSX. (Closed)
Patch Set: Created 4 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_view_mac.mm
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
index f918d1320043865700e576de13764d527da4925b..825941faac0fe866a88e925dbe2ebae691cea699 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -874,7 +874,16 @@ void RenderWidgetHostViewMac::OnUpdateTextInputStateCalled(
if (!did_update_state)
return;
- if (HasFocus()) {
+ // Set the monitor state based on the text input focus state.
+ const bool has_focus = HasFocus();
+ const TextInputState* state = text_input_manager->GetTextInputState();
+ bool need_monitor_composition =
+ has_focus && state && state->type != ui::TEXT_INPUT_TYPE_NONE;
+ Send(new InputMsg_RequestCompositionUpdate(
+ render_widget_host_->GetRoutingID(), false /* immediate request */,
+ need_monitor_composition));
+
+ if (has_focus) {
SetTextInputActive(true);
// Let AppKit cache the new input context to make IMEs happy.
@@ -902,6 +911,8 @@ void RenderWidgetHostViewMac::OnImeCompositionRangeChanged(
RenderWidgetHostViewBase* updated_view) {
const TextInputManager::CompositionRangeInfo* info =
GetTextInputManager()->GetCompositionRangeInfo();
+ if (!info)
+ return;
// The RangeChanged message is only sent with valid values. The current
// caret position (start == end) will be sent if there is no IME range.
[cocoa_view_ setMarkedRange:info->range.ToNSRange()];
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698