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

Side by Side Diff: device/power_monitor/public/cpp/power_monitor_broadcast_source.h

Issue 2678373003: [DeviceService] Move PowerMonitor interfaces, client lib, impl to live in Device Service (Closed)
Patch Set: Created 3 years, 10 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
OLDNEW
(Empty)
1 // Copyright (c) 2013 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_POWER_MONITOR_POWER_MONITOR_BROADCAST_SOURCE_H_
6 #define DEVICE_POWER_MONITOR_POWER_MONITOR_BROADCAST_SOURCE_H_
7
8 #include "base/macros.h"
9 #include "base/power_monitor/power_monitor_source.h"
10 #include "device/power_monitor/public/interfaces/power_monitor.mojom.h"
11 #include "mojo/public/cpp/bindings/binding.h"
12 #include "services/service_manager/public/cpp/interface_provider.h"
13
14 namespace device {
15
16 // Receives state changes from Power Monitor through mojo, and relays them to
17 // the PowerMonitor of the current process.
18 class PowerMonitorBroadcastSource : public base::PowerMonitorSource,
19 public device::mojom::PowerMonitorClient {
20 public:
21 explicit PowerMonitorBroadcastSource(
22 service_manager::InterfaceProvider* interface_provider);
23 ~PowerMonitorBroadcastSource() override;
24
25 void PowerStateChange(bool on_battery_power) override;
26 void Suspend() override;
27 void Resume() override;
28
29 private:
30 bool IsOnBatteryPowerImpl() override;
31 bool last_reported_battery_power_state_;
32 mojo::Binding<device::mojom::PowerMonitorClient> binding_;
33
34 DISALLOW_COPY_AND_ASSIGN(PowerMonitorBroadcastSource);
35 };
36
37 } // namespace device
38
39 #endif // DEVICE_POWER_MONITOR_POWER_MONITOR_BROADCAST_SOURCE_H_
OLDNEW
« no previous file with comments | « device/power_monitor/public/cpp/BUILD.gn ('k') | device/power_monitor/public/cpp/power_monitor_broadcast_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698