Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(211)

Unified Diff: device/battery/battery_monitor_impl.h

Issue 833983002: Stop using [Client=...] feature of Mojom for BatteryMonitor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixup per review feedback Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « device/battery/battery_monitor.mojom ('k') | device/battery/battery_monitor_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/battery/battery_monitor_impl.h
diff --git a/device/battery/battery_monitor_impl.h b/device/battery/battery_monitor_impl.h
index 7916b0d2b4adb97155844a0d2abfa2b480b422b4..49e85708b7760dcb62279c0c934edc2b0bfc425e 100644
--- a/device/battery/battery_monitor_impl.h
+++ b/device/battery/battery_monitor_impl.h
@@ -5,6 +5,8 @@
#ifndef DEVICE_BATTERY_BATTERY_MONITOR_IMPL_H_
#define DEVICE_BATTERY_BATTERY_MONITOR_IMPL_H_
+#include <vector>
+
#include "base/memory/scoped_ptr.h"
#include "device/battery/battery_export.h"
#include "device/battery/battery_monitor.mojom.h"
@@ -19,14 +21,23 @@ class BatteryMonitorImpl : public BatteryMonitor {
mojo::InterfaceRequest<BatteryMonitor> request);
private:
+ typedef mojo::Callback<void(BatteryStatusPtr)> BatteryStatusCallback;
+
explicit BatteryMonitorImpl(mojo::InterfaceRequest<BatteryMonitor> request);
~BatteryMonitorImpl() override;
+ // BatteryMonitor methods:
+ void QueryNextStatus(const BatteryStatusCallback& callback) override;
+
void RegisterSubscription();
void DidChange(const BatteryStatus& battery_status);
+ void ReportStatus();
mojo::StrongBinding<BatteryMonitor> binding_;
scoped_ptr<BatteryStatusService::BatteryUpdateSubscription> subscription_;
+ std::vector<BatteryStatusCallback> callbacks_;
+ BatteryStatus status_;
+ bool status_to_report_;
DISALLOW_COPY_AND_ASSIGN(BatteryMonitorImpl);
};
« no previous file with comments | « device/battery/battery_monitor.mojom ('k') | device/battery/battery_monitor_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698