OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2011 The Chromium OS Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef POWER_MANAGER_UDEV_CONTROLLER_H_ | |
6 #define POWER_MANAGER_UDEV_CONTROLLER_H_ | |
7 | |
8 #include <glib.h> | |
9 #include <libudev.h> | |
10 #include <string> | |
tfarina
2011/04/15 15:00:37
please, add a line between libudev.h and string.
marcheu
2011/04/15 17:32:23
Done.
| |
11 | |
12 #include "base/basictypes.h" | |
13 | |
14 namespace power_manager { | |
15 | |
16 class UdevDelegate { | |
17 public: | |
18 virtual ~UdevDelegate() {} | |
19 virtual void Run(GIOChannel* source, GIOCondition condition) = 0; | |
20 }; | |
21 | |
22 class UdevController { | |
23 public: | |
24 UdevController(UdevDelegate* delegate, const std::string& subsystem); | |
25 ~UdevController(); | |
26 bool Init(); | |
tfarina
2011/04/15 15:00:37
please add a line above.
marcheu
2011/04/15 17:32:23
Done.
| |
27 | |
28 private: | |
29 static gboolean EventHandler(GIOChannel* source, | |
30 GIOCondition condition, | |
31 gpointer data); | |
32 | |
33 // Delegate for udev event; not owned. | |
34 UdevDelegate* delegate_; | |
35 | |
36 struct udev_monitor* monitor_; | |
37 struct udev* udev_; | |
38 std::string subsystem_; | |
tfarina
2011/04/15 15:00:37
I'd suggest moving this to line 35 (so it matches
marcheu
2011/04/15 17:32:23
Done.
| |
39 | |
40 DISALLOW_COPY_AND_ASSIGN(UdevController); | |
41 }; | |
42 | |
43 } // namespace power_manager | |
44 | |
45 #endif // POWER_MANAGER_UDEV_CONTROLLER_H_ | |
OLD | NEW |