| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #ifndef CHROME_BROWSER_CHROMEOS_POWER_PERIPHERAL_BATTERY_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_POWER_PERIPHERAL_BATTERY_OBSERVER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_POWER_PERIPHERAL_BATTERY_OBSERVER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_POWER_PERIPHERAL_BATTERY_OBSERVER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 PeripheralBatteryObserver(); | 29 PeripheralBatteryObserver(); |
| 30 virtual ~PeripheralBatteryObserver(); | 30 virtual ~PeripheralBatteryObserver(); |
| 31 | 31 |
| 32 void set_testing_clock(base::SimpleTestTickClock* clock) { | 32 void set_testing_clock(base::SimpleTestTickClock* clock) { |
| 33 testing_clock_ = clock; | 33 testing_clock_ = clock; |
| 34 } | 34 } |
| 35 | 35 |
| 36 // PowerManagerClient::Observer implementation. | 36 // PowerManagerClient::Observer implementation. |
| 37 virtual void PeripheralBatteryStatusReceived(const std::string& path, | 37 virtual void PeripheralBatteryStatusReceived(const std::string& path, |
| 38 const std::string& name, | 38 const std::string& name, |
| 39 int level) OVERRIDE; | 39 int level) override; |
| 40 | 40 |
| 41 // device::BluetoothAdapter::Observer implementation. | 41 // device::BluetoothAdapter::Observer implementation. |
| 42 virtual void DeviceChanged(device::BluetoothAdapter* adapter, | 42 virtual void DeviceChanged(device::BluetoothAdapter* adapter, |
| 43 device::BluetoothDevice* device) OVERRIDE; | 43 device::BluetoothDevice* device) override; |
| 44 virtual void DeviceRemoved(device::BluetoothAdapter* adapter, | 44 virtual void DeviceRemoved(device::BluetoothAdapter* adapter, |
| 45 device::BluetoothDevice* device) OVERRIDE; | 45 device::BluetoothDevice* device) override; |
| 46 | 46 |
| 47 private: | 47 private: |
| 48 friend class PeripheralBatteryObserverTest; | 48 friend class PeripheralBatteryObserverTest; |
| 49 FRIEND_TEST_ALL_PREFIXES(PeripheralBatteryObserverTest, Basic); | 49 FRIEND_TEST_ALL_PREFIXES(PeripheralBatteryObserverTest, Basic); |
| 50 FRIEND_TEST_ALL_PREFIXES(PeripheralBatteryObserverTest, InvalidBatteryInfo); | 50 FRIEND_TEST_ALL_PREFIXES(PeripheralBatteryObserverTest, InvalidBatteryInfo); |
| 51 FRIEND_TEST_ALL_PREFIXES(PeripheralBatteryObserverTest, DeviceRemove); | 51 FRIEND_TEST_ALL_PREFIXES(PeripheralBatteryObserverTest, DeviceRemove); |
| 52 | 52 |
| 53 struct BatteryInfo { | 53 struct BatteryInfo { |
| 54 BatteryInfo() : level(-1) {} | 54 BatteryInfo() : level(-1) {} |
| 55 BatteryInfo(const std::string& name, | 55 BatteryInfo(const std::string& name, |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 base::SimpleTestTickClock* testing_clock_; | 90 base::SimpleTestTickClock* testing_clock_; |
| 91 | 91 |
| 92 scoped_ptr<base::WeakPtrFactory<PeripheralBatteryObserver> > weakptr_factory_; | 92 scoped_ptr<base::WeakPtrFactory<PeripheralBatteryObserver> > weakptr_factory_; |
| 93 | 93 |
| 94 DISALLOW_COPY_AND_ASSIGN(PeripheralBatteryObserver); | 94 DISALLOW_COPY_AND_ASSIGN(PeripheralBatteryObserver); |
| 95 }; | 95 }; |
| 96 | 96 |
| 97 } // namespace chromeos | 97 } // namespace chromeos |
| 98 | 98 |
| 99 #endif // CHROME_BROWSER_CHROMEOS_POWER_PERIPHERAL_BATTERY_OBSERVER_H_ | 99 #endif // CHROME_BROWSER_CHROMEOS_POWER_PERIPHERAL_BATTERY_OBSERVER_H_ |
| OLD | NEW |