#ifndef ASH_SYSTEM_POWER_ADAPTIVE_CHARGING_CONTROLLER_H_
#define ASH_SYSTEM_POWER_ADAPTIVE_CHARGING_CONTROLLER_H_
#include "ash/ash_export.h"
#include "ash/system/power/adaptive_charging_notification_controller.h"
#include "ash/system/power/adaptive_charging_nudge_controller.h"
#include "base/scoped_observation.h"
#include "chromeos/dbus/power/power_manager_client.h"
#include "chromeos/dbus/power_manager/power_supply_properties.pb.h"
namespace ash {
class ASH_EXPORT AdaptiveChargingController
: public chromeos::PowerManagerClient::Observer {
public:
AdaptiveChargingController();
AdaptiveChargingController(const AdaptiveChargingController&) = delete;
AdaptiveChargingController& operator=(const AdaptiveChargingController&) =
delete;
~AdaptiveChargingController() override;
bool IsAdaptiveChargingSupported();
bool is_adaptive_delaying_charge() { return is_adaptive_delaying_charge_; }
private:
void PowerChanged(const power_manager::PowerSupplyProperties& proto) override;
bool is_adaptive_delaying_charge_ = false;
bool is_on_charger_ = false;
base::ScopedObservation<chromeos::PowerManagerClient,
chromeos::PowerManagerClient::Observer>
power_manager_observation_{this};
const std::unique_ptr<AdaptiveChargingNudgeController> nudge_controller_;
const std::unique_ptr<AdaptiveChargingNotificationController>
notification_controller_;
};
}
#endif