diff options
author | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-12 19:05:17 +0000 |
---|---|---|
committer | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-12 19:05:17 +0000 |
commit | f9f017cec94b86cbc40f279f49be9ced531b1e05 (patch) | |
tree | 3985bfb2f08e95204cf6a8b19120fc616d3e02a9 /ash/wm/app_list_controller.cc | |
parent | 73457ae5545782e903070ac79d6a3999a5338292 (diff) | |
download | chromium_src-f9f017cec94b86cbc40f279f49be9ced531b1e05.zip chromium_src-f9f017cec94b86cbc40f279f49be9ced531b1e05.tar.gz chromium_src-f9f017cec94b86cbc40f279f49be9ced531b1e05.tar.bz2 |
ash: Convert some aura::EventFilters into ui::EventHandlers.
In this CL, the following EventFilters are converted into EventHandlers:
* AcceleratorFilter
* MagnificationControllerImpl
* TrayEventFilter
* TouchObserverHUD
* AppListController
* ShelfLayoutManager::AutoHideEventFilter
* SystemGestureEventFilter
BUG=159632
Review URL: https://codereview.chromium.org/11362196
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167218 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/wm/app_list_controller.cc')
-rw-r--r-- | ash/wm/app_list_controller.cc | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/ash/wm/app_list_controller.cc b/ash/wm/app_list_controller.cc index 7e2d7e4..e0f6fe8 100644 --- a/ash/wm/app_list_controller.cc +++ b/ash/wm/app_list_controller.cc @@ -159,7 +159,7 @@ void AppListController::SetView(app_list::AppListView* view) { view_ = view; views::Widget* widget = view_->GetWidget(); widget->AddObserver(this); - Shell::GetInstance()->AddEnvEventFilter(this); + Shell::GetInstance()->AddPreTargetHandler(this); Launcher::ForWindow(GetWindow())->AddIconObserver(this); widget->GetNativeView()->GetRootWindow()->AddRootWindowObserver(this); widget->GetNativeView()->GetFocusManager()->AddObserver(this); @@ -179,7 +179,7 @@ void AppListController::ResetView() { views::Widget* widget = view_->GetWidget(); widget->RemoveObserver(this); GetLayer(widget)->GetAnimator()->RemoveObserver(this); - Shell::GetInstance()->RemoveEnvEventFilter(this); + Shell::GetInstance()->RemovePreTargetHandler(this); Launcher::ForWindow(GetWindow())->RemoveIconObserver(this); widget->GetNativeView()->GetRootWindow()->RemoveRootWindowObserver(this); widget->GetNativeView()->GetFocusManager()->RemoveObserver(this); @@ -213,10 +213,10 @@ void AppListController::ScheduleAnimation() { widget->SetBounds(target_bounds); } -void AppListController::ProcessLocatedEvent(aura::Window* target, - const ui::LocatedEvent& event) { +void AppListController::ProcessLocatedEvent(ui::LocatedEvent* event) { // If the event happened on a menu, then the event should not close the app // list. + aura::Window* target = static_cast<aura::Window*>(event->target()); if (target) { RootWindowController* root_controller = GetRootWindowController(target->GetRootWindow()); @@ -230,7 +230,7 @@ void AppListController::ProcessLocatedEvent(aura::Window* target, if (view_ && is_visible_) { aura::Window* window = view_->GetWidget()->GetNativeView(); - gfx::Point window_local_point(event.root_location()); + gfx::Point window_local_point(event->root_location()); aura::Window::ConvertPointToTarget(window->GetRootWindow(), window, &window_local_point); @@ -248,29 +248,27 @@ void AppListController::UpdateBounds() { //////////////////////////////////////////////////////////////////////////////// // AppListController, aura::EventFilter implementation: -bool AppListController::PreHandleKeyEvent(aura::Window* target, - ui::KeyEvent* event) { - return false; +ui::EventResult AppListController::OnKeyEvent(ui::KeyEvent* event) { + return ui::ER_UNHANDLED; } -bool AppListController::PreHandleMouseEvent(aura::Window* target, - ui::MouseEvent* event) { +ui::EventResult AppListController::OnMouseEvent(ui::MouseEvent* event) { if (event->type() == ui::ET_MOUSE_PRESSED) - ProcessLocatedEvent(target, *event); - return false; + ProcessLocatedEvent(event); + return ui::ER_UNHANDLED; +} + +ui::EventResult AppListController::OnScrollEvent(ui::ScrollEvent* event) { + return ui::ER_UNHANDLED; } -ui::EventResult AppListController::PreHandleTouchEvent( - aura::Window* target, - ui::TouchEvent* event) { +ui::EventResult AppListController::OnTouchEvent(ui::TouchEvent* event) { return ui::ER_UNHANDLED; } -ui::EventResult AppListController::PreHandleGestureEvent( - aura::Window* target, - ui::GestureEvent* event) { +ui::EventResult AppListController::OnGestureEvent(ui::GestureEvent* event) { if (event->type() == ui::ET_GESTURE_TAP) - ProcessLocatedEvent(target, *event); + ProcessLocatedEvent(event); return ui::ER_UNHANDLED; } |