Index: content/browser/web_contents/web_contents_impl.cc |
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc |
index 4802886938a4dc9816d57cf2cbdd3b68a40deca7..f0a22dca144ea1079f35f53179531e8bb8a4e7a7 100644 |
--- a/content/browser/web_contents/web_contents_impl.cc |
+++ b/content/browser/web_contents/web_contents_impl.cc |
@@ -1585,6 +1585,23 @@ RenderWidgetHostInputEventRouter* WebContentsImpl::GetInputEventRouter() { |
return rwh_input_event_router_.get(); |
} |
+void WebContentsImpl::SendFocusToCrossProcessRenderWidgets(bool is_focused) { |
+ // Focus loss may occur while this WebContents is being destroyed. Don't |
+ // send the message in this case, as the main frame's RenderFrameHost, which |
+ // is used when getting all RenderWidgetHostViews, has already been cleared. |
+ if (is_being_destroyed_) |
alexmos
2015/10/09 20:23:29
For reference, the call stack leading to this is a
Charlie Reis
2015/10/09 21:21:51
Acknowledged.
|
+ return; |
+ |
+ for (RenderWidgetHostView* view : GetRenderWidgetHostViewsInTree()) { |
+ if (!view || view == GetRenderWidgetHostView()) |
Charlie Reis
2015/10/09 21:21:51
Hmm. It looks like any widget (including subframe
alexmos
2015/10/16 16:50:45
This is supposed to be only called from main widge
|
+ continue; |
+ |
+ RenderWidgetHostImpl* rwh = |
+ RenderWidgetHostImpl::From(view->GetRenderWidgetHost()); |
+ rwh->Send(new InputMsg_SetFocus(rwh->GetRoutingID(), is_focused)); |
Charlie Reis
2015/10/09 21:21:51
As in the test, I'm wondering why we want to tell
alexmos
2015/10/16 16:50:45
I think we've cleared this up in earlier comments,
|
+ } |
+} |
+ |
void WebContentsImpl::EnterFullscreenMode(const GURL& origin) { |
// This method is being called to enter renderer-initiated fullscreen mode. |
// Make sure any existing fullscreen widget is shut down first. |