OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "device/battery/battery_status_manager.h" | 5 #include "device/battery/battery_status_manager.h" |
6 | 6 |
| 7 #include <memory> |
| 8 |
7 #include "base/macros.h" | 9 #include "base/macros.h" |
8 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
9 #include "chromeos/dbus/dbus_thread_manager.h" | 11 #include "chromeos/dbus/dbus_thread_manager.h" |
10 #include "chromeos/dbus/power_manager/power_supply_properties.pb.h" | 12 #include "chromeos/dbus/power_manager/power_supply_properties.pb.h" |
11 #include "chromeos/dbus/power_manager_client.h" | 13 #include "chromeos/dbus/power_manager_client.h" |
12 | 14 |
13 namespace device { | 15 namespace device { |
14 | 16 |
15 namespace { | 17 namespace { |
16 | 18 |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 void StopListeningBatteryChange() override { observer_->Stop(); } | 141 void StopListeningBatteryChange() override { observer_->Stop(); } |
140 | 142 |
141 scoped_refptr<PowerManagerObserver> observer_; | 143 scoped_refptr<PowerManagerObserver> observer_; |
142 | 144 |
143 DISALLOW_COPY_AND_ASSIGN(BatteryStatusManagerChromeOS); | 145 DISALLOW_COPY_AND_ASSIGN(BatteryStatusManagerChromeOS); |
144 }; | 146 }; |
145 | 147 |
146 } // namespace | 148 } // namespace |
147 | 149 |
148 // static | 150 // static |
149 scoped_ptr<BatteryStatusManager> BatteryStatusManager::Create( | 151 std::unique_ptr<BatteryStatusManager> BatteryStatusManager::Create( |
150 const BatteryStatusService::BatteryUpdateCallback& callback) { | 152 const BatteryStatusService::BatteryUpdateCallback& callback) { |
151 return scoped_ptr<BatteryStatusManager>( | 153 return std::unique_ptr<BatteryStatusManager>( |
152 new BatteryStatusManagerChromeOS(callback)); | 154 new BatteryStatusManagerChromeOS(callback)); |
153 } | 155 } |
154 | 156 |
155 } // namespace device | 157 } // namespace device |
OLD | NEW |