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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_BATTERY_STATUS_BATTERY_STATUS_MANAGER_H_
6 #define CHROME_BROWSER_BATTERY_STATUS_BATTERY_STATUS_MANAGER_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "build/build_config.h"
10 #include "content/browser/battery_status/battery_status_service.h"
14 // Platform specific manager class for fetching battery status data.
15 class CONTENT_EXPORT BatteryStatusManager
{
17 // Creates a BatteryStatusManager object. |callback| should be called when the
18 // battery status changes.
19 static scoped_ptr
<BatteryStatusManager
> Create(
20 const BatteryStatusService::BatteryUpdateCallback
& callback
);
22 virtual ~BatteryStatusManager() {}
24 // Start listening for battery status changes. New updates are signalled
25 // by invoking the callback provided at construction time.
26 // Note that this is called in the IO thread.
27 virtual bool StartListeningBatteryChange() = 0;
29 // Stop listening for battery status changes.
30 // Note that this is called in the IO thread.
31 virtual void StopListeningBatteryChange() = 0;
34 } // namespace content
36 #endif // CHROME_BROWSER_BATTERY_STATUS_BATTERY_STATUS_MANAGER_H_