diff options
author | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-18 06:08:18 +0000 |
---|---|---|
committer | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-18 06:08:18 +0000 |
commit | d44efe090c5dd46b2857aaaca9c939dfbb3cba0b (patch) | |
tree | 2f80a7dbeaebadad5a0755dc3d8b349d31b390fc /ash/launcher | |
parent | efb6409dd196bc229910962753836e9d512905d3 (diff) | |
download | chromium_src-d44efe090c5dd46b2857aaaca9c939dfbb3cba0b.zip chromium_src-d44efe090c5dd46b2857aaaca9c939dfbb3cba0b.tar.gz chromium_src-d44efe090c5dd46b2857aaaca9c939dfbb3cba0b.tar.bz2 |
events: Update mouse-event handlers to not return EventResult.
This is the last step. Once this is done, we can possibly hide EventResult.
BUG=163618
Review URL: https://codereview.chromium.org/11592011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173653 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/launcher')
-rw-r--r-- | ash/launcher/launcher_tooltip_manager.cc | 8 | ||||
-rw-r--r-- | ash/launcher/launcher_tooltip_manager.h | 2 | ||||
-rw-r--r-- | ash/launcher/launcher_tooltip_manager_unittest.cc | 8 |
3 files changed, 8 insertions, 10 deletions
diff --git a/ash/launcher/launcher_tooltip_manager.cc b/ash/launcher/launcher_tooltip_manager.cc index dfc2a4b..2435d4f 100644 --- a/ash/launcher/launcher_tooltip_manager.cc +++ b/ash/launcher/launcher_tooltip_manager.cc @@ -243,11 +243,11 @@ bool LauncherTooltipManager::IsVisible() { return widget_ && widget_->IsVisible(); } -ui::EventResult LauncherTooltipManager::OnMouseEvent(ui::MouseEvent* event) { +void LauncherTooltipManager::OnMouseEvent(ui::MouseEvent* event) { DCHECK(event->target()); DCHECK(event); if (!widget_ || !widget_->IsVisible()) - return ui::ER_UNHANDLED; + return; DCHECK(view_); DCHECK(launcher_view_); @@ -255,7 +255,7 @@ ui::EventResult LauncherTooltipManager::OnMouseEvent(ui::MouseEvent* event) { aura::Window* target = static_cast<aura::Window*>(event->target()); if (widget_->GetNativeWindow()->GetRootWindow() != target->GetRootWindow()) { CloseSoon(); - return ui::ER_UNHANDLED; + return; } gfx::Point location_in_launcher_view = event->location(); @@ -274,8 +274,6 @@ ui::EventResult LauncherTooltipManager::OnMouseEvent(ui::MouseEvent* event) { // the closing event rather than directly calling Close(). CloseSoon(); } - - return ui::ER_UNHANDLED; } void LauncherTooltipManager::OnTouchEvent(ui::TouchEvent* event) { diff --git a/ash/launcher/launcher_tooltip_manager.h b/ash/launcher/launcher_tooltip_manager.h index a4e28c5..efe27f9 100644 --- a/ash/launcher/launcher_tooltip_manager.h +++ b/ash/launcher/launcher_tooltip_manager.h @@ -76,7 +76,7 @@ class ASH_EXPORT LauncherTooltipManager : public ui::EventHandler, protected: // ui::EventHandler overrides: - virtual ui::EventResult OnMouseEvent(ui::MouseEvent* event) OVERRIDE; + virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE; virtual void OnTouchEvent(ui::TouchEvent* event) OVERRIDE; virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE; diff --git a/ash/launcher/launcher_tooltip_manager_unittest.cc b/ash/launcher/launcher_tooltip_manager_unittest.cc index 0fcbe28..249b0a0 100644 --- a/ash/launcher/launcher_tooltip_manager_unittest.cc +++ b/ash/launcher/launcher_tooltip_manager_unittest.cc @@ -204,14 +204,14 @@ TEST_F(LauncherTooltipManagerTest, HideForMouseEvent) { ui::LocatedEvent::TestApi test_api(&mouse_event); SetEventTarget(root_window, &mouse_event); - EXPECT_EQ(ui::ER_UNHANDLED, - event_handler->OnMouseEvent(&mouse_event)); + event_handler->OnMouseEvent(&mouse_event); + EXPECT_FALSE(mouse_event.handled()); EXPECT_TRUE(TooltipIsVisible()); // Should hide if the mouse is out of the tooltip. test_api.set_location(tooltip_rect.origin() + gfx::Vector2d(-1, -1)); - EXPECT_EQ(ui::ER_UNHANDLED, - event_handler->OnMouseEvent(&mouse_event)); + event_handler->OnMouseEvent(&mouse_event); + EXPECT_FALSE(mouse_event.handled()); RunAllPendingInMessageLoop(); EXPECT_FALSE(TooltipIsVisible()); } |