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

Side by Side Diff: device/battery/battery_monitor_impl.h

Issue 2818673003: [DeviceService] Expose battery monitoring solely via the Device Service (Closed)
Patch Set: Java file format change Created 3 years, 7 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
5 #ifndef DEVICE_BATTERY_BATTERY_MONITOR_IMPL_H_
6 #define DEVICE_BATTERY_BATTERY_MONITOR_IMPL_H_
7
8 #include <memory>
9
10 #include "base/macros.h"
11 #include "device/battery/battery_export.h"
12 #include "device/battery/battery_monitor.mojom.h"
13 #include "device/battery/battery_status_service.h"
14 #include "mojo/public/cpp/bindings/strong_binding.h"
15
16 namespace device {
17
18 class BatteryMonitorImpl : public mojom::BatteryMonitor {
19 public:
20 DEVICE_BATTERY_EXPORT static void Create(
21 mojom::BatteryMonitorRequest request);
22
23 BatteryMonitorImpl();
24 ~BatteryMonitorImpl() override;
25
26 private:
27 // mojom::BatteryMonitor methods:
28 void QueryNextStatus(const QueryNextStatusCallback& callback) override;
29
30 void RegisterSubscription();
31 void DidChange(const mojom::BatteryStatus& battery_status);
32 void ReportStatus();
33
34 mojo::StrongBindingPtr<mojom::BatteryMonitor> binding_;
35 std::unique_ptr<BatteryStatusService::BatteryUpdateSubscription>
36 subscription_;
37 QueryNextStatusCallback callback_;
38 mojom::BatteryStatus status_;
39 bool status_to_report_;
40
41 DISALLOW_COPY_AND_ASSIGN(BatteryMonitorImpl);
42 };
43
44 } // namespace device
45
46 #endif // DEVICE_BATTERY_BATTERY_MONITOR_IMPL_H_
OLDNEW
« 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