summaryrefslogtreecommitdiffstats
path: root/ui/views/controls/menu/menu_message_loop.h
diff options
context:
space:
mode:
authorananta <ananta@chromium.org>2016-01-14 13:54:42 -0800
committerCommit bot <commit-bot@chromium.org>2016-01-14 22:03:27 +0000
commit575088602f6e03d99bbc280d1ec8bcede6081315 (patch)
tree956b620856a76c326a377c71c82f6f680b83e40b /ui/views/controls/menu/menu_message_loop.h
parent5d5e7b3d659dbf74ad9d3959ff89a61e13d9b665 (diff)
downloadchromium_src-575088602f6e03d99bbc280d1ec8bcede6081315.zip
chromium_src-575088602f6e03d99bbc280d1ec8bcede6081315.tar.gz
chromium_src-575088602f6e03d99bbc280d1ec8bcede6081315.tar.bz2
Don't send touch events to windows like menus when the touch occurs outside the menu bounds.
Along with not sending touch events to the window with capture, we also need to release capture when we receive a touch for a different target. We use the RepostEvent functionality in the menu code and the WindowEventDispatcher to achieve this. These functions have been updated to support touch. Changes in this patch are as below:- 1. Handle touch events in the menu host via a pre target handler set on the menu window. This event is forwarded to the menu controller which determines if the touch occurred outside the menu bounds. If yes it reposts the event to the appropriate window using the RepostEvent functionality. 2. The MenuController::RepostEvent, MenuController::SetSelectionOnPointerDown, MenuMessageLoop::RepostEventToWindow functions now take in a LocatedEvent* instead of the copied event. This is needed to ensure that we don't lose information while downcasting the event. 3. Added support to dispatch touch events in the WindowEventDispatcher. The earlier approach of using a window property to determine if capture should be released on touch outside is not needed anymore. 4. Fix the DCHECK in the TouchDispositionGestureFilter::OnGesturePacket function which fires if we have duplicate packets with the same unique_touch_event_id. This does fire if we have multiple touch_timeout packets in the queue. These packets have a unique_touch_event_id of 0. BUG=562739 Review URL: https://codereview.chromium.org/1565013002 Cr-Commit-Position: refs/heads/master@{#369561}
Diffstat (limited to 'ui/views/controls/menu/menu_message_loop.h')
-rw-r--r--ui/views/controls/menu/menu_message_loop.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/ui/views/controls/menu/menu_message_loop.h b/ui/views/controls/menu/menu_message_loop.h
index d4d5633..c6a0281 100644
--- a/ui/views/controls/menu/menu_message_loop.h
+++ b/ui/views/controls/menu/menu_message_loop.h
@@ -31,7 +31,7 @@ class MenuMessageLoop {
// Repost |event| to |window|.
// |screen_loc| is the event's location in screen coordinates.
- static void RepostEventToWindow(const ui::LocatedEvent& event,
+ static void RepostEventToWindow(const ui::LocatedEvent* event,
gfx::NativeWindow window,
const gfx::Point& screen_loc);