| 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" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 // Creates and dispatches |ui.Event|'s. Ozone assumes that events arrive on file | 23 // Creates and dispatches |ui.Event|'s. Ozone assumes that events arrive on file |
| 24 // descriptors with one |EventConverterOzone| instance for each descriptor. | 24 // descriptors with one |EventConverterOzone| instance for each descriptor. |
| 25 // Ozone presumes that the set of file desctiprtors can vary at runtime so this | 25 // Ozone presumes that the set of file desctiprtors can vary at runtime so this |
| 26 // class supports dynamically adding and removing |EventConverterOzone| | 26 // class supports dynamically adding and removing |EventConverterOzone| |
| 27 // instances as necessary. | 27 // instances as necessary. |
| 28 class EVENTS_EXPORT EventFactoryOzone { | 28 class EVENTS_EXPORT EventFactoryOzone { |
| 29 public: | 29 public: |
| 30 EventFactoryOzone(); | 30 EventFactoryOzone(); |
| 31 virtual ~EventFactoryOzone(); | 31 virtual ~EventFactoryOzone(); |
| 32 | 32 |
| 33 // Called from WindowTreeHostOzone to initialize and start processing events. | |
| 34 // This should create the initial set of converters, and potentially arrange | |
| 35 // for more converters to be created as new event sources become available. | |
| 36 // No events processing should happen until this is called. All processes have | |
| 37 // an EventFactoryOzone but not all of them should process events. In chrome, | |
| 38 // events are dispatched in the browser process on the UI thread. | |
| 39 virtual void StartProcessingEvents(); | |
| 40 | |
| 41 // Request to warp the cursor to a location within an AccelerateWidget. | 33 // Request to warp the cursor to a location within an AccelerateWidget. |
| 42 // If the cursor actually moves, the implementation must dispatch a mouse | 34 // If the cursor actually moves, the implementation must dispatch a mouse |
| 43 // move event with the new location. | 35 // move event with the new location. |
| 44 virtual void WarpCursorTo(gfx::AcceleratedWidget widget, | 36 virtual void WarpCursorTo(gfx::AcceleratedWidget widget, |
| 45 const gfx::PointF& location); | 37 const gfx::PointF& location); |
| 46 | 38 |
| 47 // Returns the static instance last set using SetInstance(). | 39 // Returns the static instance last set using SetInstance(). |
| 48 static EventFactoryOzone* GetInstance(); | 40 static EventFactoryOzone* GetInstance(); |
| 49 | 41 |
| 50 // Sets the implementation delegate. Ownership is retained by the caller. | 42 // Sets the implementation delegate. Ownership is retained by the caller. |
| 51 static void SetInstance(EventFactoryOzone*); | 43 static void SetInstance(EventFactoryOzone*); |
| 52 | 44 |
| 53 private: | 45 private: |
| 54 static EventFactoryOzone* impl_; // not owned | 46 static EventFactoryOzone* impl_; // not owned |
| 55 | 47 |
| 56 DISALLOW_COPY_AND_ASSIGN(EventFactoryOzone); | 48 DISALLOW_COPY_AND_ASSIGN(EventFactoryOzone); |
| 57 }; | 49 }; |
| 58 | 50 |
| 59 } // namespace ui | 51 } // namespace ui |
| 60 | 52 |
| 61 #endif // UI_EVENTS_OZONE_EVENT_FACTORY_OZONE_H_ | 53 #endif // UI_EVENTS_OZONE_EVENT_FACTORY_OZONE_H_ |
| OLD | NEW |