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

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

Issue 2296623002: Fix the wrong candidate window on Mac OSX. (Closed)
Patch Set: Fix the wrong candidate window on Mac OSX. 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 ecfcc9ca472deff504ac837d80ceea708b2370b3..42174ef1c5998d9acc3ae31eacddb2bc29d494e2 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -874,6 +874,14 @@ void RenderWidgetHostViewMac::OnUpdateTextInputStateCalled(
if (!did_update_state)
return;
+ // Set the monitor state based on the text input focus state.
+ RenderWidgetHost* host = GetRenderWidgetHost();
Alexei Svitkine (slow) 2016/09/02 15:48:05 Nit: Remove this line and just inline render_widge
Seigo Nonaka 2016/09/07 23:53:38 Done.
+ const TextInputState* state = text_input_manager->GetTextInputState();
+ bool need_monitor_composition =
+ HasFocus() && state && state->type != ui::TEXT_INPUT_TYPE_NONE;
Alexei Svitkine (slow) 2016/09/02 15:48:05 Nit: Wrong indent, maybe just run git cl format?
Seigo Nonaka 2016/09/07 23:53:38 Ah yes, sorry I ran git cl format for the latest p
+ Send(new InputMsg_RequestCompositionUpdate(host->GetRoutingID(),
+ false /* immediate request */, need_monitor_composition));
+
if (HasFocus()) {
Alexei Svitkine (slow) 2016/09/02 15:48:05 You're adding another call to HasFocus(). Please o
Seigo Nonaka 2016/09/07 23:53:38 Done.
SetTextInputActive(true);
@@ -902,6 +910,8 @@ void RenderWidgetHostViewMac::OnImeCompositionRangeChanged(
RenderWidgetHostViewBase* updated_view) {
const TextInputManager::CompositionRangeInfo* info =
GetTextInputManager()->GetCompositionRangeInfo();
+ if (!info)
Seigo Nonaka 2016/09/02 02:18:04 This is now necessary since GetCompositionRangeInf
+ 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