OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 UI_OZONE_PLATFORM_CACA_CACA_EVENT_FACTORY_H_ | 5 #ifndef UI_OZONE_PLATFORM_CACA_CACA_EVENT_FACTORY_H_ |
6 #define UI_OZONE_PLATFORM_CACA_CACA_EVENT_FACTORY_H_ | 6 #define UI_OZONE_PLATFORM_CACA_CACA_EVENT_FACTORY_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
10 #include "ui/events/ozone/event_factory_ozone.h" | 10 #include "ui/events/ozone/event_factory_ozone.h" |
11 #include "ui/events/platform/platform_event_source.h" | 11 #include "ui/events/platform/platform_event_source.h" |
12 #include "ui/gfx/geometry/point_f.h" | 12 #include "ui/gfx/geometry/point_f.h" |
13 | 13 |
14 namespace ui { | 14 namespace ui { |
15 | 15 |
16 class CacaConnection; | 16 class CacaConnection; |
17 | 17 |
18 class CacaEventFactory : public EventFactoryOzone, PlatformEventSource { | 18 class CacaEventFactory : public EventFactoryOzone, |
| 19 public PlatformEventSource { |
19 public: | 20 public: |
20 CacaEventFactory(CacaConnection* connection); | 21 CacaEventFactory(CacaConnection* connection); |
21 virtual ~CacaEventFactory(); | 22 virtual ~CacaEventFactory(); |
22 | 23 |
23 // ui::EventFactoryOzone overrides: | 24 // ui::EventFactoryOzone: |
24 virtual void StartProcessingEvents() OVERRIDE; | |
25 virtual void WarpCursorTo(gfx::AcceleratedWidget widget, | 25 virtual void WarpCursorTo(gfx::AcceleratedWidget widget, |
26 const gfx::PointF& location) OVERRIDE; | 26 const gfx::PointF& location) OVERRIDE; |
27 | 27 |
28 private: | 28 private: |
| 29 // PlatformEventSource: |
| 30 virtual void OnDispatcherListChanged() OVERRIDE; |
| 31 |
29 void ScheduleEventProcessing(); | 32 void ScheduleEventProcessing(); |
30 | 33 |
31 void TryProcessingEvent(); | 34 void TryProcessingEvent(); |
32 | 35 |
33 CacaConnection* connection_; // Not owned. | 36 CacaConnection* connection_; // Not owned. |
34 | 37 |
35 base::WeakPtrFactory<CacaEventFactory> weak_ptr_factory_; | 38 base::WeakPtrFactory<CacaEventFactory> weak_ptr_factory_; |
36 | 39 |
37 // Delay between event polls. | 40 // Delay between event polls. |
38 base::TimeDelta delay_; | 41 base::TimeDelta delay_; |
39 | 42 |
40 // Keep track of last cursor position to dispatch correct mouse push/release | 43 // Keep track of last cursor position to dispatch correct mouse push/release |
41 // events. | 44 // events. |
42 gfx::PointF last_cursor_location_; | 45 gfx::PointF last_cursor_location_; |
43 | 46 |
44 int modifier_flags_; | 47 int modifier_flags_; |
45 | 48 |
46 DISALLOW_COPY_AND_ASSIGN(CacaEventFactory); | 49 DISALLOW_COPY_AND_ASSIGN(CacaEventFactory); |
47 }; | 50 }; |
48 | 51 |
49 } // namespace ui | 52 } // namespace ui |
50 | 53 |
51 #endif // UI_OZONE_PLATFORM_CACA_CACA_EVENT_FACTORY_H_ | 54 #endif // UI_OZONE_PLATFORM_CACA_CACA_EVENT_FACTORY_H_ |
OLD | NEW |