• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2013 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.
4 
5 #ifndef ASH_WM_GESTURES_OVERVIEW_GESTURE_HANDLER_H_
6 #define ASH_WM_GESTURES_OVERVIEW_GESTURE_HANDLER_H_
7 
8 #include "base/basictypes.h"
9 
10 namespace aura {
11 class Window;
12 }
13 
14 namespace ui {
15 class GestureEvent;
16 class ScrollEvent;
17 }
18 
19 namespace ash {
20 namespace internal {
21 
22 // This handles a 3-finger swipe down gesture from the top of the screen to
23 // enter overview mode.
24 class OverviewGestureHandler {
25  public:
26   OverviewGestureHandler();
27   virtual ~OverviewGestureHandler();
28 
29   // Processes a scroll event and may start overview. Returns true if the event
30   // has been handled and should not be processed further, false otherwise.
31   bool ProcessScrollEvent(const ui::ScrollEvent& event);
32 
33   // Processes a gesture event and may start overview. Returns true if the event
34   // has been handled and should not be processed any farther, false otherwise.
35   bool ProcessGestureEvent(const ui::GestureEvent& event);
36 
37  private:
38   // True if the current/last gesture began in the top bezel.
39   bool in_top_bezel_gesture_;
40 
41   // The total distance scrolled with three fingers.
42   float scroll_x_;
43   float scroll_y_;
44 
45   DISALLOW_COPY_AND_ASSIGN(OverviewGestureHandler);
46 };
47 
48 }  // namespace internal
49 }  // namespace ash
50 
51 #endif  // ASH_WM_GESTURES_OVERVIEW_GESTURE_HANDLER_H_
52