| 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_HANDLER_H_ |
| 6 #define ASH_SHELF_SHELF_BEZEL_EVENT_FILTER_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 ShelfLayoutManager; | 17 class WmShelf; |
| 18 | 18 |
| 19 // Detects and forwards touch gestures that occur on a bezel sensor to the | 19 // Forwards touch gestures on a bezel sensor to the shelf. |
| 20 // shelf. | 20 class ShelfBezelEventHandler : public ui::EventHandler { |
| 21 class ShelfBezelEventFilter : public ui::EventHandler { | |
| 22 public: | 21 public: |
| 23 explicit ShelfBezelEventFilter(ShelfLayoutManager* shelf_layout_manager); | 22 explicit ShelfBezelEventHandler(WmShelf* shelf); |
| 24 ~ShelfBezelEventFilter() override; | 23 ~ShelfBezelEventHandler() override; |
| 25 | 24 |
| 26 // Overridden from ui::EventHandler: | 25 // Overridden from ui::EventHandler: |
| 27 void OnGestureEvent(ui::GestureEvent* event) override; | 26 void OnGestureEvent(ui::GestureEvent* event) override; |
| 28 | 27 |
| 29 private: | 28 private: |
| 30 bool IsShelfOnBezel(const gfx::Rect& screen, const gfx::Point& point) const; | 29 bool IsShelfOnBezel(const gfx::Rect& screen, const gfx::Point& point) const; |
| 31 | 30 |
| 32 ShelfLayoutManager* shelf_layout_manager_; | 31 WmShelf* shelf_; |
| 33 bool in_touch_drag_; | 32 bool in_touch_drag_; |
| 34 | 33 |
| 35 DISALLOW_COPY_AND_ASSIGN(ShelfBezelEventFilter); | 34 DISALLOW_COPY_AND_ASSIGN(ShelfBezelEventHandler); |
| 36 }; | 35 }; |
| 37 | 36 |
| 38 } // namespace ash | 37 } // namespace ash |
| 39 | 38 |
| 40 #endif // ASH_SHELF_SHELF_BEZEL_EVENT_FILTER_H_ | 39 #endif // ASH_SHELF_SHELF_BEZEL_EVENT_HANDLER_H_ |
| OLD | NEW |