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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 1394383002: OOPIF: Send page-level focus messages to all processes rendering a page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move ReplicatePageFocus to FrameTree Created 5 years, 2 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
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 44d50d97675f727c83e6c6a2c1b3189aac56b548..7fa4023ef86c3fd2888e24565cfbb6b6c27ed73e 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -1585,6 +1585,16 @@ RenderWidgetHostInputEventRouter* WebContentsImpl::GetInputEventRouter() {
return rwh_input_event_router_.get();
}
+void WebContentsImpl::ReplicatePageFocus(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 and
+ // other state has already been cleared.
+ if (is_being_destroyed_)
+ return;
+
+ frame_tree_.ReplicatePageFocus(is_focused);
+}
+
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.

Powered by Google App Engine
This is Rietveld 408576698