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