diff options
author | dmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-29 19:01:44 +0000 |
---|---|---|
committer | dmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-29 19:01:44 +0000 |
commit | 34538533288487aa0002510f1abd78519831be7c (patch) | |
tree | b3ef4b2d45e37664e226514dfb91f7b44483bc7b /ui | |
parent | 41d70bd6049acc562fa0ff51bd3f7453d4969f07 (diff) | |
download | chromium_src-34538533288487aa0002510f1abd78519831be7c.zip chromium_src-34538533288487aa0002510f1abd78519831be7c.tar.gz chromium_src-34538533288487aa0002510f1abd78519831be7c.tar.bz2 |
Make Views fire an accessible hover event on mouse enter.
This is used for touch accessibility on Chrome OS, see bug. Fires the
AX event on mouse enter and passes this through to the
accessibilityPrivate API for ChromeVox.
BUG=377043
Review URL: https://codereview.chromium.org/297133002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@273529 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r-- | ui/chromeos/touch_exploration_controller.cc | 11 | ||||
-rw-r--r-- | ui/chromeos/touch_exploration_controller_unittest.cc | 2 | ||||
-rw-r--r-- | ui/events/event_constants.h | 12 | ||||
-rw-r--r-- | ui/views/view.cc | 2 |
4 files changed, 16 insertions, 11 deletions
diff --git a/ui/chromeos/touch_exploration_controller.cc b/ui/chromeos/touch_exploration_controller.cc index 94ceb2d..5745769 100644 --- a/ui/chromeos/touch_exploration_controller.cc +++ b/ui/chromeos/touch_exploration_controller.cc @@ -147,11 +147,12 @@ scoped_ptr<ui::Event> TouchExplorationController::CreateMouseMoveEvent( const gfx::PointF& location, int flags) { return scoped_ptr<ui::Event>( - new ui::MouseEvent(ui::ET_MOUSE_MOVED, - location, - location, - flags | ui::EF_IS_SYNTHESIZED | ui::EF_FROM_TOUCH, - 0)); + new ui::MouseEvent( + ui::ET_MOUSE_MOVED, + location, + location, + flags | ui::EF_IS_SYNTHESIZED | ui::EF_TOUCH_ACCESSIBILITY, + 0)); } void TouchExplorationController::EnterTouchToMouseMode() { diff --git a/ui/chromeos/touch_exploration_controller_unittest.cc b/ui/chromeos/touch_exploration_controller_unittest.cc index 1ec3f8b..8366194 100644 --- a/ui/chromeos/touch_exploration_controller_unittest.cc +++ b/ui/chromeos/touch_exploration_controller_unittest.cc @@ -189,7 +189,7 @@ TEST_F(TouchExplorationTest, OneFingerTouch) { CONFIRM_EVENTS_ARE_MOUSE_AND_EQUAL(*it, &mouse_move); if (num_mouse_moves != 2) { EXPECT_TRUE((*it)->flags() & ui::EF_IS_SYNTHESIZED); - EXPECT_TRUE((*it)->flags() & ui::EF_FROM_TOUCH); + EXPECT_TRUE((*it)->flags() & ui::EF_TOUCH_ACCESSIBILITY); } num_mouse_moves++; } diff --git a/ui/events/event_constants.h b/ui/events/event_constants.h index a7ff8b1..4081e20 100644 --- a/ui/events/event_constants.h +++ b/ui/events/event_constants.h @@ -104,11 +104,13 @@ enum KeyEventFlags { // Flags specific to mouse events enum MouseEventFlags { - EF_IS_DOUBLE_CLICK = 1 << 16, - EF_IS_TRIPLE_CLICK = 1 << 17, - EF_IS_NON_CLIENT = 1 << 18, - EF_FROM_TOUCH = 1 << 19, // Indicates this mouse event is generated - // from an unconsumed touch/gesture event. + EF_IS_DOUBLE_CLICK = 1 << 16, + EF_IS_TRIPLE_CLICK = 1 << 17, + EF_IS_NON_CLIENT = 1 << 18, + EF_FROM_TOUCH = 1 << 19, // Indicates this mouse event is generated + // from an unconsumed touch/gesture event. + EF_TOUCH_ACCESSIBILITY = 1 << 20, // Indicates this event was generated from + // touch accessibility mode. }; // Result of dispatching an event. diff --git a/ui/views/view.cc b/ui/views/view.cc index 54d6d7d..0ccdcfc 100644 --- a/ui/views/view.cc +++ b/ui/views/view.cc @@ -1055,6 +1055,8 @@ void View::OnMouseEvent(ui::MouseEvent* event) { break; case ui::ET_MOUSE_ENTERED: + if (event->flags() & ui::EF_TOUCH_ACCESSIBILITY) + NotifyAccessibilityEvent(ui::AX_EVENT_HOVER, true); OnMouseEntered(*event); break; |