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_HANDLER_H_ | 5 #ifndef ASH_SHELF_SHELF_BEZEL_EVENT_HANDLER_H_ |
6 #define ASH_SHELF_SHELF_BEZEL_EVENT_HANDLER_H_ | 6 #define ASH_SHELF_SHELF_BEZEL_EVENT_HANDLER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "ui/events/event_handler.h" | 9 #include "ui/events/event_handler.h" |
10 | 10 |
11 namespace gfx { | 11 namespace gfx { |
12 class Point; | 12 class Point; |
13 class Rect; | 13 class Rect; |
14 } | 14 } |
15 | 15 |
16 namespace ash { | 16 namespace ash { |
17 class WmShelf; | 17 class Shelf; |
18 | 18 |
19 // Forwards touch gestures on a bezel sensor to the shelf. | 19 // Forwards touch gestures on a bezel sensor to the shelf. |
20 class ShelfBezelEventHandler : public ui::EventHandler { | 20 class ShelfBezelEventHandler : public ui::EventHandler { |
21 public: | 21 public: |
22 explicit ShelfBezelEventHandler(WmShelf* shelf); | 22 explicit ShelfBezelEventHandler(Shelf* shelf); |
23 ~ShelfBezelEventHandler() override; | 23 ~ShelfBezelEventHandler() override; |
24 | 24 |
25 // Overridden from ui::EventHandler: | 25 // Overridden from ui::EventHandler: |
26 void OnGestureEvent(ui::GestureEvent* event) override; | 26 void OnGestureEvent(ui::GestureEvent* event) override; |
27 | 27 |
28 private: | 28 private: |
29 bool IsShelfOnBezel(const gfx::Rect& screen, const gfx::Point& point) const; | 29 bool IsShelfOnBezel(const gfx::Rect& screen, const gfx::Point& point) const; |
30 | 30 |
31 WmShelf* shelf_; | 31 Shelf* shelf_; |
32 bool in_touch_drag_; | 32 bool in_touch_drag_; |
33 | 33 |
34 DISALLOW_COPY_AND_ASSIGN(ShelfBezelEventHandler); | 34 DISALLOW_COPY_AND_ASSIGN(ShelfBezelEventHandler); |
35 }; | 35 }; |
36 | 36 |
37 } // namespace ash | 37 } // namespace ash |
38 | 38 |
39 #endif // ASH_SHELF_SHELF_BEZEL_EVENT_HANDLER_H_ | 39 #endif // ASH_SHELF_SHELF_BEZEL_EVENT_HANDLER_H_ |
OLD | NEW |