Ensure that we tag mouse messages synthesized by Windows in response to touch events...
commit143791f3767cb0c7007d2e517400c9ed2d9eb7c4
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Fri, 4 Apr 2014 18:47:17 +0000 (4 18:47 +0000)
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Fri, 4 Apr 2014 18:47:17 +0000 (4 18:47 +0000)
tree6dfe610c7922774322ab0b1fd6dad9a488178f20
parentbcc3d57371525d3a8acf37f053d3633db0521a33
Ensure that we tag mouse messages synthesized by Windows in response to touch events with the ui::EF_FROM_TOUCH flag.

There are mouse events which are synthesized by Windows for touch messages which don't have the magic message
extra information which identifies them as synthesized messages. As per msdn a possible way to detect these
messages is to compare the message times for these messages and the last touch message and whether the position
is different from the current cursor position. These messages are generated by Windows within 500ms of the last
touch message.

We incorporate this in a function HWNDMessageHandler::IsSynthesizedMouseMessage function which returns true
if the above is true.

The other changes are as below:-
1. We need to allow synthesized mouse exit events through even if mouse events are marked as disabled on the
   cursor client. This ensures that hover state on buttons, etc is cleared. This is covered by an aura unittest.
   WindowEventDispatcherTest.DispatchSyntheticMouseExitAfterMouseEventsDisabled

2. The CompoundEventFilter::UpdateCursor function should not attempt to update the cursor for mouse messages
   flagged as coming from touch. This ensures that we don't make the cursor visible if we receive spurious mouse
   messages from touch input. This is covered by a wm core unittest.
   CompoundEventFilterTest.DontShowCursorOnMouseMovesFromTouch

BUG=326933
R=sky@chromium.org, tdanderson@chromium.org

Review URL: https://codereview.chromium.org/214383006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@261807 0039d316-1c4b-4281-b951-d872f2087c98
ui/aura/window_event_dispatcher.cc
ui/aura/window_event_dispatcher_unittest.cc
ui/views/win/hwnd_message_handler.cc
ui/views/win/hwnd_message_handler.h
ui/wm/core/compound_event_filter.cc
ui/wm/core/compound_event_filter_unittest.cc