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

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

Issue 1405293002: OOPIF: Route keyboard events to focused frame in the browser process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@focus-page
Patch Set: Address Ken's comments 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 6b1407b78e0ace939218a24a5478b0c23d48f1c3..f866c138d167035c173c9e997937244420004ce0 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -1590,6 +1590,18 @@ void WebContentsImpl::ReplicatePageFocus(bool is_focused) {
frame_tree_.ReplicatePageFocus(is_focused);
}
+RenderWidgetHostImpl* WebContentsImpl::GetFocusedRenderWidgetHost() {
+ if (!SiteIsolationPolicy::AreCrossProcessFramesPossible())
+ return GetMainFrame()->GetRenderWidgetHost();
+
+ FrameTreeNode* focused_frame = frame_tree_.GetFocusedFrame();
+ if (!focused_frame)
+ return GetMainFrame()->GetRenderWidgetHost();
+
+ return RenderWidgetHostImpl::From(
+ focused_frame->current_frame_host()->GetView()->GetRenderWidgetHost());
Charlie Reis 2015/10/29 18:14:02 Ken, this is why I wanted RenderFrameHostImpl::Get
alexmos 2015/10/29 22:22:08 +1 to having GetRenderWidgetHost() return the widg
kenrb 2015/10/29 23:54:40 We had discussed removing RenderFrameHostImpl::Get
+}
+
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