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

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: Cleanup 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..765168619c929bd78174d518c2d2c1a9ed0d4653 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() {
alexmos 2015/10/23 23:40:16 I wasn't sure whether this logic should go into Re
kenrb 2015/10/28 21:07:05 I was thinking about this also, but I can't think
+ RenderWidgetHostImpl* target_rwh;
+ FrameTreeNode* focused_frame = frame_tree_.GetFocusedFrame();
+ if (!focused_frame) {
+ target_rwh = GetMainFrame()->GetRenderWidgetHost();
+ } else {
+ target_rwh = RenderWidgetHostImpl::From(
+ focused_frame->current_frame_host()->GetView()->GetRenderWidgetHost());
+ }
+ return target_rwh;
alexmos 2015/10/23 23:40:16 I thought about whether this should check AreCross
kenrb 2015/10/28 21:07:05 Will this affect browser plugin? Currently that st
alexmos 2015/10/29 05:26:29 I've tried it on a sample app with <webview>, and
+}
+
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