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

Issue 2916673002: Don't rewrite events twice. (Closed)

Created:
3 years, 6 months ago by Hadi
Modified:
3 years, 6 months ago
Reviewers:
sadrul, sky
CC:
chromium-reviews, kalyank, mfomitchev
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Don't rewrite events twice. Rewriters are first tried in AshWindowTreeHostPlatform::DispatchEvent(). We also rewrite them in WindowTreeHost::DispatchKeyEventPostIME(). This for example causes problems when ARC++ is focused while spoken feedback is active. So this CL removes the 2nd rewrite. If Spoken Feedback is active but ARC++ is focused, this is the path for super+right-arrow: 1. AshWindowTreeHostPlatform::DispatchEvent() tries rewriters before sending event to sink. 2. SpokenFeedbackEventRewriter sees super key is down, so sends the event to the Spoken Feedback event extension and tells ash to discard the event. 3. The Spoken Feedback extension doesn't handle the event, and the event is resent to ash from WebContentsImpl::HandleKeyboardEvent(), which sends it to SpokenFeedbackEventRewriterDelegate::HandleKeyboardEvent(), which sends it to event sink (skipping rewriters). 4. Event is sent to InputMethod, it is not handled by InputMethod, so it is sent to WindowTreeHost::DispatchKeyEventPostIME(). Now, if at WTH::DispatchKeyEventPostIME() we try to rewrite the event again, steps 2 to 4 will be tried infinitely and event won't be dispatched to ARC++. This is what was happening before this CL. This CL skips rewriters at WTH::DispatchKeyEventPostIME(). BUG=727179 Review-Url: https://codereview.chromium.org/2916673002 Cr-Commit-Position: refs/heads/master@{#476848} Committed: https://chromium.googlesource.com/chromium/src/+/9aa11de928b45b4bf70124d926f9359d8d48586c

Patch Set 1 #

Patch Set 2 : add a unittest. #

Patch Set 3 : cleanup. #

Patch Set 4 : Add a test window_tree_host_unittest. #

Patch Set 5 : fix windows build error? #

Patch Set 6 : Don't depend on MockInputMethod. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+48 lines, -1 line) Patch
M ui/aura/window_tree_host.cc View 1 chunk +3 lines, -1 line 0 comments Download
M ui/aura/window_tree_host_unittest.cc View 1 2 3 4 5 2 chunks +45 lines, -0 lines 1 comment Download

Messages

Total messages: 40 (28 generated)
Hadi
PTAL. Thanks.
3 years, 6 months ago (2017-06-01 19:08:18 UTC) #11
sadrul
Code looks good. Can the test live in ui/aura/?
3 years, 6 months ago (2017-06-01 19:10:48 UTC) #12
Hadi
On 2017/06/01 19:10:48, sadrul wrote: > Code looks good. Can the test live in ui/aura/? ...
3 years, 6 months ago (2017-06-01 19:17:04 UTC) #13
David Tseng
Sorry, but this doesn't actually fix the issue. Can you please revert on tot and ...
3 years, 6 months ago (2017-06-01 22:11:09 UTC) #16
David Tseng
On 2017/06/01 22:11:09, David Tseng wrote: > Sorry, but this doesn't actually fix the issue. ...
3 years, 6 months ago (2017-06-01 22:26:09 UTC) #17
Hadi
Move the unittest to window_tree_host_unittest, PTAL.
3 years, 6 months ago (2017-06-02 14:05:26 UTC) #21
sadrul
lgtm https://codereview.chromium.org/2916673002/diff/100001/ui/aura/window_tree_host_unittest.cc File ui/aura/window_tree_host_unittest.cc (right): https://codereview.chromium.org/2916673002/diff/100001/ui/aura/window_tree_host_unittest.cc#newcode82 ui/aura/window_tree_host_unittest.cc:82: EXPECT_EQ(0, event_rewriter.events_seen()); Can you do SendEventToSink() on the ...
3 years, 6 months ago (2017-06-02 20:04:39 UTC) #32
Hadi
On 2017/06/02 20:04:39, sadrul wrote: > lgtm > > https://codereview.chromium.org/2916673002/diff/100001/ui/aura/window_tree_host_unittest.cc > File ui/aura/window_tree_host_unittest.cc (right): > ...
3 years, 6 months ago (2017-06-02 20:13:28 UTC) #33
sky
Sadrul is an owner here, so don't wait for me.
3 years, 6 months ago (2017-06-02 21:46:39 UTC) #34
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/2916673002/100001
3 years, 6 months ago (2017-06-03 01:28:00 UTC) #36
commit-bot: I haz the power
Committed patchset #6 (id:100001) as https://chromium.googlesource.com/chromium/src/+/9aa11de928b45b4bf70124d926f9359d8d48586c
3 years, 6 months ago (2017-06-03 01:33:42 UTC) #39
sadrul
3 years, 6 months ago (2017-06-03 03:12:49 UTC) #40
Message was sent while issue was closed.
On 2017/06/02 20:13:28, Hadi wrote:
> On 2017/06/02 20:04:39, sadrul wrote:
> > lgtm
> > 
> >
>
https://codereview.chromium.org/2916673002/diff/100001/ui/aura/window_tree_ho...
> > File ui/aura/window_tree_host_unittest.cc (right):
> > 
> >
>
https://codereview.chromium.org/2916673002/diff/100001/ui/aura/window_tree_ho...
> > ui/aura/window_tree_host_unittest.cc:82: EXPECT_EQ(0,
> > event_rewriter.events_seen());
> > Can you do SendEventToSink() on the WTH, and verify that (1) ime sees the
> event,
> > and (2) rewriter sees the event exactly once?
> 
> Done. (I'm not sure what #1 exactly means, we're sending the event directly to
> InputMethod here).

I meant you should send the event to WindowTreeHost, not directly to IME, in the
test, and verify that IME sees the event, and the rewriter sees the event
exactly once.

Powered by Google App Engine
This is Rietveld 408576698