| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/wm/gestures/overview_gesture_handler.h" | 5 #include "ash/wm/gestures/overview_gesture_handler.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/shell_port.h" |
| 8 #include "ash/wm/overview/window_selector_controller.h" | 9 #include "ash/wm/overview/window_selector_controller.h" |
| 9 #include "ash/wm_shell.h" | |
| 10 #include "ui/events/event.h" | 10 #include "ui/events/event.h" |
| 11 #include "ui/events/event_constants.h" | 11 #include "ui/events/event_constants.h" |
| 12 | 12 |
| 13 namespace ash { | 13 namespace ash { |
| 14 | 14 |
| 15 // The threshold before engaging overview with a touchpad three-finger scroll. | 15 // The threshold before engaging overview with a touchpad three-finger scroll. |
| 16 const float OverviewGestureHandler::vertical_threshold_pixels_ = 300; | 16 const float OverviewGestureHandler::vertical_threshold_pixels_ = 300; |
| 17 | 17 |
| 18 // The threshold before moving selector horizontally when using a touchpad | 18 // The threshold before moving selector horizontally when using a touchpad |
| 19 // three-finger scroll. | 19 // three-finger scroll. |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 return false; | 59 return false; |
| 60 } else { | 60 } else { |
| 61 if (scroll_y_ > 0) | 61 if (scroll_y_ > 0) |
| 62 scroll_x_ = scroll_y_ = 0; | 62 scroll_x_ = scroll_y_ = 0; |
| 63 if (scroll_y_ > -vertical_threshold_pixels_) | 63 if (scroll_y_ > -vertical_threshold_pixels_) |
| 64 return false; | 64 return false; |
| 65 } | 65 } |
| 66 | 66 |
| 67 // Reset scroll amount on toggling. | 67 // Reset scroll amount on toggling. |
| 68 scroll_x_ = scroll_y_ = 0; | 68 scroll_x_ = scroll_y_ = 0; |
| 69 WmShell::Get()->RecordUserMetricsAction(UMA_TOUCHPAD_GESTURE_OVERVIEW); | 69 ShellPort::Get()->RecordUserMetricsAction(UMA_TOUCHPAD_GESTURE_OVERVIEW); |
| 70 if (window_selector_controller->IsSelecting() && | 70 if (window_selector_controller->IsSelecting() && |
| 71 window_selector_controller->AcceptSelection()) { | 71 window_selector_controller->AcceptSelection()) { |
| 72 return true; | 72 return true; |
| 73 } | 73 } |
| 74 window_selector_controller->ToggleOverview(); | 74 window_selector_controller->ToggleOverview(); |
| 75 return true; | 75 return true; |
| 76 } | 76 } |
| 77 | 77 |
| 78 } // namespace ash | 78 } // namespace ash |
| OLD | NEW |