| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #ifndef ASH_WM_GESTURES_EDGE_GESTURE_HANDLER_H_ | 5 #ifndef ASH_WM_GESTURES_EDGE_GESTURE_HANDLER_H_ |
| 6 #define ASH_WM_GESTURES_EDGE_GESTURE_HANDLER_H_ | 6 #define ASH_WM_GESTURES_EDGE_GESTURE_HANDLER_H_ |
| 7 | 7 |
| 8 #include "ash/shelf/shelf_types.h" | 8 #include "ash/shelf/shelf_types.h" |
| 9 #include "ash/wm/gestures/shelf_gesture_handler.h" | 9 #include "ash/wm/gestures/shelf_gesture_handler.h" |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 | 40 |
| 41 // Returns true of the gesture has been handled and it should not be processed | 41 // Returns true of the gesture has been handled and it should not be processed |
| 42 // any farther, false otherwise. | 42 // any farther, false otherwise. |
| 43 bool ProcessGestureEvent(aura::Window* target, const ui::GestureEvent& event); | 43 bool ProcessGestureEvent(aura::Window* target, const ui::GestureEvent& event); |
| 44 | 44 |
| 45 private: | 45 private: |
| 46 // Handle events meant for showing the launcher. Returns true when no further | 46 // Handle events meant for showing the launcher. Returns true when no further |
| 47 // events from this gesture should be sent. | 47 // events from this gesture should be sent. |
| 48 bool HandleLauncherControl(const ui::GestureEvent& event); | 48 bool HandleLauncherControl(const ui::GestureEvent& event); |
| 49 | 49 |
| 50 // Handle events meant for engaging immerisive mode. Returns true when no |
| 51 // further events from this gesture should be sent. |
| 52 bool HandleImmersiveControl(aura::Window* target, |
| 53 const ui::GestureEvent& event); |
| 54 |
| 50 // Handle a gesture begin event. | 55 // Handle a gesture begin event. |
| 51 bool HandleEdgeGestureStart(aura::Window* target, | 56 bool HandleEdgeGestureStart(aura::Window* target, |
| 52 const ui::GestureEvent& event); | 57 const ui::GestureEvent& event); |
| 53 | 58 |
| 54 // Determine the gesture orientation (if not yet done). | 59 // Determine the gesture orientation (if not yet done). |
| 55 // Returns true when the orientation has been successfully determined. | 60 // Returns true when the orientation has been successfully determined. |
| 56 bool DetermineGestureOrientation(const ui::GestureEvent& event); | 61 bool DetermineGestureOrientation(const ui::GestureEvent& event); |
| 57 | 62 |
| 58 // Handles a gesture update once the orientation has been found. | 63 // Handles a gesture update once the orientation has been found. |
| 59 bool HandleEdgeGestureUpdate(aura::Window* target, | 64 bool HandleEdgeGestureUpdate(aura::Window* target, |
| 60 const ui::GestureEvent& event); | 65 const ui::GestureEvent& event); |
| 61 | 66 |
| 62 // End a edge gesture. | 67 // End a edge gesture. |
| 63 bool HandleEdgeGestureEnd(aura::Window* target, | 68 bool HandleEdgeGestureEnd(aura::Window* target, |
| 64 const ui::GestureEvent& event); | 69 const ui::GestureEvent& event); |
| 65 | 70 |
| 66 // Check that gesture starts near enough to the edge of the screen to be | 71 // Check that gesture starts near enough to the edge of the screen to be |
| 67 // handled here. If so, set |start_location_| and return true, otherwise | 72 // handled here. If so, set |start_location_| and return true, otherwise |
| 68 // return false. | 73 // return false. |
| 69 bool GestureStartInEdgeArea(const gfx::Rect& screen, | 74 bool GestureStartInEdgeArea(const gfx::Rect& screen, |
| 70 const ui::GestureEvent& event); | 75 const ui::GestureEvent& event); |
| 71 | 76 |
| 72 // Test if the gesture orientation makes sense to be dragging in or out the | 77 // Test if the gesture orientation makes sense to be dragging in or out the |
| 73 // launcher. | 78 // launcher. |
| 74 bool IsGestureInLauncherOrientation(const ui::GestureEvent& event); | 79 bool IsGestureInLauncherOrientation(const ui::GestureEvent& event); |
| 75 | 80 |
| 81 // Test if the gesture orientation makes sense to be engaging immersive mode. |
| 82 bool IsGestureInImmersiveOrientation(const ui::GestureEvent& event); |
| 83 |
| 76 // Which edges the gesture is close to. | 84 // Which edges the gesture is close to. |
| 77 unsigned int start_location_; | 85 unsigned int start_location_; |
| 78 | 86 |
| 79 // Orientation relative to the screen that the gesture is moving in | 87 // Orientation relative to the screen that the gesture is moving in |
| 80 EdgeScrollOrientation orientation_; | 88 EdgeScrollOrientation orientation_; |
| 81 ShelfGestureHandler shelf_handler_; | 89 ShelfGestureHandler shelf_handler_; |
| 82 | 90 |
| 83 DISALLOW_COPY_AND_ASSIGN(EdgeGestureHandler); | 91 DISALLOW_COPY_AND_ASSIGN(EdgeGestureHandler); |
| 84 }; | 92 }; |
| 85 | 93 |
| 86 } // namespace internal | 94 } // namespace internal |
| 87 } // namespace ash | 95 } // namespace ash |
| 88 | 96 |
| 89 #endif // ASH_WM_GESTURES_EDGE_GESTURE_HANDLER_H_ | 97 #endif // ASH_WM_GESTURES_EDGE_GESTURE_HANDLER_H_ |
| OLD | NEW |