| 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 20 matching lines...) Expand all Loading... |
| 31 // an EventFactoryOzone but not all of them should process events. In chrome, | 31 // an EventFactoryOzone but not all of them should process events. In chrome, |
| 32 // events are dispatched in the browser process on the UI thread. | 32 // events are dispatched in the browser process on the UI thread. |
| 33 virtual void StartProcessingEvents(); | 33 virtual void StartProcessingEvents(); |
| 34 | 34 |
| 35 // Returns the static instance last set using SetInstance(). | 35 // Returns the static instance last set using SetInstance(). |
| 36 static EventFactoryOzone* GetInstance(); | 36 static EventFactoryOzone* GetInstance(); |
| 37 | 37 |
| 38 // Sets the implementation delegate. Ownership is retained by the caller. | 38 // Sets the implementation delegate. Ownership is retained by the caller. |
| 39 static void SetInstance(EventFactoryOzone*); | 39 static void SetInstance(EventFactoryOzone*); |
| 40 | 40 |
| 41 // Add an |EventConverterOzone| instances for the given file descriptor. | |
| 42 // Transfers ownership of the |EventConverterOzone| to this class. | |
| 43 void AddEventConverter(int fd, scoped_ptr<EventConverterOzone> converter); | |
| 44 | |
| 45 // Remote the |EventConverterOzone| | |
| 46 void RemoveEventConverter(int fd); | |
| 47 | |
| 48 private: | 41 private: |
| 49 // |EventConverterOzone| for each file descriptor. | |
| 50 typedef EventConverterOzone* Converter; | |
| 51 typedef base::MessagePumpLibevent::FileDescriptorWatcher* FDWatcher; | |
| 52 std::map<int, Converter> converters_; | |
| 53 std::map<int, FDWatcher> watchers_; | |
| 54 | |
| 55 static EventFactoryOzone* impl_; // not owned | 42 static EventFactoryOzone* impl_; // not owned |
| 56 | 43 |
| 57 DISALLOW_COPY_AND_ASSIGN(EventFactoryOzone); | 44 DISALLOW_COPY_AND_ASSIGN(EventFactoryOzone); |
| 58 }; | 45 }; |
| 59 | 46 |
| 60 } // namespace ui | 47 } // namespace ui |
| 61 | 48 |
| 62 #endif // UI_EVENTS_OZONE_EVENT_FACTORY_OZONE_H_ | 49 #endif // UI_EVENTS_OZONE_EVENT_FACTORY_OZONE_H_ |
| OLD | NEW |