OLD | NEW |
1 // Copyright (c) 2011 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 "base/system_monitor/system_monitor.h" | 5 #include "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 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 | 79 |
80 void SystemMonitor::AddObserver(PowerObserver* obs) { | 80 void SystemMonitor::AddObserver(PowerObserver* obs) { |
81 observer_list_->AddObserver(obs); | 81 observer_list_->AddObserver(obs); |
82 } | 82 } |
83 | 83 |
84 void SystemMonitor::RemoveObserver(PowerObserver* obs) { | 84 void SystemMonitor::RemoveObserver(PowerObserver* obs) { |
85 observer_list_->RemoveObserver(obs); | 85 observer_list_->RemoveObserver(obs); |
86 } | 86 } |
87 | 87 |
88 void SystemMonitor::NotifyPowerStateChange() { | 88 void SystemMonitor::NotifyPowerStateChange() { |
89 VLOG(1) << "PowerStateChange: " << (BatteryPower() ? "On" : "Off") | 89 DVLOG(1) << "PowerStateChange: " << (BatteryPower() ? "On" : "Off") |
90 << " battery"; | 90 << " battery"; |
91 observer_list_->Notify(&PowerObserver::OnPowerStateChange, BatteryPower()); | 91 observer_list_->Notify(&PowerObserver::OnPowerStateChange, BatteryPower()); |
92 } | 92 } |
93 | 93 |
94 void SystemMonitor::NotifySuspend() { | 94 void SystemMonitor::NotifySuspend() { |
95 VLOG(1) << "Power Suspending"; | 95 DVLOG(1) << "Power Suspending"; |
96 observer_list_->Notify(&PowerObserver::OnSuspend); | 96 observer_list_->Notify(&PowerObserver::OnSuspend); |
97 } | 97 } |
98 | 98 |
99 void SystemMonitor::NotifyResume() { | 99 void SystemMonitor::NotifyResume() { |
100 VLOG(1) << "Power Resuming"; | 100 DVLOG(1) << "Power Resuming"; |
101 observer_list_->Notify(&PowerObserver::OnResume); | 101 observer_list_->Notify(&PowerObserver::OnResume); |
102 } | 102 } |
103 | 103 |
104 void SystemMonitor::BatteryCheck() { | 104 void SystemMonitor::BatteryCheck() { |
105 ProcessPowerMessage(SystemMonitor::POWER_STATE_EVENT); | 105 ProcessPowerMessage(SystemMonitor::POWER_STATE_EVENT); |
106 } | 106 } |
107 | 107 |
108 } // namespace base | 108 } // namespace base |
OLD | NEW |