| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 void SystemMonitor::RemoveDevicesChangedObserver(DevicesChangedObserver* obs) { | 144 void SystemMonitor::RemoveDevicesChangedObserver(DevicesChangedObserver* obs) { |
| 145 devices_changed_observer_list_->RemoveObserver(obs); | 145 devices_changed_observer_list_->RemoveObserver(obs); |
| 146 } | 146 } |
| 147 | 147 |
| 148 void SystemMonitor::NotifyDevicesChanged(DeviceType device_type) { | 148 void SystemMonitor::NotifyDevicesChanged(DeviceType device_type) { |
| 149 DVLOG(1) << "DevicesChanged with device type " << device_type; | 149 DVLOG(1) << "DevicesChanged with device type " << device_type; |
| 150 devices_changed_observer_list_->Notify( | 150 devices_changed_observer_list_->Notify( |
| 151 &DevicesChangedObserver::OnDevicesChanged, device_type); | 151 &DevicesChangedObserver::OnDevicesChanged, device_type); |
| 152 } | 152 } |
| 153 | 153 |
| 154 void SystemMonitor::NotifyStorageFreeSpaceChanged( |
| 155 const FilePath::StringType& path, double available_capacity) { |
| 156 DVLOG(1) << "StorageFreeSpaceChanged with path " << path |
| 157 << " and free space " << available_capacity; |
| 158 devices_changed_observer_list_->Notify( |
| 159 &DevicesChangedObserver::OnStorageFreeSpaceChanged, |
| 160 path, available_capacity); |
| 161 } |
| 162 |
| 154 void SystemMonitor::NotifyRemovableStorageAttached( | 163 void SystemMonitor::NotifyRemovableStorageAttached( |
| 155 const std::string& id, | 164 const std::string& id, |
| 156 const string16& name, | 165 const string16& name, |
| 157 const FilePath::StringType& location) { | 166 const FilePath::StringType& location) { |
| 158 DVLOG(1) << "RemovableStorageAttached with name " << UTF16ToUTF8(name) | 167 DVLOG(1) << "RemovableStorageAttached with name " << UTF16ToUTF8(name) |
| 159 << " and id " << id; | 168 << " and id " << id; |
| 160 devices_changed_observer_list_->Notify( | 169 devices_changed_observer_list_->Notify( |
| 161 &DevicesChangedObserver::OnRemovableStorageAttached, id, name, location); | 170 &DevicesChangedObserver::OnRemovableStorageAttached, id, name, location); |
| 162 } | 171 } |
| 163 | 172 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 182 void SystemMonitor::NotifyResume() { | 191 void SystemMonitor::NotifyResume() { |
| 183 DVLOG(1) << "Power Resuming"; | 192 DVLOG(1) << "Power Resuming"; |
| 184 power_observer_list_->Notify(&PowerObserver::OnResume); | 193 power_observer_list_->Notify(&PowerObserver::OnResume); |
| 185 } | 194 } |
| 186 | 195 |
| 187 void SystemMonitor::BatteryCheck() { | 196 void SystemMonitor::BatteryCheck() { |
| 188 ProcessPowerMessage(SystemMonitor::POWER_STATE_EVENT); | 197 ProcessPowerMessage(SystemMonitor::POWER_STATE_EVENT); |
| 189 } | 198 } |
| 190 | 199 |
| 191 } // namespace base | 200 } // namespace base |
| OLD | NEW |