diff options
Diffstat (limited to 'ash')
-rw-r--r-- | ash/wm/system_gesture_event_filter.cc | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/ash/wm/system_gesture_event_filter.cc b/ash/wm/system_gesture_event_filter.cc index 14941cf..871129f 100644 --- a/ash/wm/system_gesture_event_filter.cc +++ b/ash/wm/system_gesture_event_filter.cc @@ -41,7 +41,7 @@ namespace { using views::Widget; -const int kSystemPinchPoints = 4; +const int kSystemGesturePoints = 4; const int kAffordanceOuterRadius = 60; const int kAffordanceInnerRadius = 50; @@ -376,7 +376,7 @@ class SystemPinchHandler { switch (event.type()) { case ui::ET_GESTURE_END: { - if (event.details().touch_points() > kSystemPinchPoints) + if (event.details().touch_points() > kSystemGesturePoints) break; if (phantom_state_ == PHANTOM_WINDOW_MAXIMIZED) { @@ -598,6 +598,24 @@ ui::GestureStatus SystemGestureEventFilter::PreHandleGestureEvent( if (!system_target) return ui::GESTURE_STATUS_UNKNOWN; + RootWindowController* root_controller = + wm::GetRootWindowController(system_target->GetRootWindow()); + CHECK(root_controller); + aura::Window* desktop_container = root_controller->GetContainer( + ash::internal::kShellWindowId_DesktopBackgroundContainer); + if (desktop_container->Contains(system_target)) { + // The gesture was on the desktop window. + if (event->type() == ui::ET_GESTURE_MULTIFINGER_SWIPE && + event->details().swipe_up() && + event->details().touch_points() == kSystemGesturePoints) { + ash::AcceleratorController* accelerator = + ash::Shell::GetInstance()->accelerator_controller(); + if (accelerator->PerformAction(CYCLE_BACKWARD_MRU, ui::Accelerator())) + return ui::GESTURE_STATUS_CONSUMED; + } + return ui::GESTURE_STATUS_UNKNOWN; + } + WindowPinchHandlerMap::iterator find = pinch_handlers_.find(system_target); if (find != pinch_handlers_.end()) { SystemGestureStatus status = @@ -607,7 +625,7 @@ ui::GestureStatus SystemGestureEventFilter::PreHandleGestureEvent( return ui::GESTURE_STATUS_CONSUMED; } else { if (event->type() == ui::ET_GESTURE_BEGIN && - event->details().touch_points() >= kSystemPinchPoints) { + event->details().touch_points() >= kSystemGesturePoints) { pinch_handlers_[system_target] = new SystemPinchHandler(system_target); system_target->AddObserver(this); return ui::GESTURE_STATUS_CONSUMED; |