OLD | NEW |
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 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 | 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 #include <gdk/gdk.h> | 5 #include <gdk/gdk.h> |
6 #include <gflags/gflags.h> | 6 #include <gflags/gflags.h> |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <syslog.h> | 9 #include <syslog.h> |
10 | 10 |
11 // Defines from syslog.h that conflict with base/logging.h. Ugh. | 11 // Defines from syslog.h that conflict with base/logging.h. Ugh. |
12 #undef LOG_INFO | 12 #undef LOG_INFO |
13 #undef LOG_WARNING | 13 #undef LOG_WARNING |
14 | 14 |
15 #include "base/command_line.h" | 15 #include "base/command_line.h" |
16 #include "base/logging.h" | 16 #include "base/logging.h" |
17 #include "base/string_util.h" | 17 #include "base/string_util.h" |
18 #include "cros/chromeos_cros_api.h" | 18 #include "cros/chromeos_cros_api.h" |
19 #include "power_manager/ambient_light_sensor.h" | 19 #include "power_manager/ambient_light_sensor.h" |
20 #include "power_manager/backlight.h" | 20 #include "power_manager/backlight.h" |
| 21 #include "power_manager/monitor_reconfigure.h" |
21 #include "power_manager/powerd.h" | 22 #include "power_manager/powerd.h" |
22 | 23 |
23 #ifndef VCSID | 24 #ifndef VCSID |
24 #define VCSID "<not set>" | 25 #define VCSID "<not set>" |
25 #endif | 26 #endif |
26 | 27 |
27 using std::string; | 28 using std::string; |
28 | 29 |
29 DEFINE_string(prefs_dir, "", | 30 DEFINE_string(prefs_dir, "", |
30 "Directory to store settings."); | 31 "Directory to store settings."); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 LOG_IF(WARNING, !backlight_ctl.Init()) << "Cannot initialize backlight " | 95 LOG_IF(WARNING, !backlight_ctl.Init()) << "Cannot initialize backlight " |
95 "controller"; | 96 "controller"; |
96 power_manager::AmbientLightSensor als(&backlight_ctl); | 97 power_manager::AmbientLightSensor als(&backlight_ctl); |
97 if (!als.Init()) | 98 if (!als.Init()) |
98 LOG(WARNING) << "Cannot initialize light sensor"; | 99 LOG(WARNING) << "Cannot initialize light sensor"; |
99 power_manager::VideoDetector video_detector; | 100 power_manager::VideoDetector video_detector; |
100 video_detector.Init(); | 101 video_detector.Init(); |
101 MetricsLibrary metrics_lib; | 102 MetricsLibrary metrics_lib; |
102 metrics_lib.Init(); | 103 metrics_lib.Init(); |
103 FilePath run_dir(FLAGS_run_dir); | 104 FilePath run_dir(FLAGS_run_dir); |
| 105 power_manager::MonitorReconfigureMain monitor_reconfigure(&backlight_ctl); |
| 106 if (!monitor_reconfigure.Init()) |
| 107 LOG(WARNING) << "Cannot initialize monitor reconfigure"; |
104 power_manager::Daemon daemon(&backlight_ctl, &prefs, &metrics_lib, | 108 power_manager::Daemon daemon(&backlight_ctl, &prefs, &metrics_lib, |
105 &video_detector, run_dir); | 109 &video_detector, &monitor_reconfigure, run_dir); |
106 daemon.Init(); | 110 daemon.Init(); |
107 daemon.Run(); | 111 daemon.Run(); |
108 return 0; | 112 return 0; |
109 } | 113 } |
OLD | NEW |