Chromium Code Reviews| Index: content/browser/renderer_host/render_widget_host_view_android.cc |
| diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc |
| index 3ced095e950303c4870ec6f7325b6a381874fcef..b8a3f983df34b77fc266917a8ab885e33fa2c4ea 100644 |
| --- a/content/browser/renderer_host/render_widget_host_view_android.cc |
| +++ b/content/browser/renderer_host/render_widget_host_view_android.cc |
| @@ -1677,8 +1677,20 @@ void RenderWidgetHostViewAndroid::UnlockMouse() { |
| void RenderWidgetHostViewAndroid::SendKeyEvent( |
| const NativeWebKeyboardEvent& event) { |
| - if (host_) |
| - host_->ForwardKeyboardEvent(event); |
| + if (host_) { |
|
kenrb
2015/10/28 21:07:05
It's cleaner to invert this into an early return
i
alexmos
2015/10/29 05:26:29
Done.
|
| + RenderWidgetHostImpl* target_host = host_; |
| + |
| + // If there are multiple widgets on the page (such as when there are |
| + // out-of-process iframes), pick the one that should process this event. |
| + if (host_->delegate()) { |
| + RenderWidgetHostImpl* focused_host = |
| + host_->delegate()->GetFocusedRenderWidgetHost(); |
| + if (focused_host) |
| + target_host = focused_host; |
| + } |
| + |
| + target_host->ForwardKeyboardEvent(event); |
| + } |
| } |
| void RenderWidgetHostViewAndroid::SendMouseEvent( |