Chromium Code Reviews| 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()]; |