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_TWO_FINGER_DRAG_HANDLER_H_
6 #define ASH_WM_GESTURES_TWO_FINGER_DRAG_HANDLER_H_
8 #include "base/basictypes.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "ui/aura/window_observer.h"
26 // This handles 2-finger drag gestures to move toplevel windows.
27 class TwoFingerDragHandler
: public aura::WindowObserver
{
29 TwoFingerDragHandler();
30 virtual ~TwoFingerDragHandler();
32 // 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
34 // processed any farther, false otherwise.
35 bool ProcessGestureEvent(aura::Window
* target
, const ui::GestureEvent
& event
);
40 // Overridden from aura::WindowObserver.
41 virtual void OnWindowVisibilityChanged(aura::Window
* window
,
42 bool visible
) OVERRIDE
;
43 virtual void OnWindowDestroying(aura::Window
* window
) OVERRIDE
;
45 int first_finger_hittest_
;
47 scoped_ptr
<WindowResizer
> window_resizer_
;
49 DISALLOW_COPY_AND_ASSIGN(TwoFingerDragHandler
);
55 #endif // ASH_WM_GESTURES_TWO_FINGER_DRAG_HANDLER_H_