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

Issue 1934703002: Fix keyboard focus for OOPIF-<webview>. (Closed)

Created:
4 years, 7 months ago by avallee
Modified:
4 years, 4 months ago
CC:
blink-reviews, blink-reviews-api_chromium.org, chromium-reviews, creis+watch_chromium.org, darin-cc_chromium.org, dglazkov+blink, jam, mkwst+moarreviews-renderer_chromium.org, mlamouri+watch-content_chromium.org, nasko+codewatch_chromium.org, site-isolation-reviews_chromium.org, ncarter (slow), Charlie Reis
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix keyboard focus for OOPIF-<webview>. When using --use-cross-process-frames-for-guests input events were being routed to the embedder which should not be able to process guests' input events. + WebContents tree traversal from parent to child. + WebContents keeps global track of focused frame, unlike frame tree which might not know about inner/outer web contents. + RenderFrameHostImpl::OnFrameFocused delegates back to WebContents instead of frame tree. + Send input to Webcontents that is focused. + Add unfocus message to renderer. When moving focus from a frame in the webview back to the embedder, the inner contents no longer has any focus (the frame with focus is not visible to the inner guest). ~ Changed frame focusing with the keyboard. Tabbing into the webview did not cause focus to properly propagate everywhere. ~ Disabled NOTREACHED when finished tabbing through the webview. Left note to crbug for properly moving focus to the next element in tab order. ~ Left note on re-enabling WebViewAccessibilityTest::FocusAccessibility. ~ Reworked RenderWidgetHostViewGuest to use MaybeSendSyntheticTapGesture for Touch and Mouse event. ~ Edited SelectShowHide for direct routing. BUG=600395 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation Committed: https://crrev.com/0206f78f31bafd45b2a9479d0311b4e7e11acf7a Cr-Commit-Position: refs/heads/master@{#408445}

Patch Set 1 #

Patch Set 2 : Ready for review: Fix works with oopif webview but does not fix crbug.com/609903 #

Total comments: 33

Patch Set 3 : Address comments. Fix tab focus change. #

Total comments: 67

Patch Set 4 : Respond to alexmos@ #

Total comments: 3

Patch Set 5 : Blink ASSERT was missing.. #

Total comments: 7

Patch Set 6 : Simplify approach based on alexmos feedback. #

Total comments: 25

Patch Set 7 : Added test and addressed comments. #

Total comments: 17

Patch Set 8 : Rebase ToT #

Total comments: 2

Patch Set 9 : Fixed test flakiness and comments in PS 7,8. #

Total comments: 11

Patch Set 10 : Fixed tests, pass in all of {--use-cross-process-frames-for-guests,}{--site-per-process,} and comme… #

Patch Set 11 : Fix focus issue in browserplugin with direct routing. #

Patch Set 12 : Fixed WebViewTests/WebViewTest.SelectShowHide/1 browser_test #

Total comments: 6

Patch Set 13 : Add comment as suggested my wjmaclean. #

Patch Set 14 : Fix alexmos nits. #

Total comments: 1

Patch Set 15 : Address dcheng@ comments #

Patch Set 16 : Missed comment from PS9 #

Patch Set 17 : Now with 80% less built breakage. #

Total comments: 2

Patch Set 18 : Added comment requested by dcheng. #

Total comments: 4

Patch Set 19 : Address nasko@ comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+399 lines, -93 lines) Patch
M chrome/browser/apps/guest_view/web_view_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +4 lines, -3 lines 0 comments Download
M chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +41 lines, -0 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 3 chunks +52 lines, -0 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 10 11 12 13 14 2 chunks +29 lines, -0 lines 0 comments Download
M chrome/test/data/extensions/platform_apps/web_view/popup_positioning/main.js View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/frame_host/frame_tree.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +13 lines, -0 lines 0 comments Download
M content/browser/frame_host/render_frame_host_delegate.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +5 lines, -0 lines 0 comments Download
M content/browser/frame_host/render_frame_host_impl.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +4 lines, -0 lines 0 comments Download
M content/browser/frame_host/render_frame_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +7 lines, -1 line 0 comments Download
M content/browser/frame_host/render_frame_proxy_host.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -2 lines 0 comments Download
M content/browser/frame_host/render_widget_host_view_guest.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +12 lines, -0 lines 0 comments Download
M content/browser/frame_host/render_widget_host_view_guest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +56 lines, -27 lines 0 comments Download
M content/browser/site_per_process_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +1 line, -26 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 14 15 16 17 18 5 chunks +18 lines, -4 lines 0 comments Download
M content/browser/web_contents/web_contents_impl.cc View 1 2 3 4 5 6 7 8 9 10 9 chunks +83 lines, -29 lines 0 comments Download
M content/browser/web_contents/web_contents_view_child_frame.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +2 lines, -1 line 0 comments Download
M content/common/frame_messages.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +4 lines, -0 lines 0 comments Download
M content/public/test/browser_test_utils.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +18 lines, -0 lines 0 comments Download
M content/public/test/browser_test_utils.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +31 lines, -0 lines 0 comments Download
M content/renderer/render_frame_impl.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
M content/renderer/render_frame_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +5 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/web/WebViewImpl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/web/WebViewImpl.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +5 lines, -0 lines 0 comments Download
M third_party/WebKit/public/web/WebView.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 90 (39 generated)
avallee
lfg@ Care to comment before I send out more widely. kenrb@ IPC to unset focus.
4 years, 7 months ago (2016-05-06 20:46:00 UTC) #4
avallee
lfg@ Care to comment before I send out more widely. kenrb@ IPC to unset focus.
4 years, 7 months ago (2016-05-06 20:46:01 UTC) #5
lfg
Just a few comments. https://codereview.chromium.org/1934703002/diff/20001/content/browser/frame_host/frame_tree.cc File content/browser/frame_host/frame_tree.cc (right): https://codereview.chromium.org/1934703002/diff/20001/content/browser/frame_host/frame_tree.cc#newcode255 content/browser/frame_host/frame_tree.cc:255: if (GetFocusedFrame()) { Nit: no ...
4 years, 7 months ago (2016-05-06 21:23:33 UTC) #7
dmazzoni
Could you try updating WebViewAccessibilityTest::FocusAccessibility so that it runs with --use-cross-process-frames-for-guests? It's currently set to ...
4 years, 7 months ago (2016-05-09 17:07:21 UTC) #9
dcheng
Drive-by. https://codereview.chromium.org/1934703002/diff/20001/third_party/WebKit/Source/web/WebViewImpl.cpp File third_party/WebKit/Source/web/WebViewImpl.cpp (right): https://codereview.chromium.org/1934703002/diff/20001/third_party/WebKit/Source/web/WebViewImpl.cpp#newcode2909 third_party/WebKit/Source/web/WebViewImpl.cpp:2909: // TODO(avallee): else NOTREACHED() ? On 2016/05/06 at ...
4 years, 7 months ago (2016-05-09 18:25:08 UTC) #10
avallee
PTAL dcheng: Blink dmazzoni: frame_tree comments. alexmos: overall nasko: Feel free to comment. https://codereview.chromium.org/1934703002/diff/20001/content/browser/frame_host/frame_tree.cc File ...
4 years, 7 months ago (2016-05-11 18:26:12 UTC) #12
lfg
Thanks, lgtm.
4 years, 7 months ago (2016-05-11 18:32:37 UTC) #15
avallee
wjmaclean: Looking for rubber stamp on chrome/browser/apps/guest_view/web_view_browsertest.cc
4 years, 7 months ago (2016-05-11 18:35:02 UTC) #16
wjmaclean
On 2016/05/11 18:35:02, avallee wrote: > wjmaclean: Looking for rubber stamp on > chrome/browser/apps/guest_view/web_view_browsertest.cc LGTM ...
4 years, 7 months ago (2016-05-11 18:37:44 UTC) #17
dcheng
https://codereview.chromium.org/1934703002/diff/20001/third_party/WebKit/Source/web/WebViewImpl.cpp File third_party/WebKit/Source/web/WebViewImpl.cpp (right): https://codereview.chromium.org/1934703002/diff/20001/third_party/WebKit/Source/web/WebViewImpl.cpp#newcode2909 third_party/WebKit/Source/web/WebViewImpl.cpp:2909: // TODO(avallee): else NOTREACHED() ? On 2016/05/11 at 18:26:11, ...
4 years, 7 months ago (2016-05-11 18:46:58 UTC) #18
wjmaclean
On 2016/05/11 18:37:44, wjmaclean wrote: > On 2016/05/11 18:35:02, avallee wrote: > > wjmaclean: Looking ...
4 years, 7 months ago (2016-05-11 18:53:53 UTC) #19
dmazzoni
https://codereview.chromium.org/1934703002/diff/40001/content/browser/frame_host/frame_tree.cc File content/browser/frame_host/frame_tree.cc (right): https://codereview.chromium.org/1934703002/diff/40001/content/browser/frame_host/frame_tree.cc#newcode259 content/browser/frame_host/frame_tree.cc:259: // TODO(avallee): https://crbug.com/610795 This line is not sufficient to ...
4 years, 7 months ago (2016-05-12 02:58:56 UTC) #20
kenrb
ipc lgtm
4 years, 7 months ago (2016-05-12 16:56:33 UTC) #21
alexmos
Thanks for working on this! Some initial comments and questions below. https://codereview.chromium.org/1934703002/diff/40001/content/browser/frame_host/frame_tree.cc File content/browser/frame_host/frame_tree.cc (right): ...
4 years, 7 months ago (2016-05-12 20:28:43 UTC) #22
avallee
alexmos: Responded to your comments. https://codereview.chromium.org/1934703002/diff/40001/content/browser/frame_host/frame_tree.cc File content/browser/frame_host/frame_tree.cc (right): https://codereview.chromium.org/1934703002/diff/40001/content/browser/frame_host/frame_tree.cc#newcode256 content/browser/frame_host/frame_tree.cc:256: GetFocusedFrame()->current_frame_host()->UnsetFocusedFrame(); On 2016/05/12 20:28:39, ...
4 years, 7 months ago (2016-05-16 20:26:43 UTC) #23
avallee
alexmos: Responded to your comments. https://codereview.chromium.org/1934703002/diff/40001/content/browser/frame_host/frame_tree.cc File content/browser/frame_host/frame_tree.cc (right): https://codereview.chromium.org/1934703002/diff/40001/content/browser/frame_host/frame_tree.cc#newcode256 content/browser/frame_host/frame_tree.cc:256: GetFocusedFrame()->current_frame_host()->UnsetFocusedFrame(); On 2016/05/12 20:28:39, ...
4 years, 7 months ago (2016-05-16 20:26:44 UTC) #24
dcheng
https://codereview.chromium.org/1934703002/diff/60001/third_party/WebKit/Source/web/WebViewImpl.cpp File third_party/WebKit/Source/web/WebViewImpl.cpp (right): https://codereview.chromium.org/1934703002/diff/60001/third_party/WebKit/Source/web/WebViewImpl.cpp#newcode2906 third_party/WebKit/Source/web/WebViewImpl.cpp:2906: if (page()->focusController().focusedFrame() == frame->toImplBase()->frame()) { Based on earlier comments, ...
4 years, 7 months ago (2016-05-16 20:28:58 UTC) #25
avallee
https://codereview.chromium.org/1934703002/diff/60001/third_party/WebKit/Source/web/WebViewImpl.cpp File third_party/WebKit/Source/web/WebViewImpl.cpp (right): https://codereview.chromium.org/1934703002/diff/60001/third_party/WebKit/Source/web/WebViewImpl.cpp#newcode2906 third_party/WebKit/Source/web/WebViewImpl.cpp:2906: if (page()->focusController().focusedFrame() == frame->toImplBase()->frame()) { On 2016/05/16 20:28:58, dcheng ...
4 years, 7 months ago (2016-05-17 15:13:19 UTC) #26
alexmos
https://codereview.chromium.org/1934703002/diff/40001/content/browser/frame_host/frame_tree.cc File content/browser/frame_host/frame_tree.cc (right): https://codereview.chromium.org/1934703002/diff/40001/content/browser/frame_host/frame_tree.cc#newcode256 content/browser/frame_host/frame_tree.cc:256: GetFocusedFrame()->current_frame_host()->UnsetFocusedFrame(); On 2016/05/16 20:26:43, avallee wrote: > On 2016/05/12 ...
4 years, 7 months ago (2016-05-19 00:08:09 UTC) #27
avallee
alexmos: Simplified the approach by tracking which webcontents has focus in the webcontents tree and ...
4 years, 7 months ago (2016-05-24 20:07:08 UTC) #30
dcheng
On 2016/05/24 at 20:07:08, avallee wrote: > alexmos: Simplified the approach by tracking which webcontents ...
4 years, 7 months ago (2016-05-24 20:41:54 UTC) #31
avallee
On 2016/05/24 20:41:54, dcheng wrote: > On 2016/05/24 at 20:07:08, avallee wrote: > > alexmos: ...
4 years, 7 months ago (2016-05-25 18:14:03 UTC) #32
alexmos
Great, thanks for simplifying the approach, I think this looks much cleaner! Some more nits ...
4 years, 7 months ago (2016-05-26 00:32:26 UTC) #33
avallee
PTAL. Added test and addressed alexmos comments. https://codereview.chromium.org/1934703002/diff/140001/content/browser/web_contents/web_contents_impl.cc File content/browser/web_contents/web_contents_impl.cc (right): https://codereview.chromium.org/1934703002/diff/140001/content/browser/web_contents/web_contents_impl.cc#newcode369 content/browser/web_contents/web_contents_impl.cc:369: outer_web_contents_->node_->SetFocusedWebContents(outer_web_contents_); On ...
4 years, 6 months ago (2016-06-07 15:37:44 UTC) #35
alexmos
Thanks! One new question about updating focus when destroying WebContentsTreeNodes, but other than that this ...
4 years, 6 months ago (2016-06-07 22:03:43 UTC) #36
avallee
alexmos, lfg: PTAL. https://codereview.chromium.org/1934703002/diff/180001/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/1934703002/diff/180001/chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc#newcode1360 chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc:1360: gfx::Point(40, 40)); On 2016/06/07 22:03:43, alexmos ...
4 years, 6 months ago (2016-06-15 13:32:11 UTC) #37
alexmos
Preemptively sending out a couple more nits for the latest PS for when you're back. ...
4 years, 6 months ago (2016-06-24 01:38:50 UTC) #38
commit-bot: I haz the power
Your CL relies on deprecated CQ feature(s): * Specifying master names in CQ_INCLUDE_TRYBOTS part of ...
4 years, 5 months ago (2016-07-25 15:13:32 UTC) #41
avallee
PTAL alexmos: I think everything is green and submittable now. I got all the tests ...
4 years, 5 months ago (2016-07-25 19:02:05 UTC) #45
avallee
PTAL alexmos: I think everything is green and submittable now. I got all the tests ...
4 years, 5 months ago (2016-07-25 19:02:06 UTC) #46
wjmaclean
lgtm re sending of focusing SyntheticGestureTap https://codereview.chromium.org/1934703002/diff/280001/content/browser/frame_host/render_widget_host_view_guest.cc File content/browser/frame_host/render_widget_host_view_guest.cc (left): https://codereview.chromium.org/1934703002/diff/280001/content/browser/frame_host/render_widget_host_view_guest.cc#oldcode182 content/browser/frame_host/render_widget_host_view_guest.cc:182: // the plugin ...
4 years, 5 months ago (2016-07-25 19:54:31 UTC) #47
avallee
https://codereview.chromium.org/1934703002/diff/280001/content/browser/frame_host/render_widget_host_view_guest.cc File content/browser/frame_host/render_widget_host_view_guest.cc (left): https://codereview.chromium.org/1934703002/diff/280001/content/browser/frame_host/render_widget_host_view_guest.cc#oldcode182 content/browser/frame_host/render_widget_host_view_guest.cc:182: // the plugin and thus onwards to the guest. ...
4 years, 4 months ago (2016-07-26 20:11:51 UTC) #48
avallee
4 years, 4 months ago (2016-07-26 20:11:52 UTC) #49
alexmos
LGTM with nits. Thanks for pulling this through! It's a bit sad that we have ...
4 years, 4 months ago (2016-07-26 21:08:30 UTC) #50
dmazzoni
Looks like this is almost ready to land - please check with me after it ...
4 years, 4 months ago (2016-07-26 22:05:07 UTC) #51
avallee
alexmos: All done. dmazzoni: My approach has changed a bit. In my next cl where ...
4 years, 4 months ago (2016-07-27 01:30:18 UTC) #52
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/1934703002/320001
4 years, 4 months ago (2016-07-27 03:28:57 UTC) #59
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/225826)
4 years, 4 months ago (2016-07-27 03:34:41 UTC) #61
dcheng
https://codereview.chromium.org/1934703002/diff/320001/third_party/WebKit/public/web/WebView.h File third_party/WebKit/public/web/WebView.h (right): https://codereview.chromium.org/1934703002/diff/320001/third_party/WebKit/public/web/WebView.h#newcode204 third_party/WebKit/public/web/WebView.h:204: virtual void unfocusDocumentView(WebFrame*) = 0; Please add a comment ...
4 years, 4 months ago (2016-07-27 05:13:19 UTC) #62
avallee
On 2016/07/27 05:13:19, dcheng wrote: > https://codereview.chromium.org/1934703002/diff/320001/third_party/WebKit/public/web/WebView.h > File third_party/WebKit/public/web/WebView.h (right): > > https://codereview.chromium.org/1934703002/diff/320001/third_party/WebKit/public/web/WebView.h#newcode204 > ...
4 years, 4 months ago (2016-07-27 20:15:57 UTC) #63
avallee
PTAL: alexmos, sorry I missed the comments back on PS9. They've been addressed. dcheng: should ...
4 years, 4 months ago (2016-07-27 21:35:02 UTC) #66
alexmos
PS13 -> PS16 LGTM, though you'll need to fix the compile error in FrameFocusedObserver.
4 years, 4 months ago (2016-07-28 00:49:00 UTC) #69
avallee
On 2016/07/28 00:49:00, alexmos wrote: > PS13 -> PS16 LGTM, though you'll need to fix ...
4 years, 4 months ago (2016-07-28 02:01:50 UTC) #70
dcheng
LGTM with nits, thanks! https://codereview.chromium.org/1934703002/diff/380001/third_party/WebKit/public/web/WebView.h File third_party/WebKit/public/web/WebView.h (right): https://codereview.chromium.org/1934703002/diff/380001/third_party/WebKit/public/web/WebView.h#newcode204 third_party/WebKit/public/web/WebView.h:204: virtual void unfocusDocumentView() = 0; ...
4 years, 4 months ago (2016-07-28 02:14:18 UTC) #73
avallee
https://codereview.chromium.org/1934703002/diff/380001/third_party/WebKit/public/web/WebView.h File third_party/WebKit/public/web/WebView.h (right): https://codereview.chromium.org/1934703002/diff/380001/third_party/WebKit/public/web/WebView.h#newcode204 third_party/WebKit/public/web/WebView.h:204: virtual void unfocusDocumentView() = 0; On 2016/07/28 02:14:18, dcheng ...
4 years, 4 months ago (2016-07-28 02:49:16 UTC) #76
avallee
nick or creis: Can you PTAL. LGTM needed for content/. Thanks.
4 years, 4 months ago (2016-07-28 14:33:06 UTC) #80
nasko
Based on everyone's reviews, LGTM with a few nits. https://codereview.chromium.org/1934703002/diff/400001/content/browser/frame_host/render_frame_host_delegate.h File content/browser/frame_host/render_frame_host_delegate.h (right): https://codereview.chromium.org/1934703002/diff/400001/content/browser/frame_host/render_frame_host_delegate.h#newcode189 content/browser/frame_host/render_frame_host_delegate.h:189: ...
4 years, 4 months ago (2016-07-28 16:43:05 UTC) #81
Charlie Reis
Thanks Nasko! I'm moving Nick and myself to CC since you handled the content/ review.
4 years, 4 months ago (2016-07-28 17:29:53 UTC) #83
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/1934703002/420001
4 years, 4 months ago (2016-07-28 17:40:07 UTC) #86
commit-bot: I haz the power
Committed patchset #19 (id:420001)
4 years, 4 months ago (2016-07-28 18:55:51 UTC) #88
commit-bot: I haz the power
4 years, 4 months ago (2016-07-28 18:58:49 UTC) #90
Message was sent while issue was closed.
Patchset 19 (id:??) landed as
https://crrev.com/0206f78f31bafd45b2a9479d0311b4e7e11acf7a
Cr-Commit-Position: refs/heads/master@{#408445}

Powered by Google App Engine
This is Rietveld 408576698