Chromium Code Reviews| 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 14 matching lines...) Expand all Loading... | |
| 25 public: | 25 public: |
| 26 EventFactoryOzone(); | 26 EventFactoryOzone(); |
| 27 ~EventFactoryOzone(); | 27 ~EventFactoryOzone(); |
| 28 | 28 |
| 29 // Sets an optional delegate responsible for creating the starting set of | 29 // Sets an optional delegate responsible for creating the starting set of |
| 30 // EventConvertOzones under management. This permits embedders to override the | 30 // EventConvertOzones under management. This permits embedders to override the |
| 31 // Linux /dev/input/*-based default as desired. The caller must manage the | 31 // Linux /dev/input/*-based default as desired. The caller must manage the |
| 32 // scope of this object. | 32 // scope of this object. |
| 33 static void SetEventFactoryDelegateOzone(EventFactoryDelegateOzone* delegate); | 33 static void SetEventFactoryDelegateOzone(EventFactoryDelegateOzone* delegate); |
| 34 | 34 |
| 35 // Determine name of the delegate requested by user in a command-line flag. | |
| 36 // Embedders can use this to see if they are requested and should inject. | |
| 37 static std::string GetRequestedDelegate(); | |
|
rjkroege
2013/10/18 18:57:55
you're going to change this right?
spang
2013/10/21 18:46:12
Moved to anonymous scope for now.
| |
| 38 | |
| 35 // Called from RootWindowHostOzone to create the starting set of event | 39 // Called from RootWindowHostOzone to create the starting set of event |
| 36 // converters. | 40 // converters. |
| 37 void CreateStartupEventConverters(); | 41 void CreateStartupEventConverters(); |
| 38 | 42 |
| 39 // Add an |EventConverterOzone| instances for the given file descriptor. | 43 // Add an |EventConverterOzone| instances for the given file descriptor. |
| 40 // Transfers ownership of the |EventConverterOzone| to this class. | 44 // Transfers ownership of the |EventConverterOzone| to this class. |
| 41 void AddEventConverter(int fd, scoped_ptr<EventConverterOzone> converter); | 45 void AddEventConverter(int fd, scoped_ptr<EventConverterOzone> converter); |
| 42 | 46 |
| 43 // Remote the |EventConverterOzone| | 47 // Remote the |EventConverterOzone| |
| 44 void RemoveEventConverter(int fd); | 48 void RemoveEventConverter(int fd); |
| 45 | 49 |
| 46 private: | 50 private: |
| 47 // |EventConverterOzone| for each file descriptor. | 51 // |EventConverterOzone| for each file descriptor. |
| 48 typedef EventConverterOzone* Converter; | 52 typedef EventConverterOzone* Converter; |
| 49 typedef base::MessagePumpLibevent::FileDescriptorWatcher* FDWatcher; | 53 typedef base::MessagePumpLibevent::FileDescriptorWatcher* FDWatcher; |
| 50 std::map<int, Converter> converters_; | 54 std::map<int, Converter> converters_; |
| 51 std::map<int, FDWatcher> watchers_; | 55 std::map<int, FDWatcher> watchers_; |
| 52 | 56 |
| 53 static EventFactoryDelegateOzone* delegate_; | 57 static EventFactoryDelegateOzone* delegate_; |
| 54 | 58 |
| 55 DISALLOW_COPY_AND_ASSIGN(EventFactoryOzone); | 59 DISALLOW_COPY_AND_ASSIGN(EventFactoryOzone); |
| 56 }; | 60 }; |
| 57 | 61 |
| 58 } // namespace ui | 62 } // namespace ui |
| 59 | 63 |
| 60 #endif // UI_EVENTS_OZONE_EVENT_FACTORY_OZONE_H_ | 64 #endif // UI_EVENTS_OZONE_EVENT_FACTORY_OZONE_H_ |
| OLD | NEW |