Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / ash / wm / gestures / tray_gesture_handler.h
blob424fc5756fabb14a8a557d9b9125291715e2949f
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
3 // found in the LICENSE file.
5 #ifndef ASH_WM_GESTURES_TRAY_GESTURE_HANDLER_H_
6 #define ASH_WM_GESTURES_TRAY_GESTURE_HANDLER_H_
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "ui/views/widget/widget_observer.h"
12 namespace ui {
13 class GestureEvent;
16 namespace ash {
18 // Handles gesture events on the shelf to show the system tray bubble.
19 class TrayGestureHandler : public views::WidgetObserver {
20 public:
21 TrayGestureHandler();
22 virtual ~TrayGestureHandler();
24 // Handles a gesture-update event and updates the dragging state of the tray
25 // bubble. Returns true if the handler can continue to process gesture events
26 // for the bubble. Returns false if it should no longer receive gesture
27 // events.
28 bool UpdateGestureDrag(const ui::GestureEvent& event);
30 void CompleteGestureDrag(const ui::GestureEvent& event);
32 private:
33 virtual void OnWidgetDestroying(views::Widget* widget) OVERRIDE;
35 // The widget for the tray-bubble.
36 views::Widget* widget_;
38 // The amount that has been dragged.
39 float gesture_drag_amount_;
41 DISALLOW_COPY_AND_ASSIGN(TrayGestureHandler);
44 } // namespace ash
46 #endif // ASH_WM_GESTURES_TRAY_GESTURE_HANDLER_H_