OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "app/system_monitor.h" | 5 #include "ui/base/system_monitor/system_monitor.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/time.h" | 9 #include "base/time.h" |
10 | 10 |
| 11 namespace ui { |
| 12 |
11 static SystemMonitor* g_system_monitor = NULL; | 13 static SystemMonitor* g_system_monitor = NULL; |
12 | 14 |
13 #if defined(ENABLE_BATTERY_MONITORING) | 15 #if defined(ENABLE_BATTERY_MONITORING) |
14 // The amount of time (in ms) to wait before running the initial | 16 // The amount of time (in ms) to wait before running the initial |
15 // battery check. | 17 // battery check. |
16 static int kDelayedBatteryCheckMs = 10 * 1000; | 18 static int kDelayedBatteryCheckMs = 10 * 1000; |
17 #endif // defined(ENABLE_BATTERY_MONITORING) | 19 #endif // defined(ENABLE_BATTERY_MONITORING) |
18 | 20 |
19 SystemMonitor::SystemMonitor() | 21 SystemMonitor::SystemMonitor() |
20 : observer_list_(new ObserverListThreadSafe<PowerObserver>()), | 22 : observer_list_(new ObserverListThreadSafe<PowerObserver>()), |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 } | 97 } |
96 | 98 |
97 void SystemMonitor::NotifyResume() { | 99 void SystemMonitor::NotifyResume() { |
98 VLOG(1) << "Power Resuming"; | 100 VLOG(1) << "Power Resuming"; |
99 observer_list_->Notify(&PowerObserver::OnResume); | 101 observer_list_->Notify(&PowerObserver::OnResume); |
100 } | 102 } |
101 | 103 |
102 void SystemMonitor::BatteryCheck() { | 104 void SystemMonitor::BatteryCheck() { |
103 ProcessPowerMessage(SystemMonitor::POWER_STATE_EVENT); | 105 ProcessPowerMessage(SystemMonitor::POWER_STATE_EVENT); |
104 } | 106 } |
| 107 |
| 108 } // namespace ui |
OLD | NEW |