diff options
author | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-13 16:35:27 +0000 |
---|---|---|
committer | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-13 16:35:27 +0000 |
commit | 304594c8ca8ca017c317dc74cc10d1a3656a14db (patch) | |
tree | ed58a1b95bb9121454340bbfe6598210005a3634 /ash/launcher/launcher_tooltip_manager.cc | |
parent | 2dbd513b86a1105f684c1fe2b031e5e937c53c52 (diff) | |
download | chromium_src-304594c8ca8ca017c317dc74cc10d1a3656a14db.zip chromium_src-304594c8ca8ca017c317dc74cc10d1a3656a14db.tar.gz chromium_src-304594c8ca8ca017c317dc74cc10d1a3656a14db.tar.bz2 |
ash: Convert all remaining EventFilters into EventHandlers.
This CL converts the following list of aura::EventFilters into ui::EventHandlers:
* MouseCursorEventFilter
* DragDropController
* LauncherTooltipManager
* TooltipController
* EventRewriterEventFilter
* OverlayEventFilter
* PanelWindowEventFilter
* SystemModalContainerEventFilter
* UserActivityDetector
* WindowCycleEventFilter
* WindowModalityController
* FrameMaximizeButton::EscapeEventFilter
* TabScrubber
Also remove AddEnvEventFilter/RemoveEnvEventFilter from Shell functions since
all the filters for the shell have been converted.
BUG=159632
Review URL: https://codereview.chromium.org/11366214
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167399 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/launcher/launcher_tooltip_manager.cc')
-rw-r--r-- | ash/launcher/launcher_tooltip_manager.cc | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/ash/launcher/launcher_tooltip_manager.cc b/ash/launcher/launcher_tooltip_manager.cc index f403a8c..a218aba 100644 --- a/ash/launcher/launcher_tooltip_manager.cc +++ b/ash/launcher/launcher_tooltip_manager.cc @@ -149,7 +149,7 @@ LauncherTooltipManager::LauncherTooltipManager( if (shelf_layout_manager) shelf_layout_manager->AddObserver(this); if (Shell::HasInstance()) - Shell::GetInstance()->AddEnvEventFilter(this); + Shell::GetInstance()->AddPreTargetHandler(this); } LauncherTooltipManager::~LauncherTooltipManager() { @@ -158,7 +158,7 @@ LauncherTooltipManager::~LauncherTooltipManager() { if (shelf_layout_manager_) shelf_layout_manager_->RemoveObserver(this); if (Shell::HasInstance()) - Shell::GetInstance()->RemoveEnvEventFilter(this); + Shell::GetInstance()->RemovePreTargetHandler(this); } void LauncherTooltipManager::ShowDelayed(views::View* anchor, @@ -254,25 +254,23 @@ bool LauncherTooltipManager::IsVisible() { return widget_ && widget_->IsVisible(); } -bool LauncherTooltipManager::PreHandleKeyEvent(aura::Window* target, - ui::KeyEvent* event) { - // Not handled. - return false; +ui::EventResult LauncherTooltipManager::OnKeyEvent(ui::KeyEvent* event) { + return ui::ER_UNHANDLED; } -bool LauncherTooltipManager::PreHandleMouseEvent(aura::Window* target, - ui::MouseEvent* event) { - DCHECK(target); +ui::EventResult LauncherTooltipManager::OnMouseEvent(ui::MouseEvent* event) { + DCHECK(event->target()); DCHECK(event); if (!widget_ || !widget_->IsVisible()) - return false; + return ui::ER_UNHANDLED; DCHECK(view_); DCHECK(launcher_view_); + aura::Window* target = static_cast<aura::Window*>(event->target()); if (widget_->GetNativeWindow()->GetRootWindow() != target->GetRootWindow()) { CloseSoon(); - return false; + return ui::ER_UNHANDLED; } gfx::Point location_in_launcher_view = event->location(); @@ -292,18 +290,22 @@ bool LauncherTooltipManager::PreHandleMouseEvent(aura::Window* target, CloseSoon(); } - return false; + return ui::ER_UNHANDLED; +} + +ui::EventResult LauncherTooltipManager::OnScrollEvent(ui::ScrollEvent* event) { + return ui::ER_UNHANDLED; } -ui::EventResult LauncherTooltipManager::PreHandleTouchEvent( - aura::Window* target, ui::TouchEvent* event) { +ui::EventResult LauncherTooltipManager::OnTouchEvent(ui::TouchEvent* event) { + aura::Window* target = static_cast<aura::Window*>(event->target()); if (widget_ && widget_->IsVisible() && widget_->GetNativeWindow() != target) Close(); return ui::ER_UNHANDLED; } -ui::EventResult LauncherTooltipManager::PreHandleGestureEvent( - aura::Window* target, ui::GestureEvent* event) { +ui::EventResult LauncherTooltipManager::OnGestureEvent( + ui::GestureEvent* event) { if (widget_ && widget_->IsVisible()) { // Because this mouse event may arrive to |view_|, here we just schedule // the closing event rather than directly calling Close(). |