OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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_SHELF_SHELF_BEZEL_EVENT_FILTER_H_ | 5 #ifndef ASH_SHELF_SHELF_BEZEL_EVENT_FILTER_H_ |
6 #define ASH_SHELF_SHELF_BEZEL_EVENT_FILTER_H_ | 6 #define ASH_SHELF_SHELF_BEZEL_EVENT_FILTER_H_ |
7 | 7 |
8 #include "ash/wm/gestures/shelf_gesture_handler.h" | 8 #include "ash/wm/gestures/shelf_gesture_handler.h" |
9 #include "ui/events/event_handler.h" | 9 #include "ui/events/event_handler.h" |
10 #include "ui/gfx/rect.h" | 10 #include "ui/gfx/rect.h" |
11 | 11 |
12 namespace ash { | 12 namespace ash { |
13 class ShelfLayoutManager; | 13 class ShelfLayoutManager; |
14 | 14 |
15 // Detects and forwards touch gestures that occur on a bezel sensor to the | 15 // Detects and forwards touch gestures that occur on a bezel sensor to the |
16 // shelf. | 16 // shelf. |
17 class ShelfBezelEventFilter : public ui::EventHandler { | 17 class ShelfBezelEventFilter : public ui::EventHandler { |
18 public: | 18 public: |
19 explicit ShelfBezelEventFilter(ShelfLayoutManager* shelf); | 19 explicit ShelfBezelEventFilter(ShelfLayoutManager* shelf); |
20 virtual ~ShelfBezelEventFilter(); | 20 virtual ~ShelfBezelEventFilter(); |
21 | 21 |
22 // Overridden from ui::EventHandler: | 22 // Overridden from ui::EventHandler: |
23 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE; | 23 virtual void OnGestureEvent(ui::GestureEvent* event) override; |
24 | 24 |
25 private: | 25 private: |
26 bool IsShelfOnBezel(const gfx::Rect& screen, | 26 bool IsShelfOnBezel(const gfx::Rect& screen, |
27 const gfx::Point& point) const; | 27 const gfx::Point& point) const; |
28 | 28 |
29 ShelfLayoutManager* shelf_; // non-owned | 29 ShelfLayoutManager* shelf_; // non-owned |
30 bool in_touch_drag_; | 30 bool in_touch_drag_; |
31 ShelfGestureHandler gesture_handler_; | 31 ShelfGestureHandler gesture_handler_; |
32 DISALLOW_COPY_AND_ASSIGN(ShelfBezelEventFilter); | 32 DISALLOW_COPY_AND_ASSIGN(ShelfBezelEventFilter); |
33 }; | 33 }; |
34 | 34 |
35 } // namespace ash | 35 } // namespace ash |
36 | 36 |
37 #endif // ASH_SHELF_SHELF_BEZEL_EVENT_FILTER_H_ | 37 #endif // ASH_SHELF_SHELF_BEZEL_EVENT_FILTER_H_ |
OLD | NEW |