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_TRAY_GESTURE_HANDLER_H_ | 5 #ifndef ASH_WM_GESTURES_TRAY_GESTURE_HANDLER_H_ |
6 #define ASH_WM_GESTURES_TRAY_GESTURE_HANDLER_H_ | 6 #define ASH_WM_GESTURES_TRAY_GESTURE_HANDLER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "ui/views/widget/widget_observer.h" | 10 #include "ui/views/widget/widget_observer.h" |
11 | 11 |
12 namespace ui { | 12 namespace ui { |
13 class GestureEvent; | 13 class GestureEvent; |
14 } | 14 } |
15 | 15 |
16 namespace ash { | 16 namespace ash { |
17 namespace internal { | |
18 | 17 |
19 // Handles gesture events on the shelf to show the system tray bubble. | 18 // Handles gesture events on the shelf to show the system tray bubble. |
20 class TrayGestureHandler : public views::WidgetObserver { | 19 class TrayGestureHandler : public views::WidgetObserver { |
21 public: | 20 public: |
22 TrayGestureHandler(); | 21 TrayGestureHandler(); |
23 virtual ~TrayGestureHandler(); | 22 virtual ~TrayGestureHandler(); |
24 | 23 |
25 // Handles a gesture-update event and updates the dragging state of the tray | 24 // Handles a gesture-update event and updates the dragging state of the tray |
26 // bubble. Returns true if the handler can continue to process gesture events | 25 // bubble. Returns true if the handler can continue to process gesture events |
27 // for the bubble. Returns false if it should no longer receive gesture | 26 // for the bubble. Returns false if it should no longer receive gesture |
28 // events. | 27 // events. |
29 bool UpdateGestureDrag(const ui::GestureEvent& event); | 28 bool UpdateGestureDrag(const ui::GestureEvent& event); |
30 | 29 |
31 void CompleteGestureDrag(const ui::GestureEvent& event); | 30 void CompleteGestureDrag(const ui::GestureEvent& event); |
32 | 31 |
33 private: | 32 private: |
34 virtual void OnWidgetDestroying(views::Widget* widget) OVERRIDE; | 33 virtual void OnWidgetDestroying(views::Widget* widget) OVERRIDE; |
35 | 34 |
36 // The widget for the tray-bubble. | 35 // The widget for the tray-bubble. |
37 views::Widget* widget_; | 36 views::Widget* widget_; |
38 | 37 |
39 // The amount that has been dragged. | 38 // The amount that has been dragged. |
40 float gesture_drag_amount_; | 39 float gesture_drag_amount_; |
41 | 40 |
42 DISALLOW_COPY_AND_ASSIGN(TrayGestureHandler); | 41 DISALLOW_COPY_AND_ASSIGN(TrayGestureHandler); |
43 }; | 42 }; |
44 | 43 |
45 } // namespace internal | |
46 } // namespace ash | 44 } // namespace ash |
47 | 45 |
48 #endif // ASH_WM_GESTURES_TRAY_GESTURE_HANDLER_H_ | 46 #endif // ASH_WM_GESTURES_TRAY_GESTURE_HANDLER_H_ |
OLD | NEW |