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

Issue 10964051: events: Clean up dispatching code for touch-events. (Closed)

Created:
8 years, 3 months ago by sadrul
Modified:
8 years, 2 months ago
CC:
chromium-reviews, sadrul, yusukes+watch_chromium.org, ben+watch_chromium.org, tfarina, jam, penghuang+watch_chromium.org, joi+watch-content_chromium.org, darin-cc_chromium.org, James Su
Visibility:
Public.

Description

events: Clean up dispatching code for touch-events. Unlike all other events, touch-events can be processed asynchronously, and this complicates using the same code-path used for other events for touch events. This change adds a generic EventResult::ER_ASYNC for these cases, and updates the code in events, aura and gesture recognizer to use EventResult instead of TouchStatus. The code in views still uses TouchStatus. But it will be cleaned up. BUG=none Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=159059

Patch Set 1 : . #

Patch Set 2 : . #

Total comments: 6

Patch Set 3 : . #

Unified diffs Side-by-side diffs Delta from patch set Stats (+145 lines, -186 lines) Patch
M ash/wm/toplevel_window_event_handler.h View 1 chunk +1 line, -1 line 0 comments Download
M ash/wm/toplevel_window_event_handler.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ash/wm/window_modality_controller_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/browser/renderer_host/render_widget_host_view_aura.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M content/browser/renderer_host/render_widget_host_view_aura.cc View 1 2 3 chunks +3 lines, -13 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_win.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M content/browser/web_contents/web_contents_view_aura.h View 1 chunk +1 line, -1 line 0 comments Download
M content/browser/web_contents/web_contents_view_aura.cc View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M ui/aura/demo/demo_main.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ui/aura/event_filter.h View 1 chunk +1 line, -1 line 0 comments Download
M ui/aura/event_filter.cc View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M ui/aura/event_filter_unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ui/aura/gestures/gesture_recognizer_unittest.cc View 1 2 2 chunks +4 lines, -7 lines 0 comments Download
M ui/aura/root_window.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M ui/aura/root_window.cc View 1 2 5 chunks +12 lines, -56 lines 0 comments Download
M ui/aura/shared/compound_event_filter.h View 1 2 2 chunks +2 lines, -6 lines 0 comments Download
M ui/aura/shared/compound_event_filter.cc View 1 2 3 chunks +13 lines, -26 lines 0 comments Download
M ui/aura/test/test_event_filter.h View 1 chunk +1 line, -1 line 0 comments Download
M ui/aura/test/test_event_filter.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ui/aura/test/test_window_delegate.h View 1 chunk +1 line, -1 line 0 comments Download
M ui/aura/test/test_window_delegate.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ui/aura/window_unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ui/base/events/event_constants.h View 1 2 3 chunks +11 lines, -9 lines 0 comments Download
A ui/base/events/event_constants.cc View 1 2 1 chunk +30 lines, -0 lines 0 comments Download
M ui/base/events/event_dispatcher.cc View 1 chunk +1 line, -5 lines 0 comments Download
M ui/base/events/event_dispatcher_unittest.cc View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M ui/base/events/event_handler.h View 1 chunk +1 line, -1 line 0 comments Download
M ui/base/events/event_target.h View 1 chunk +1 line, -1 line 0 comments Download
M ui/base/events/event_target.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ui/base/gestures/gesture_recognizer.h View 1 chunk +1 line, -1 line 0 comments Download
M ui/base/gestures/gesture_recognizer_impl.h View 1 chunk +2 lines, -2 lines 0 comments Download
M ui/base/gestures/gesture_recognizer_impl.cc View 4 chunks +17 lines, -17 lines 0 comments Download
M ui/base/gestures/gesture_sequence.h View 1 chunk +1 line, -1 line 0 comments Download
M ui/base/gestures/gesture_sequence.cc View 1 2 4 chunks +6 lines, -6 lines 0 comments Download
M ui/ui.gyp View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M ui/views/widget/desktop_native_widget_aura.h View 1 chunk +1 line, -1 line 0 comments Download
M ui/views/widget/desktop_native_widget_aura.cc View 1 2 1 chunk +3 lines, -2 lines 0 comments Download
M ui/views/widget/native_widget_aura.h View 1 chunk +1 line, -1 line 0 comments Download
M ui/views/widget/native_widget_aura.cc View 1 2 1 chunk +3 lines, -2 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
sadrul
8 years, 3 months ago (2012-09-21 22:03:12 UTC) #1
Ben Goodger (Google)
http://codereview.chromium.org/10964051/diff/1038/ui/aura/gestures/gesture_recognizer_unittest.cc File ui/aura/gestures/gesture_recognizer_unittest.cc (right): http://codereview.chromium.org/10964051/diff/1038/ui/aura/gestures/gesture_recognizer_unittest.cc#newcode293 ui/aura/gestures/gesture_recognizer_unittest.cc:293: return ui::ER_ASYNC; you can use a ternary here, it ...
8 years, 2 months ago (2012-09-26 19:42:48 UTC) #2
sadrul
http://codereview.chromium.org/10964051/diff/1038/ui/aura/gestures/gesture_recognizer_unittest.cc File ui/aura/gestures/gesture_recognizer_unittest.cc (right): http://codereview.chromium.org/10964051/diff/1038/ui/aura/gestures/gesture_recognizer_unittest.cc#newcode293 ui/aura/gestures/gesture_recognizer_unittest.cc:293: return ui::ER_ASYNC; On 2012/09/26 19:42:48, Ben Goodger (Google) wrote: ...
8 years, 2 months ago (2012-09-26 21:26:05 UTC) #3
Ben Goodger (Google)
8 years, 2 months ago (2012-09-27 15:53:46 UTC) #4
lgtm


On Wed, Sep 26, 2012 at 2:26 PM, <sadrul@chromium.org> wrote:

>
> http://codereview.chromium.**org/10964051/diff/1038/ui/**
>
aura/gestures/gesture_**recognizer_unittest.cc<http://codereview.chromium.org/10964051/diff/1038/ui/aura/gestures/gesture_recognizer_unittest.cc>
> File ui/aura/gestures/gesture_**recognizer_unittest.cc (right):
>
> http://codereview.chromium.**org/10964051/diff/1038/ui/**
>
aura/gestures/gesture_**recognizer_unittest.cc#**newcode293<http://codereview.chromium.org/10964051/diff/1038/ui/aura/gestures/gesture_recognizer_unittest.cc#newcode293>
> ui/aura/gestures/gesture_**recognizer_unittest.cc:293: return
> ui::ER_ASYNC;
> On 2012/09/26 19:42:48, Ben Goodger (Google) wrote:
>
>> you can use a ternary here, it should fit on one line
>>
>
>  return queue_events_ ? ui::ER_ASYNC : ui::ER_UNHANDLED;
>>
>
> Done.
>
>
> http://codereview.chromium.**org/10964051/diff/1038/ui/**
>
base/events/event_constants.h<http://codereview.chromium.org/10964051/diff/1038/ui/base/events/event_constants.h>
> File ui/base/events/event_**constants.h (right):
>
> http://codereview.chromium.**org/10964051/diff/1038/ui/**
>
base/events/event_constants.h#**newcode107<http://codereview.chromium.org/10964051/diff/1038/ui/base/events/event_constants.h#newcode107>
> ui/base/events/event_**constants.h:107: ER_ASYNC     = 1 << 2,  // The
> event will be processed asynchronously. The
> On 2012/09/26 19:42:48, Ben Goodger (Google) wrote:
>
>> Can you tell me how 'asynchronously' works and what this return code
>>
> would be
>
>> interpreted by the caller?
>>
>
> Right now, ASYNC is only used for touch-events, and this is returned
> only by RenderWidgetHostViewAura. (I don't think there will be any other
> places that will do this in the future)
>
> For each touch-event that is processed as ASYNC, the RootWindow adds it
> in a queue in the GestureRecognizer. For each such ASYNC touch event,
> the RWHVA calls RootWindow::**AdvanceQueuedTouchEvent asynchronously
> (after it receives an ACK from renderer/WebKit). At this point, the GR
> removes the event from the queue and processes it (and may generate
> gesture events, which are then dispatched by the RootWindow).
>
> There is plan to move the touch-event queue out of the GR and into
> content/, since that will allow other platforms (e.g. android) to use
> the same queueing code: crbug.com/138153. Once that happens, this
> ER_SYNC will no longer be necessary.
>
>
> http://codereview.chromium.**org/10964051/diff/1038/ui/**
>
views/widget/desktop_native_**widget_aura.cc<http://codereview.chromium.org/10964051/diff/1038/ui/views/widget/desktop_native_widget_aura.cc>
> File ui/views/widget/desktop_**native_widget_aura.cc (right):
>
> http://codereview.chromium.**org/10964051/diff/1038/ui/**
>
views/widget/desktop_native_**widget_aura.cc#newcode442<http://codereview.chromium.org/10964051/diff/1038/ui/views/widget/desktop_native_widget_aura.cc#newcode442>
> ui/views/widget/desktop_**native_widget_aura.cc:442: case
> ui::TOUCH_STATUS_UNKNOWN:
> On 2012/09/26 19:42:48, Ben Goodger (Google) wrote:
>
>> should you have a function in ui/base/events that has this switch
>>
> statement?
>
>> i've seen it a couple of times in this cl.
>>
>
> Done.
>
>
http://codereview.chromium.**org/10964051/<http://codereview.chromium.org/109...
>

Powered by Google App Engine
This is Rietveld 408576698