Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(280)

Side by Side Diff: ui/events/ozone/event_factory_ozone.h

Issue 133233008: evdev: Move EventConverterOzone ownership from EventFactoryOzone to subclass (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: unbreak events_unittests Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/events/ozone/event_converter_ozone.h ('k') | ui/events/ozone/event_factory_ozone.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « ui/events/ozone/event_converter_ozone.h ('k') | ui/events/ozone/event_factory_ozone.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698