Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CONTENT_BROWSER_BATTERY_STATUS_BATTERY_STATUS_PROVIDER_IMPL_H_ | |
| 6 #define CONTENT_BROWSER_BATTERY_STATUS_BATTERY_STATUS_PROVIDER_IMPL_H_ | |
| 7 | |
| 8 #include <list> | |
|
jam
2012/04/12 19:34:55
nit: not used
sadrul
2012/04/12 21:53:24
Done.
| |
| 9 | |
| 10 #include "base/memory/singleton.h" | |
| 11 #include "base/observer_list.h" | |
| 12 #include "content/public/browser/battery_status_provider.h" | |
| 13 | |
| 14 class BatteryStatusProviderImpl : public content::BatteryStatusProvider { | |
| 15 public: | |
| 16 class Observer { | |
| 17 public: | |
| 18 virtual void PowerChanged( | |
| 19 const content::PowerSupplyStatus& power_status) = 0; | |
| 20 }; | |
| 21 | |
| 22 static BatteryStatusProviderImpl* GetInstance(); | |
| 23 | |
| 24 void AddObserver(Observer* observer); | |
| 25 void RemoveObserver(Observer* observer); | |
| 26 | |
| 27 private: | |
| 28 friend struct DefaultSingletonTraits<BatteryStatusProviderImpl>; | |
| 29 | |
| 30 // Overridden from BatteryStatusProvider. | |
| 31 virtual void SendUpdate( | |
|
jam
2012/04/12 19:34:55
nit: why make this private? i'd put it in public,
sadrul
2012/04/12 21:53:24
Done.
| |
| 32 const content::PowerSupplyStatus& power_status) OVERRIDE; | |
| 33 | |
| 34 BatteryStatusProviderImpl(); | |
| 35 virtual ~BatteryStatusProviderImpl(); | |
| 36 | |
| 37 ObserverList<Observer> observers_; | |
| 38 | |
| 39 DISALLOW_COPY_AND_ASSIGN(BatteryStatusProviderImpl); | |
| 40 }; | |
| 41 | |
| 42 #endif // CONTENT_BROWSER_BATTERY_STATUS_BATTERY_STATUS_PROVIDER_IMPL_H_ | |
| OLD | NEW |