OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 UI_EVENTS_OZONE_EVENT_FACTORY_OZONE_H_ | 5 #ifndef UI_EVENTS_OZONE_EVENT_FACTORY_OZONE_H_ |
6 #define UI_EVENTS_OZONE_EVENT_FACTORY_OZONE_H_ | 6 #define UI_EVENTS_OZONE_EVENT_FACTORY_OZONE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/message_loop/message_pump_libevent.h" | 11 #include "base/message_loop/message_pump_libevent.h" |
12 #include "base/task_runner.h" | 12 #include "base/task_runner.h" |
13 #include "ui/events/events_export.h" | 13 #include "ui/events/events_export.h" |
14 #include "ui/events/platform/platform_event_source.h" | |
15 #include "ui/gfx/native_widget_types.h" | 14 #include "ui/gfx/native_widget_types.h" |
16 | 15 |
17 namespace gfx { | 16 namespace gfx { |
18 class PointF; | 17 class PointF; |
19 } | 18 } |
20 | 19 |
21 namespace ui { | 20 namespace ui { |
22 | 21 |
23 class Event; | 22 class Event; |
24 | 23 |
25 // Creates and dispatches |ui.Event|'s. Ozone assumes that events arrive on file | 24 // Creates and dispatches |ui.Event|'s. Ozone assumes that events arrive on file |
26 // descriptors with one |EventConverterOzone| instance for each descriptor. | 25 // descriptors with one |EventConverterOzone| instance for each descriptor. |
27 // Ozone presumes that the set of file desctiprtors can vary at runtime so this | 26 // Ozone presumes that the set of file desctiprtors can vary at runtime so this |
28 // class supports dynamically adding and removing |EventConverterOzone| | 27 // class supports dynamically adding and removing |EventConverterOzone| |
29 // instances as necessary. | 28 // instances as necessary. |
30 class EVENTS_EXPORT EventFactoryOzone : public ui::PlatformEventSource { | 29 class EVENTS_EXPORT EventFactoryOzone { |
31 public: | 30 public: |
32 EventFactoryOzone(); | 31 EventFactoryOzone(); |
33 virtual ~EventFactoryOzone(); | 32 virtual ~EventFactoryOzone(); |
34 | 33 |
35 // Called from WindowTreeHostOzone to initialize and start processing events. | 34 // Called from WindowTreeHostOzone to initialize and start processing events. |
36 // This should create the initial set of converters, and potentially arrange | 35 // This should create the initial set of converters, and potentially arrange |
37 // for more converters to be created as new event sources become available. | 36 // for more converters to be created as new event sources become available. |
38 // No events processing should happen until this is called. All processes have | 37 // No events processing should happen until this is called. All processes have |
39 // an EventFactoryOzone but not all of them should process events. In chrome, | 38 // an EventFactoryOzone but not all of them should process events. In chrome, |
40 // events are dispatched in the browser process on the UI thread. | 39 // events are dispatched in the browser process on the UI thread. |
(...skipping 18 matching lines...) Expand all Loading... |
59 | 58 |
60 private: | 59 private: |
61 static EventFactoryOzone* impl_; // not owned | 60 static EventFactoryOzone* impl_; // not owned |
62 | 61 |
63 DISALLOW_COPY_AND_ASSIGN(EventFactoryOzone); | 62 DISALLOW_COPY_AND_ASSIGN(EventFactoryOzone); |
64 }; | 63 }; |
65 | 64 |
66 } // namespace ui | 65 } // namespace ui |
67 | 66 |
68 #endif // UI_EVENTS_OZONE_EVENT_FACTORY_OZONE_H_ | 67 #endif // UI_EVENTS_OZONE_EVENT_FACTORY_OZONE_H_ |
OLD | NEW |