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

Issue 2681613002: Avoid two targeting phases in aura client-lib and EventProcessor. (Closed)

Created:
3 years, 10 months ago by riajiang
Modified:
3 years, 9 months ago
Reviewers:
sadrul, sky
CC:
chromium-reviews, kalyank, tdresser+watch_chromium.org, mfomitchev, Fady Samuel
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Avoid two targeting phases in aura client-lib and EventProcessor. 1. Client-lib now skips the step where it converted the event location from target window's coordinate system to root window's coordinate system; and sets the target window received from mus-ws to be the target for that event. 2. Added two virtual functions in EventProcessor responsible for getting the window with the right targeter (either root window or the farthest ancestor with a targeter set) and for getting the default targeter (WindowTargeter) respectively. 3. WindowEventDispatcher now is responsible for finding the right target and doing the conversion between their coordinate systems. 4. WindowTreeHost only sets a targeter for the root window in non-mus mode so that we don't end up walking all the way up to the root window just to use the default event targeter. This also solves the bug where we were using DIP for conversion in the client-lib but event location was still in pixels at that time. BUG=687700 TEST=aura_unittests manual (--force-device-scale-factor=2) Review-Url: https://codereview.chromium.org/2681613002 Cr-Original-Commit-Position: refs/heads/master@{#452393} Committed: https://chromium.googlesource.com/chromium/src/+/6b3d9805494f966193ad47181d39544d541e79f2 Review-Url: https://codereview.chromium.org/2681613002 Cr-Commit-Position: refs/heads/master@{#454530} Committed: https://chromium.googlesource.com/chromium/src/+/762dcf004c4d65c416992d3c6ad4323a9303e9f0

Patch Set 1 #

Total comments: 5

Patch Set 2 : comments #

Total comments: 3

Patch Set 3 : different approach #

Total comments: 8

Patch Set 4 : nits and tests #

Total comments: 6

Patch Set 5 : comments #

Total comments: 16

Patch Set 6 : test and doc #

Total comments: 2

Patch Set 7 : comments #

Patch Set 8 : test #

Total comments: 10

Patch Set 9 : test #

Patch Set 10 : GetRootForEvent #

Total comments: 2

Patch Set 11 : test #

Patch Set 12 : de-duplicate #

Patch Set 13 : target #

Patch Set 14 : tests #

Total comments: 2

Patch Set 15 : early return #

Unified diffs Side-by-side diffs Delta from patch set Stats (+573 lines, -73 lines) Patch
M ash/root_window_controller.cc View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -2 lines 0 comments Download
M ash/shelf/shelf_widget_unittest.cc View 1 2 3 4 5 6 7 2 chunks +6 lines, -4 lines 0 comments Download
M ash/wm/immersive_fullscreen_controller_unittest.cc View 1 2 3 4 5 6 7 1 chunk +3 lines, -2 lines 0 comments Download
M ash/wm/overview/window_selector_unittest.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -1 line 0 comments Download
M ash/wm/panels/panel_layout_manager_unittest.cc View 1 2 3 4 5 6 7 1 chunk +3 lines, -2 lines 0 comments Download
M ash/wm/workspace_controller_unittest.cc View 1 2 3 4 5 6 7 4 chunks +12 lines, -8 lines 0 comments Download
M ui/aura/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M ui/aura/mus/window_tree_client.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +12 lines, -16 lines 0 comments Download
M ui/aura/mus/window_tree_client_unittest.cc View 1 2 3 4 5 6 7 8 9 10 6 chunks +299 lines, -10 lines 0 comments Download
M ui/aura/test/aura_test_helper.cc View 1 2 3 4 5 6 7 2 chunks +3 lines, -0 lines 0 comments Download
A ui/aura/test/test_window_targeter.h View 1 2 3 4 5 1 chunk +37 lines, -0 lines 0 comments Download
A ui/aura/test/test_window_targeter.cc View 1 2 3 1 chunk +26 lines, -0 lines 0 comments Download
M ui/aura/window_event_dispatcher.h View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +8 lines, -1 line 0 comments Download
M ui/aura/window_event_dispatcher.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +48 lines, -2 lines 0 comments Download
M ui/aura/window_event_dispatcher_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +44 lines, -0 lines 0 comments Download
M ui/aura/window_targeter.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +3 lines, -2 lines 0 comments Download
M ui/aura/window_tree_host.cc View 1 2 3 4 5 6 1 chunk +0 lines, -2 lines 0 comments Download
M ui/events/event_processor.h View 1 2 3 1 chunk +9 lines, -2 lines 0 comments Download
M ui/events/event_processor.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +20 lines, -9 lines 0 comments Download
M ui/events/event_processor_unittest.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M ui/events/test/test_event_processor.h View 1 2 1 chunk +3 lines, -1 line 0 comments Download
M ui/events/test/test_event_processor.cc View 1 2 2 chunks +9 lines, -1 line 0 comments Download
M ui/views/bubble/bubble_window_targeter_unittest.cc View 1 2 3 4 5 6 7 2 chunks +4 lines, -2 lines 0 comments Download
M ui/views/test/event_generator_delegate_mac.mm View 1 2 3 4 5 6 7 1 chunk +4 lines, -1 line 0 comments Download
M ui/views/touchui/touch_selection_controller_impl_unittest.cc View 1 2 3 4 5 6 7 8 2 chunks +5 lines, -2 lines 0 comments Download
M ui/views/widget/root_view.h View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M ui/views/widget/root_view.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +5 lines, -1 line 0 comments Download

Messages

Total messages: 75 (35 generated)
riajiang
Hi sadrul@ and sky@, PTAL, thanks!
3 years, 10 months ago (2017-02-06 23:10:07 UTC) #3
sadrul
https://codereview.chromium.org/2681613002/diff/1/ui/aura/mus/window_tree_client.cc File ui/aura/mus/window_tree_client.cc (right): https://codereview.chromium.org/2681613002/diff/1/ui/aura/mus/window_tree_client.cc#newcode1156 ui/aura/mus/window_tree_client.cc:1156: window->GetWindow()); This is somewhat awkward. Can we set ui::Event::target_ ...
3 years, 10 months ago (2017-02-07 04:04:55 UTC) #4
sky
https://codereview.chromium.org/2681613002/diff/1/ui/aura/mus/window_tree_client.cc File ui/aura/mus/window_tree_client.cc (right): https://codereview.chromium.org/2681613002/diff/1/ui/aura/mus/window_tree_client.cc#newcode1156 ui/aura/mus/window_tree_client.cc:1156: window->GetWindow()); On 2017/02/07 04:04:54, sadrul wrote: > This is ...
3 years, 10 months ago (2017-02-07 04:19:49 UTC) #5
sadrul
On 2017/02/07 04:19:49, sky wrote: > https://codereview.chromium.org/2681613002/diff/1/ui/aura/mus/window_tree_client.cc > File ui/aura/mus/window_tree_client.cc (right): > > https://codereview.chromium.org/2681613002/diff/1/ui/aura/mus/window_tree_client.cc#newcode1156 > ...
3 years, 10 months ago (2017-02-07 04:26:54 UTC) #6
riajiang
https://codereview.chromium.org/2681613002/diff/1/ui/aura/mus/window_tree_client.cc File ui/aura/mus/window_tree_client.cc (right): https://codereview.chromium.org/2681613002/diff/1/ui/aura/mus/window_tree_client.cc#newcode1156 ui/aura/mus/window_tree_client.cc:1156: window->GetWindow()); On 2017/02/07 04:04:54, sadrul wrote: > This is ...
3 years, 10 months ago (2017-02-07 17:42:40 UTC) #7
sky
My concern with direct targeting is that there may be valid cases a client wants ...
3 years, 10 months ago (2017-02-07 20:14:11 UTC) #9
sadrul
On 2017/02/07 20:14:11, sky wrote: > My concern with direct targeting is that there may ...
3 years, 10 months ago (2017-02-08 00:19:13 UTC) #10
sadrul
https://codereview.chromium.org/2681613002/diff/20001/ui/aura/mus/window_tree_client.cc File ui/aura/mus/window_tree_client.cc (right): https://codereview.chromium.org/2681613002/diff/20001/ui/aura/mus/window_tree_client.cc#newcode1178 ui/aura/mus/window_tree_client.cc:1178: host->SendEventToProcessor(event.get()); This should go into some helper function, e.g. ...
3 years, 10 months ago (2017-02-08 00:24:38 UTC) #11
sky
There are subclasses of WindowTargeter in ash. It would be nice if we could continue ...
3 years, 10 months ago (2017-02-08 00:33:17 UTC) #12
sadrul
On 2017/02/08 00:33:17, sky wrote: > There are subclasses of WindowTargeter in ash. It would ...
3 years, 10 months ago (2017-02-08 00:55:40 UTC) #13
sky
Ok, fair enough. I'll fix the pointer observer event coordinates. -Scott On Tue, Feb 7, ...
3 years, 10 months ago (2017-02-08 03:05:34 UTC) #14
riajiang
On 2017/02/08 03:05:34, sky wrote: > Ok, fair enough. I'll fix the pointer observer event ...
3 years, 10 months ago (2017-02-08 19:37:42 UTC) #15
sky
SGTM On Wed, Feb 8, 2017 at 11:37 AM, <riajiang@chromium.org> wrote: > On 2017/02/08 03:05:34, ...
3 years, 10 months ago (2017-02-08 20:06:16 UTC) #16
riajiang
Hi sadrul@ and sky@, changed to use a different approach and updated the CL description, ...
3 years, 10 months ago (2017-02-11 00:43:39 UTC) #21
sadrul
Looks good. Some nits, and maybe more tests? https://codereview.chromium.org/2681613002/diff/100001/ui/aura/mus/window_tree_client.cc File ui/aura/mus/window_tree_client.cc (right): https://codereview.chromium.org/2681613002/diff/100001/ui/aura/mus/window_tree_client.cc#newcode168 ui/aura/mus/window_tree_client.cc:168: ui::Event::DispatcherApi ...
3 years, 10 months ago (2017-02-13 17:05:42 UTC) #22
riajiang
https://codereview.chromium.org/2681613002/diff/100001/ui/aura/mus/window_tree_client.cc File ui/aura/mus/window_tree_client.cc (right): https://codereview.chromium.org/2681613002/diff/100001/ui/aura/mus/window_tree_client.cc#newcode168 ui/aura/mus/window_tree_client.cc:168: ui::Event::DispatcherApi dispatch_helper(event); On 2017/02/13 17:05:42, sadrul wrote: > This ...
3 years, 10 months ago (2017-02-13 23:30:34 UTC) #23
sadrul
https://codereview.chromium.org/2681613002/diff/120001/ui/aura/mus/window_tree_client.cc File ui/aura/mus/window_tree_client.cc (right): https://codereview.chromium.org/2681613002/diff/120001/ui/aura/mus/window_tree_client.cc#newcode1174 ui/aura/mus/window_tree_client.cc:1174: DCHECK(host); |host| is no longer used I think? Remove. ...
3 years, 10 months ago (2017-02-14 21:40:10 UTC) #24
riajiang
https://codereview.chromium.org/2681613002/diff/120001/ui/aura/mus/window_tree_client.cc File ui/aura/mus/window_tree_client.cc (right): https://codereview.chromium.org/2681613002/diff/120001/ui/aura/mus/window_tree_client.cc#newcode1174 ui/aura/mus/window_tree_client.cc:1174: DCHECK(host); On 2017/02/14 21:40:10, sadrul wrote: > |host| is ...
3 years, 10 months ago (2017-02-15 18:09:28 UTC) #25
sky
https://codereview.chromium.org/2681613002/diff/140001/ui/aura/mus/window_tree_client_unittest.cc File ui/aura/mus/window_tree_client_unittest.cc (right): https://codereview.chromium.org/2681613002/diff/140001/ui/aura/mus/window_tree_client_unittest.cc#newcode569 ui/aura/mus/window_tree_client_unittest.cc:569: TEST_F(WindowTreeClientClientTest, InputEventFindTargetAndConversion) { Please add coverage of a case ...
3 years, 10 months ago (2017-02-15 20:47:18 UTC) #26
riajiang
https://codereview.chromium.org/2681613002/diff/140001/ui/aura/mus/window_tree_client_unittest.cc File ui/aura/mus/window_tree_client_unittest.cc (right): https://codereview.chromium.org/2681613002/diff/140001/ui/aura/mus/window_tree_client_unittest.cc#newcode569 ui/aura/mus/window_tree_client_unittest.cc:569: TEST_F(WindowTreeClientClientTest, InputEventFindTargetAndConversion) { On 2017/02/15 20:47:17, sky wrote: > ...
3 years, 10 months ago (2017-02-16 00:34:08 UTC) #27
sky
https://codereview.chromium.org/2681613002/diff/140001/ui/aura/window_event_dispatcher.cc File ui/aura/window_event_dispatcher.cc (right): https://codereview.chromium.org/2681613002/diff/140001/ui/aura/window_event_dispatcher.cc#newcode429 ui/aura/window_event_dispatcher.cc:429: ui::EventTarget* target = event->target(); On 2017/02/16 00:34:08, riajiang wrote: ...
3 years, 10 months ago (2017-02-16 01:03:02 UTC) #28
riajiang
https://codereview.chromium.org/2681613002/diff/140001/ui/aura/window_event_dispatcher.cc File ui/aura/window_event_dispatcher.cc (right): https://codereview.chromium.org/2681613002/diff/140001/ui/aura/window_event_dispatcher.cc#newcode435 ui/aura/window_event_dispatcher.cc:435: if (ancestor == window()) On 2017/02/16 01:03:02, sky wrote: ...
3 years, 10 months ago (2017-02-16 19:10:36 UTC) #29
sky
LGTM
3 years, 10 months ago (2017-02-16 21:40:44 UTC) #30
sadrul
lgtm https://codereview.chromium.org/2681613002/diff/200001/ui/aura/mus/window_tree_client_unittest.cc File ui/aura/mus/window_tree_client_unittest.cc (right): https://codereview.chromium.org/2681613002/diff/200001/ui/aura/mus/window_tree_client_unittest.cc#newcode613 ui/aura/mus/window_tree_client_unittest.cc:613: EXPECT_FALSE(window_delegate1.was_acked()); Remove the was_acked() parts. I don't think ...
3 years, 10 months ago (2017-02-23 03:20:41 UTC) #39
riajiang
https://codereview.chromium.org/2681613002/diff/200001/ui/aura/mus/window_tree_client_unittest.cc File ui/aura/mus/window_tree_client_unittest.cc (right): https://codereview.chromium.org/2681613002/diff/200001/ui/aura/mus/window_tree_client_unittest.cc#newcode613 ui/aura/mus/window_tree_client_unittest.cc:613: EXPECT_FALSE(window_delegate1.was_acked()); On 2017/02/23 03:20:40, sadrul (OOO) wrote: > Remove ...
3 years, 10 months ago (2017-02-23 03:46:01 UTC) #40
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/2681613002/220001
3 years, 10 months ago (2017-02-23 03:46:37 UTC) #43
commit-bot: I haz the power
Committed patchset #9 (id:220001) as https://chromium.googlesource.com/chromium/src/+/6b3d9805494f966193ad47181d39544d541e79f2
3 years, 10 months ago (2017-02-23 04:57:19 UTC) #46
riajiang
A revert of this CL (patchset #9 id:220001) has been created in https://codereview.chromium.org/2715743005/ by riajiang@chromium.org. ...
3 years, 10 months ago (2017-02-23 23:57:38 UTC) #47
riajiang
Resizing was broken because we were skipping WindowTargeter::FindTargetInRootWindow (https://cs.chromium.org/chromium/src/ui/aura/window_targeter.cc?type=cs&l=133) (since we don't look for targets ...
3 years, 10 months ago (2017-02-24 19:44:11 UTC) #49
sky
This seems reasonable to me. Did you add test coverage of this case? The changes ...
3 years, 10 months ago (2017-02-24 21:22:55 UTC) #50
riajiang
Added a test for the capture window case, a TODO and a small change in ...
3 years, 9 months ago (2017-02-27 22:59:30 UTC) #51
sky
One question. How is the capture window handled in aura-local mode? Why do we have ...
3 years, 9 months ago (2017-02-27 23:58:11 UTC) #52
riajiang
On 2017/02/27 23:58:11, sky wrote: > One question. How is the capture window handled in ...
3 years, 9 months ago (2017-02-28 05:22:17 UTC) #53
sky
Got it. Should the logic be moved to the same place for both now? On ...
3 years, 9 months ago (2017-02-28 17:22:27 UTC) #54
riajiang
On 2017/02/28 17:22:27, sky wrote: > Got it. Should the logic be moved to the ...
3 years, 9 months ago (2017-02-28 22:00:13 UTC) #55
sadrul
lgtm https://codereview.chromium.org/2681613002/diff/310028/ui/aura/window_event_dispatcher.cc File ui/aura/window_event_dispatcher.cc (right): https://codereview.chromium.org/2681613002/diff/310028/ui/aura/window_event_dispatcher.cc#newcode66 ui/aura/window_event_dispatcher.cc:66: if (target != event_target && event->IsLocatedEvent()) { early ...
3 years, 9 months ago (2017-03-03 02:33:20 UTC) #67
sky
The parts I reviewed SLGTM. I look forward to seeing this landed!
3 years, 9 months ago (2017-03-03 04:15:13 UTC) #68
riajiang
https://codereview.chromium.org/2681613002/diff/310028/ui/aura/window_event_dispatcher.cc File ui/aura/window_event_dispatcher.cc (right): https://codereview.chromium.org/2681613002/diff/310028/ui/aura/window_event_dispatcher.cc#newcode66 ui/aura/window_event_dispatcher.cc:66: if (target != event_target && event->IsLocatedEvent()) { On 2017/03/03 ...
3 years, 9 months ago (2017-03-03 04:53:08 UTC) #69
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/2681613002/350001
3 years, 9 months ago (2017-03-03 04:53:29 UTC) #72
commit-bot: I haz the power
3 years, 9 months ago (2017-03-03 06:25:00 UTC) #75
Message was sent while issue was closed.
Committed patchset #15 (id:350001) as
https://chromium.googlesource.com/chromium/src/+/762dcf004c4d65c416992d3c6ad4...

Powered by Google App Engine
This is Rietveld 408576698