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

Issue 2451143003: <webview>: Correctly shift focus between WebContents. (Closed)

Created:
4 years, 1 month ago by avallee
Modified:
4 years, 1 month ago
CC:
chromium-reviews, jam, nasko+codewatch_chromium.org, darin-cc_chromium.org, creis+watch_chromium.org, EhsanK
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

<webview>: Correctly shift focus between WebContents. http://crrev.com/408445 Fixes some cases of keyboard input but required a renderer initiated frame focus change in order to do so. This change assumes that the browser is the primary driver of WebContents level focus changes. The leftover FrameHost*::OnFrameFocused is left so that an embedder can script aWebview.focus() to give focus. BUG=660044 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation Committed: https://crrev.com/9993fca0084ba71c628918b384ac701fe6514e44 Cr-Commit-Position: refs/heads/master@{#432781}

Patch Set 1 #

Patch Set 2 : Focus change working. #

Patch Set 3 : Focus change working. #

Patch Set 4 : Ready for review #

Total comments: 4

Patch Set 5 : Address wjmaclean comment: ternary op. #

Total comments: 38

Patch Set 6 : Address comments from alexmos and lfg. #

Total comments: 22

Patch Set 7 : Delete parent notification loop as noted by alexmos@. #

Patch Set 8 : Didn't rename function in cpp #

Patch Set 9 : forgot rebase #

Total comments: 5

Patch Set 10 : Add test for window stealing focus and returning. #

Patch Set 11 : Add fix for MacOS hang. #

Total comments: 20

Patch Set 12 : Fix creis comments. #

Total comments: 9

Patch Set 13 : Fix final comments from creis and alexmos. #

Total comments: 10

Patch Set 14 : Fix creis comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+280 lines, -64 lines) Patch
M chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +70 lines, -8 lines 0 comments Download
M chrome/test/data/extensions/platform_apps/web_view/focus/embedder.js View 1 2 3 4 5 6 7 8 9 7 chunks +42 lines, -6 lines 0 comments Download
M chrome/test/data/extensions/platform_apps/web_view/focus/inject_focus.js View 1 2 3 4 5 6 7 8 9 3 chunks +28 lines, -0 lines 0 comments Download
M content/browser/frame_host/frame_tree.cc View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -12 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_delegate.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +17 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_delegate.cc View 1 2 3 4 5 6 7 8 9 1 chunk +5 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_impl.h View 1 2 3 4 5 6 7 8 9 1 chunk +5 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +37 lines, -22 lines 0 comments Download
M content/browser/web_contents/web_contents_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +26 lines, -0 lines 0 comments Download
M content/browser/web_contents/web_contents_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 5 chunks +50 lines, -16 lines 0 comments Download

Messages

Total messages: 97 (59 generated)
avallee
lfg/alexmos: Please comment overall. wjmaclean@chromium.org: Please review changes in nasko@chromium.org: FYI
4 years, 1 month ago (2016-10-27 18:21:35 UTC) #18
wjmaclean
Generally lftm (looks fine to me), but I'll defer overall to people with greater frame-tree ...
4 years, 1 month ago (2016-10-27 18:41:01 UTC) #19
avallee
https://codereview.chromium.org/2451143003/diff/60001/content/browser/renderer_host/render_widget_host_impl.cc File content/browser/renderer_host/render_widget_host_impl.cc (right): https://codereview.chromium.org/2451143003/diff/60001/content/browser/renderer_host/render_widget_host_impl.cc#newcode697 content/browser/renderer_host/render_widget_host_impl.cc:697: focused_widget = delegate_->GetFocusedRenderWidgetHost(this); On 2016/10/27 18:41:01, wjmaclean wrote: > ...
4 years, 1 month ago (2016-10-27 19:00:57 UTC) #20
wjmaclean
On 2016/10/27 19:00:57, avallee wrote: > https://codereview.chromium.org/2451143003/diff/60001/content/browser/renderer_host/render_widget_host_impl.cc > File content/browser/renderer_host/render_widget_host_impl.cc (right): > > https://codereview.chromium.org/2451143003/diff/60001/content/browser/renderer_host/render_widget_host_impl.cc#newcode697 > ...
4 years, 1 month ago (2016-10-27 19:33:08 UTC) #21
lfg
Just a couple of questions. https://codereview.chromium.org/2451143003/diff/80001/chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc File chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc (right): https://codereview.chromium.org/2451143003/diff/80001/chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc#newcode1364 chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc:1364: content::FrameFocusedObserver focus_observer( Is this ...
4 years, 1 month ago (2016-10-27 20:00:35 UTC) #22
alexmos
Thanks, some initial questions and comments below. https://codereview.chromium.org/2451143003/diff/80001/chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc File chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc (left): https://codereview.chromium.org/2451143003/diff/80001/chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc#oldcode1381 chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc:1381: EXPECT_EQ(embedder_web_contents()->GetFocusedFrame(), nullptr); ...
4 years, 1 month ago (2016-10-28 06:36:39 UTC) #23
avallee
PTAL. https://codereview.chromium.org/2451143003/diff/80001/chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc File chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc (left): https://codereview.chromium.org/2451143003/diff/80001/chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc#oldcode1381 chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc:1381: EXPECT_EQ(embedder_web_contents()->GetFocusedFrame(), nullptr); On 2016/10/28 06:36:39, alexmos wrote: > ...
4 years, 1 month ago (2016-10-28 19:19:57 UTC) #25
avallee
PTAL.
4 years, 1 month ago (2016-10-28 19:19:59 UTC) #26
lfg
lgtm
4 years, 1 month ago (2016-10-28 20:22:13 UTC) #28
alexmos
Thanks, a few more comments. Also, I think it's worth adding some tests for this. ...
4 years, 1 month ago (2016-10-31 18:57:57 UTC) #35
avallee
Addressed comments. Ehsan, mind to comment about (!GuestMode::IsCrossProcessFrameGuest(this) && browser_plugin_guest_) https://codereview.chromium.org/2451143003/diff/80001/content/browser/web_contents/web_contents_impl.cc File content/browser/web_contents/web_contents_impl.cc (right): https://codereview.chromium.org/2451143003/diff/80001/content/browser/web_contents/web_contents_impl.cc#newcode4633 ...
4 years, 1 month ago (2016-11-07 19:18:44 UTC) #38
EhsanK
https://codereview.chromium.org/2451143003/diff/80001/content/browser/web_contents/web_contents_impl.cc File content/browser/web_contents/web_contents_impl.cc (right): https://codereview.chromium.org/2451143003/diff/80001/content/browser/web_contents/web_contents_impl.cc#newcode4646 content/browser/web_contents/web_contents_impl.cc:4646: ->GetMainFrame() On 2016/10/27 20:00:35, lfg wrote: > +ekaramad@ FYI. ...
4 years, 1 month ago (2016-11-08 16:05:47 UTC) #49
alexmos
Thanks, this is getting there. A couple more comments, with a question for Ehsan, and ...
4 years, 1 month ago (2016-11-09 02:47:54 UTC) #50
EhsanK
https://codereview.chromium.org/2451143003/diff/100001/content/browser/web_contents/web_contents_impl.cc File content/browser/web_contents/web_contents_impl.cc (right): https://codereview.chromium.org/2451143003/diff/100001/content/browser/web_contents/web_contents_impl.cc#newcode4717 content/browser/web_contents/web_contents_impl.cc:4717: if (!GuestMode::IsCrossProcessFrameGuest(this) && browser_plugin_guest_) On 2016/11/09 02:47:54, alexmos wrote: ...
4 years, 1 month ago (2016-11-09 16:58:02 UTC) #51
EhsanK
4 years, 1 month ago (2016-11-09 16:58:08 UTC) #52
alexmos
https://codereview.chromium.org/2451143003/diff/100001/content/browser/web_contents/web_contents_impl.cc File content/browser/web_contents/web_contents_impl.cc (right): https://codereview.chromium.org/2451143003/diff/100001/content/browser/web_contents/web_contents_impl.cc#newcode4717 content/browser/web_contents/web_contents_impl.cc:4717: if (!GuestMode::IsCrossProcessFrameGuest(this) && browser_plugin_guest_) On 2016/11/09 16:58:02, EhsanK wrote: ...
4 years, 1 month ago (2016-11-09 18:16:58 UTC) #53
EhsanK
https://codereview.chromium.org/2451143003/diff/100001/content/browser/web_contents/web_contents_impl.cc File content/browser/web_contents/web_contents_impl.cc (right): https://codereview.chromium.org/2451143003/diff/100001/content/browser/web_contents/web_contents_impl.cc#newcode4717 content/browser/web_contents/web_contents_impl.cc:4717: if (!GuestMode::IsCrossProcessFrameGuest(this) && browser_plugin_guest_) > I'm assuming the example ...
4 years, 1 month ago (2016-11-09 19:17:15 UTC) #54
alexmos
https://codereview.chromium.org/2451143003/diff/100001/content/browser/web_contents/web_contents_impl.cc File content/browser/web_contents/web_contents_impl.cc (right): https://codereview.chromium.org/2451143003/diff/100001/content/browser/web_contents/web_contents_impl.cc#newcode4717 content/browser/web_contents/web_contents_impl.cc:4717: if (!GuestMode::IsCrossProcessFrameGuest(this) && browser_plugin_guest_) On 2016/11/09 19:17:15, EhsanK wrote: ...
4 years, 1 month ago (2016-11-10 18:35:44 UTC) #55
EhsanK
https://codereview.chromium.org/2451143003/diff/100001/content/browser/web_contents/web_contents_impl.cc File content/browser/web_contents/web_contents_impl.cc (right): https://codereview.chromium.org/2451143003/diff/100001/content/browser/web_contents/web_contents_impl.cc#newcode4717 content/browser/web_contents/web_contents_impl.cc:4717: if (!GuestMode::IsCrossProcessFrameGuest(this) && browser_plugin_guest_) On 2016/11/10 18:35:44, alexmos wrote: ...
4 years, 1 month ago (2016-11-10 19:04:56 UTC) #56
alexmos
https://codereview.chromium.org/2451143003/diff/100001/content/browser/web_contents/web_contents_impl.cc File content/browser/web_contents/web_contents_impl.cc (right): https://codereview.chromium.org/2451143003/diff/100001/content/browser/web_contents/web_contents_impl.cc#newcode4717 content/browser/web_contents/web_contents_impl.cc:4717: if (!GuestMode::IsCrossProcessFrameGuest(this) && browser_plugin_guest_) On 2016/11/10 18:35:44, alexmos wrote: ...
4 years, 1 month ago (2016-11-10 19:16:55 UTC) #57
avallee
I believe I addressed all comments. I think that there are 3 patchsets included and ...
4 years, 1 month ago (2016-11-16 05:38:10 UTC) #60
avallee
I believe I addressed all comments. I think that there are 3 patchsets included and ...
4 years, 1 month ago (2016-11-16 05:38:11 UTC) #61
avallee
nick or creis: Can you review content/. I'd like to get this in before branch. ...
4 years, 1 month ago (2016-11-16 19:30:30 UTC) #70
wjmaclean
LGTM for webview_interactive_browser_test
4 years, 1 month ago (2016-11-16 20:02:16 UTC) #71
Charlie Reis
Hmm, this seems to be making the focus logic even harder to follow, at least ...
4 years, 1 month ago (2016-11-16 20:28:24 UTC) #72
avallee
creis: Responded to your comments. https://codereview.chromium.org/2451143003/diff/60001/content/browser/renderer_host/render_widget_host_impl.cc File content/browser/renderer_host/render_widget_host_impl.cc (right): https://codereview.chromium.org/2451143003/diff/60001/content/browser/renderer_host/render_widget_host_impl.cc#newcode697 content/browser/renderer_host/render_widget_host_impl.cc:697: focused_widget = delegate_->GetFocusedRenderWidgetHost(this); On ...
4 years, 1 month ago (2016-11-16 21:18:11 UTC) #75
Charlie Reis
Thanks for the explanations-- given that this is specific to the GuestView case, I'm less ...
4 years, 1 month ago (2016-11-16 21:51:20 UTC) #76
wjmaclean
https://codereview.chromium.org/2451143003/diff/200001/content/browser/renderer_host/render_widget_host_impl.cc File content/browser/renderer_host/render_widget_host_impl.cc (right): https://codereview.chromium.org/2451143003/diff/200001/content/browser/renderer_host/render_widget_host_impl.cc#newcode743 content/browser/renderer_host/render_widget_host_impl.cc:743: (focused_widget ? focused_widget : this)->SetPageFocus(true); On 2016/11/16 21:18:10, avallee ...
4 years, 1 month ago (2016-11-16 21:57:09 UTC) #77
Charlie Reis
https://codereview.chromium.org/2451143003/diff/200001/content/browser/renderer_host/render_widget_host_impl.cc File content/browser/renderer_host/render_widget_host_impl.cc (right): https://codereview.chromium.org/2451143003/diff/200001/content/browser/renderer_host/render_widget_host_impl.cc#newcode743 content/browser/renderer_host/render_widget_host_impl.cc:743: (focused_widget ? focused_widget : this)->SetPageFocus(true); On 2016/11/16 21:57:09, wjmaclean ...
4 years, 1 month ago (2016-11-16 22:00:57 UTC) #78
wjmaclean
On 2016/11/16 22:00:57, Charlie Reis (slow) wrote: > https://codereview.chromium.org/2451143003/diff/200001/content/browser/renderer_host/render_widget_host_impl.cc > File content/browser/renderer_host/render_widget_host_impl.cc (right): > > ...
4 years, 1 month ago (2016-11-16 22:06:02 UTC) #79
alexmos
LGTM once the latest set of comments (including ones from Charlie) are addressed. Thanks for ...
4 years, 1 month ago (2016-11-16 23:29:03 UTC) #80
alexmos
https://codereview.chromium.org/2451143003/diff/220001/content/browser/web_contents/web_contents_impl.cc File content/browser/web_contents/web_contents_impl.cc (right): https://codereview.chromium.org/2451143003/diff/220001/content/browser/web_contents/web_contents_impl.cc#newcode487 content/browser/web_contents/web_contents_impl.cc:487: outermost->SetAsFocusedWebContentsIfNecessary(); On 2016/11/16 23:29:03, alexmos wrote: > This will ...
4 years, 1 month ago (2016-11-17 00:09:20 UTC) #81
avallee
Comments addressed. https://codereview.chromium.org/2451143003/diff/200001/content/browser/web_contents/web_contents_impl.h File content/browser/web_contents/web_contents_impl.h (right): https://codereview.chromium.org/2451143003/diff/200001/content/browser/web_contents/web_contents_impl.h#newcode1026 content/browser/web_contents/web_contents_impl.h:1026: void SetAsFocusedWebContentsIfNecessary(); On 2016/11/16 21:51:20, Charlie Reis ...
4 years, 1 month ago (2016-11-17 00:20:12 UTC) #84
Charlie Reis
Thanks! LGTM with nits. https://codereview.chromium.org/2451143003/diff/200001/content/browser/renderer_host/render_widget_host_delegate.h File content/browser/renderer_host/render_widget_host_delegate.h (right): https://codereview.chromium.org/2451143003/diff/200001/content/browser/renderer_host/render_widget_host_delegate.h#newcode150 content/browser/renderer_host/render_widget_host_delegate.h:150: // focused WebContents. On 2016/11/16 ...
4 years, 1 month ago (2016-11-17 00:49:48 UTC) #85
avallee
https://codereview.chromium.org/2451143003/diff/240001/content/browser/renderer_host/render_widget_host_delegate.h File content/browser/renderer_host/render_widget_host_delegate.h (right): https://codereview.chromium.org/2451143003/diff/240001/content/browser/renderer_host/render_widget_host_delegate.h#newcode151 content/browser/renderer_host/render_widget_host_delegate.h:151: virtual RenderWidgetHostImpl* GetRenderWidgetHostWithPageFocus(); On 2016/11/17 00:49:48, Charlie Reis (slow) ...
4 years, 1 month ago (2016-11-17 02:37:49 UTC) #88
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2451143003/260001
4 years, 1 month ago (2016-11-17 04:46:59 UTC) #93
commit-bot: I haz the power
Committed patchset #14 (id:260001)
4 years, 1 month ago (2016-11-17 06:17:24 UTC) #95
commit-bot: I haz the power
4 years, 1 month ago (2016-11-17 06:22:55 UTC) #97
Message was sent while issue was closed.
Patchset 14 (id:??) landed as
https://crrev.com/9993fca0084ba71c628918b384ac701fe6514e44
Cr-Commit-Position: refs/heads/master@{#432781}

Powered by Google App Engine
This is Rietveld 408576698