| OLD | NEW |
| (Empty) | |
| 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_AUTOCLICK_COMMON_AUTOCLICK_CONTROLLER_COMMON_H |
| 6 #define ASH_AUTOCLICK_COMMON_AUTOCLICK_CONTROLLER_COMMON_H |
| 7 |
| 8 #include "ash/autoclick/common/ash_autoclick_export.h" |
| 9 #include "ash/autoclick/common/autoclick_ring_handler.h" |
| 10 #include "base/macros.h" |
| 11 #include "base/timer/timer.h" |
| 12 #include "ui/gfx/geometry/point.h" |
| 13 |
| 14 namespace views { |
| 15 class Widget; |
| 16 } |
| 17 |
| 18 namespace ui { |
| 19 class MouseEvent; |
| 20 class KeyEvent; |
| 21 class TouchEvent; |
| 22 class GestureEvent; |
| 23 class ScrollEvent; |
| 24 } |
| 25 |
| 26 namespace aura { |
| 27 class Window; |
| 28 } |
| 29 |
| 30 namespace ash { |
| 31 |
| 32 // Autoclick controller common code for ash and mus. |
| 33 class ASH_AUTOCLICK_EXPORT AutoclickControllerCommon { |
| 34 public: |
| 35 AutoclickControllerCommon(); |
| 36 ~AutoclickControllerCommon(); |
| 37 |
| 38 void HandleMouseEvent(const ui::MouseEvent& event, |
| 39 aura::Window* target, |
| 40 views::Widget* widget, |
| 41 base::TimeDelta delay); |
| 42 void HandleKeyEvent(const ui::KeyEvent& event); |
| 43 void HandleTouchEvent(const ui::TouchEvent& event); |
| 44 void HandleGestureEvent(const ui::GestureEvent& event); |
| 45 void HandleScrollEvent(const ui::ScrollEvent& event); |
| 46 |
| 47 void ResetAutoclickTimer(base::Timer* new_timer); |
| 48 void StopAutoclickTimer(); |
| 49 void UpdateAnchorLocation(const gfx::Point& anchor_location); |
| 50 int GetMouseEventFlags(); |
| 51 |
| 52 private: |
| 53 int mouse_event_flags_; |
| 54 std::unique_ptr<base::Timer> autoclick_timer_; |
| 55 // The position in screen coordinates used to determine |
| 56 // the distance the mouse has moved. |
| 57 gfx::Point anchor_location_; |
| 58 std::unique_ptr<AutoclickRingHandler> autoclick_ring_handler_; |
| 59 |
| 60 DISALLOW_COPY_AND_ASSIGN(AutoclickControllerCommon); |
| 61 }; |
| 62 |
| 63 } // namespace ash |
| 64 |
| 65 #endif // ASH_AUTOCLICK_COMMON_AUTOCLICK_CONTROLLER_COMMON_H |
| OLD | NEW |