OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_TWO_FINGER_DRAG_HANDLER_H_ | 5 #ifndef ASH_WM_GESTURES_TWO_FINGER_DRAG_HANDLER_H_ |
6 #define ASH_WM_GESTURES_TWO_FINGER_DRAG_HANDLER_H_ | 6 #define ASH_WM_GESTURES_TWO_FINGER_DRAG_HANDLER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "ui/aura/window_observer.h" | 10 #include "ui/aura/window_observer.h" |
11 | 11 |
12 namespace aura { | 12 namespace aura { |
13 class Window; | 13 class Window; |
14 } | 14 } |
15 | 15 |
16 namespace ui { | 16 namespace ui { |
17 class GestureEvent; | 17 class GestureEvent; |
18 } | 18 } |
19 | 19 |
| 20 namespace views { |
| 21 namespace corewm { |
| 22 class WindowResizer; |
| 23 } |
| 24 } |
| 25 |
20 namespace ash { | 26 namespace ash { |
21 | 27 |
22 class WindowResizer; | |
23 | |
24 namespace internal { | 28 namespace internal { |
25 | 29 |
26 // This handles 2-finger drag gestures to move toplevel windows. | 30 // This handles 2-finger drag gestures to move toplevel windows. |
27 class TwoFingerDragHandler : public aura::WindowObserver { | 31 class TwoFingerDragHandler : public aura::WindowObserver { |
28 public: | 32 public: |
29 TwoFingerDragHandler(); | 33 TwoFingerDragHandler(); |
30 virtual ~TwoFingerDragHandler(); | 34 virtual ~TwoFingerDragHandler(); |
31 | 35 |
32 // Processes a gesture event and starts a drag, or updates/ends an in-progress | 36 // Processes a gesture event and starts a drag, or updates/ends an in-progress |
33 // drag. Returns true if the event has been handled and should not be | 37 // drag. Returns true if the event has been handled and should not be |
34 // processed any farther, false otherwise. | 38 // processed any farther, false otherwise. |
35 bool ProcessGestureEvent(aura::Window* target, const ui::GestureEvent& event); | 39 bool ProcessGestureEvent(aura::Window* target, const ui::GestureEvent& event); |
36 | 40 |
37 private: | 41 private: |
38 void Reset(); | 42 void Reset(); |
39 | 43 |
40 // Overridden from aura::WindowObserver. | 44 // Overridden from aura::WindowObserver. |
41 virtual void OnWindowVisibilityChanged(aura::Window* window, | 45 virtual void OnWindowVisibilityChanged(aura::Window* window, |
42 bool visible) OVERRIDE; | 46 bool visible) OVERRIDE; |
43 virtual void OnWindowDestroying(aura::Window* window) OVERRIDE; | 47 virtual void OnWindowDestroying(aura::Window* window) OVERRIDE; |
44 | 48 |
45 int first_finger_hittest_; | 49 int first_finger_hittest_; |
46 | 50 |
47 scoped_ptr<WindowResizer> window_resizer_; | 51 scoped_ptr<views::corewm::WindowResizer> window_resizer_; |
48 | 52 |
49 DISALLOW_COPY_AND_ASSIGN(TwoFingerDragHandler); | 53 DISALLOW_COPY_AND_ASSIGN(TwoFingerDragHandler); |
50 }; | 54 }; |
51 | 55 |
52 } | 56 } |
53 } // namespace ash | 57 } // namespace ash |
54 | 58 |
55 #endif // ASH_WM_GESTURES_TWO_FINGER_DRAG_HANDLER_H_ | 59 #endif // ASH_WM_GESTURES_TWO_FINGER_DRAG_HANDLER_H_ |
OLD | NEW |