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

Issue 2883653002: Implement TouchSelectionEditing controls for OOPIF. (Closed)

Created:
3 years, 7 months ago by wjmaclean
Modified:
3 years, 6 months ago
Reviewers:
kenrb, EhsanK, Charlie Reis
CC:
chromium-reviews, creis+watch_chromium.org, yusukes+watch_chromium.org, shuchen+watch_chromium.org, nasko+codewatch_chromium.org, jam, dtapuska+chromiumwatch_chromium.org, jbauman+watch_chromium.org, nona+watch_chromium.org, darin-cc_chromium.org, piman+watch_chromium.org, kalyank, danakj+watch_chromium.org, James Su, site-isolation-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Implement TouchSelectionEditing controls for OOPIF. This CL revises the TouchSelection editing code to work with cross-process iframes. The basic design extends TouchSelectionControllerClientAura to also implement TouchSelectionControllerManager, and it multiplexes sub-frame's TouchSelectionControllerChildFrames internally in a manner transparent to the TouchSelectionController. The manager defines an |active_client_| to be the most recent RenderWidgetHostViewX to receive a selection bounds update in its CompositorFrameMetadata, with the rules that and active_client_ cannot be displayed by another view's update if that update (i) sets the selection bounds to be empty, or (ii) marks the bounds as !visible() (this occurs when the view loses focus). Since the tear-down order of the top-level RenderWidgetHostView and its sub-frame views is not well defined, each sub-frame view registers as an observer with the TouchSelectionControllerClientManager and detaches itself if it sees the manager is about to be destroyed. At present, context menus still do not work in OOPIF subframes, but this is being tracked in https://crbug.com/723799. Design doc: https://docs.google.com/a/chromium.org/document/d/1xQLL2Hlm5IXSGmPZBRdQY8bN1spIYo9Ra-bSUVYqP5g/edit?usp=sharing BUG=470662 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation Review-Url: https://codereview.chromium.org/2883653002 Cr-Commit-Position: refs/heads/master@{#474680} Committed: https://chromium.googlesource.com/chromium/src/+/9a65831b1415a39a1614783ab3cc2faa5caa3330

Patch Set 1 #

Patch Set 2 : Fix GN file. #

Patch Set 3 : Fix bugs, add test. #

Patch Set 4 : Fix some broken tests. #

Patch Set 5 : Fix unit test. #

Patch Set 6 : Mark manager's observer as CONTENT_EXPORT. #

Total comments: 29

Patch Set 7 : Address kenrb@'s comments. #

Total comments: 2

Patch Set 8 : Move child frame client files to renderer_host/input. #

Patch Set 9 : ChildFrame client uses root view's animation defaults. #

Total comments: 9

Patch Set 10 : Address nits, add test. #

Patch Set 11 : Rebase to master@{#474649}. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+849 lines, -9 lines) Patch
M content/browser/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 1 chunk +3 lines, -0 lines 0 comments Download
M content/browser/frame_host/cross_process_frame_connector.cc View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M content/browser/frame_host/render_widget_host_view_child_frame.h View 1 2 3 4 5 6 7 8 9 10 7 chunks +17 lines, -0 lines 0 comments Download
M content/browser/frame_host/render_widget_host_view_child_frame.cc View 1 2 3 4 5 6 7 8 9 10 8 chunks +91 lines, -0 lines 2 comments Download
M content/browser/renderer_host/DEPS View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -0 lines 0 comments Download
M content/browser/renderer_host/input/touch_selection_controller_client_aura.h View 1 2 3 4 5 6 4 chunks +47 lines, -1 line 0 comments Download
M content/browser/renderer_host/input/touch_selection_controller_client_aura.cc View 1 2 3 4 5 6 7 8 9 10 chunks +105 lines, -2 lines 0 comments Download
M content/browser/renderer_host/input/touch_selection_controller_client_aura_browsertest.cc View 1 2 3 4 5 6 7 8 9 3 chunks +210 lines, -1 line 0 comments Download
A content/browser/renderer_host/input/touch_selection_controller_client_child_frame.h View 1 2 3 4 5 6 7 8 9 1 chunk +68 lines, -0 lines 0 comments Download
A content/browser/renderer_host/input/touch_selection_controller_client_child_frame.cc View 1 2 3 4 5 6 7 8 1 chunk +204 lines, -0 lines 0 comments Download
A content/browser/renderer_host/input/touch_selection_controller_client_manager.h View 1 2 3 4 5 6 7 8 9 1 chunk +61 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 1 chunk +1 line, -2 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_aura.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +7 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_aura.cc View 1 2 3 4 5 6 7 8 9 10 4 chunks +15 lines, -3 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_base.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +8 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_base.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +5 lines, -0 lines 0 comments Download

Depends on Patchset:

Dependent Patchsets:

Messages

Total messages: 57 (41 generated)
wjmaclean
kenrb@ - could you please take a look? I still have some work to do ...
3 years, 7 months ago (2017-05-17 22:23:53 UTC) #14
wjmaclean
kenrb@ - ping? :-)
3 years, 7 months ago (2017-05-23 13:38:31 UTC) #29
kenrb
A few thoughts below. It looks like this has diverged a bit from the design ...
3 years, 7 months ago (2017-05-23 16:19:03 UTC) #30
wjmaclean
I'll put up a new CL shortly, but please take a look at my answers ...
3 years, 7 months ago (2017-05-23 17:00:41 UTC) #31
Charlie Reis
https://codereview.chromium.org/2883653002/diff/100001/content/browser/frame_host/touch_selection_controller_client_child_frame.h File content/browser/frame_host/touch_selection_controller_client_child_frame.h (right): https://codereview.chromium.org/2883653002/diff/100001/content/browser/frame_host/touch_selection_controller_client_child_frame.h#newcode15 content/browser/frame_host/touch_selection_controller_client_child_frame.h:15: class RenderWidgetHostViewChildFrame; On 2017/05/23 17:00:41, wjmaclean wrote: > On ...
3 years, 7 months ago (2017-05-23 18:39:52 UTC) #32
wjmaclean
Ken, did you have any further suggestions or changes? I think the only remaining issue ...
3 years, 7 months ago (2017-05-24 13:42:59 UTC) #33
kenrb
lgtm I'm not certain about that part either, I don't know how this works well ...
3 years, 7 months ago (2017-05-24 14:54:28 UTC) #34
wjmaclean
Thanks Ken ... I've revise so the ChildFrame client defers to the root view's client. ...
3 years, 7 months ago (2017-05-24 17:10:08 UTC) #36
Charlie Reis
This is way beyond my level of understanding, so I'm mainly deferring to Ken's review ...
3 years, 7 months ago (2017-05-25 02:29:43 UTC) #37
wjmaclean
Test added, and comments addressed. https://codereview.chromium.org/2883653002/diff/180001/content/browser/renderer_host/DEPS File content/browser/renderer_host/DEPS (right): https://codereview.chromium.org/2883653002/diff/180001/content/browser/renderer_host/DEPS#newcode50 content/browser/renderer_host/DEPS:50: ], On 2017/05/25 02:29:43, ...
3 years, 7 months ago (2017-05-25 14:04:35 UTC) #38
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/2883653002/220001
3 years, 7 months ago (2017-05-25 16:59:19 UTC) #49
Charlie Reis
Thanks! LGTM.
3 years, 7 months ago (2017-05-25 17:03:57 UTC) #50
commit-bot: I haz the power
Committed patchset #11 (id:220001) as https://chromium.googlesource.com/chromium/src/+/9a65831b1415a39a1614783ab3cc2faa5caa3330
3 years, 7 months ago (2017-05-25 17:04:15 UTC) #53
EhsanK
https://codereview.chromium.org/2883653002/diff/220001/content/browser/frame_host/render_widget_host_view_child_frame.cc File content/browser/frame_host/render_widget_host_view_child_frame.cc (right): https://codereview.chromium.org/2883653002/diff/220001/content/browser/frame_host/render_widget_host_view_child_frame.cc#newcode792 content/browser/frame_host/render_widget_host_view_child_frame.cc:792: if (!text_input_manager_ || !GetFocusedWidget()) Just a comment that came ...
3 years, 6 months ago (2017-05-29 15:41:45 UTC) #55
wjmaclean
https://codereview.chromium.org/2883653002/diff/220001/content/browser/frame_host/render_widget_host_view_child_frame.cc File content/browser/frame_host/render_widget_host_view_child_frame.cc (right): https://codereview.chromium.org/2883653002/diff/220001/content/browser/frame_host/render_widget_host_view_child_frame.cc#newcode792 content/browser/frame_host/render_widget_host_view_child_frame.cc:792: if (!text_input_manager_ || !GetFocusedWidget()) On 2017/05/29 15:41:45, EhsanK wrote: ...
3 years, 6 months ago (2017-05-29 16:39:06 UTC) #56
EhsanK
3 years, 6 months ago (2017-05-29 17:11:30 UTC) #57
Message was sent while issue was closed.
On 2017/05/29 16:39:06, wjmaclean wrote:
>
https://codereview.chromium.org/2883653002/diff/220001/content/browser/frame_...
> File content/browser/frame_host/render_widget_host_view_child_frame.cc
(right):
> 
>
https://codereview.chromium.org/2883653002/diff/220001/content/browser/frame_...
> content/browser/frame_host/render_widget_host_view_child_frame.cc:792: if
> (!text_input_manager_ || !GetFocusedWidget())
> On 2017/05/29 15:41:45, EhsanK wrote:
> > Just a comment that came to my mind when I was reading this part of code to
> work
> > on https://crbug.com/714771:
> > 
> > RenderWidgetHostViewBase::GetFocusedWidget() uses
> > RenderWidgetHostDelegate::GetFocusedRenderWidgetHost() on its own
> > RenderWidgetHost (not that of the page).
> > 
> > Therefore, when render_widget_host_ && render_widget_host_->delegate()
exist,
> > GetFocusedWidget() always returns the |render_widget_host_|.
> > 
> > Having said this, I believe this should change to |render_widget_host_| here
> and
> > we should only pass |this| to TextInputManager::GetTextSelection().
> > 
> > If the intention is to look for focused RenderWidgetHostView in page then we
> > should use
> >
>
render_widget_host_->delegate()->GetFocusedRenderWidgetHost(RenderWidgetHostImpl::From(
> > frame_connector_->GetRootRenderWidgetHostView()->GetRenderWidgetHost()));
> 
> Good to know ... I'll try this out, and revise it to match what you suggest in
a
> new CL. I don't know if it will help with the bug, but we'll see what happens.

Yes. No it is not related to the bug actually. Thanks!

Powered by Google App Engine
This is Rietveld 408576698