OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_BROWSER_POWER_MONITOR_MESSAGE_BROADCASTER_H_ | 5 #ifndef DEVICE_POWER_MONITOR_POWER_MONITOR_MESSAGE_BROADCASTER_H_ |
6 #define CONTENT_BROWSER_POWER_MONITOR_MESSAGE_BROADCASTER_H_ | 6 #define DEVICE_POWER_MONITOR_POWER_MONITOR_MESSAGE_BROADCASTER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/power_monitor/power_observer.h" | 9 #include "base/power_monitor/power_observer.h" |
10 #include "content/common/content_export.h" | 10 #include "device/power_monitor/power_monitor_export.h" |
11 #include "device/power_monitor/public/interfaces/power_monitor.mojom.h" | 11 #include "device/power_monitor/public/interfaces/power_monitor.mojom.h" |
12 | 12 |
13 namespace content { | 13 namespace device { |
14 | 14 |
15 // A class used to monitor the power state change and communicate it to child | 15 // A class used to monitor the power state change and communicate it to child |
16 // processes via IPC. | 16 // processes via IPC. |
17 class CONTENT_EXPORT PowerMonitorMessageBroadcaster | 17 class DEVICE_POWER_MONITOR_EXPORT PowerMonitorMessageBroadcaster |
18 : public base::PowerObserver, | 18 : public base::PowerObserver, |
19 NON_EXPORTED_BASE(public device::mojom::PowerMonitor) { | 19 NON_EXPORTED_BASE(public device::mojom::PowerMonitor) { |
20 public: | 20 public: |
21 explicit PowerMonitorMessageBroadcaster(); | 21 explicit PowerMonitorMessageBroadcaster(); |
22 ~PowerMonitorMessageBroadcaster() override; | 22 ~PowerMonitorMessageBroadcaster() override; |
23 | 23 |
24 static void Create(device::mojom::PowerMonitorRequest request); | 24 static void Create(device::mojom::PowerMonitorRequest request); |
25 | 25 |
26 // Implement device::mojom::PowerMonitor: | 26 // Implement device::mojom::PowerMonitor: |
blundell
2016/11/07 12:50:08
nit: just |device::mojom::PowerMonitor:|
ke.he
2016/11/08 08:59:56
Done.
| |
27 void SetClient( | 27 void SetClient( |
28 device::mojom::PowerMonitorClientPtr power_monitor_client) override; | 28 device::mojom::PowerMonitorClientPtr power_monitor_client) override; |
29 | 29 |
30 // Implement PowerObserver: | 30 // Implement PowerObserver: |
blundell
2016/11/07 12:50:08
same nit.
ke.he
2016/11/08 08:59:55
Done.
| |
31 void OnPowerStateChange(bool on_battery_power) override; | 31 void OnPowerStateChange(bool on_battery_power) override; |
32 void OnSuspend() override; | 32 void OnSuspend() override; |
33 void OnResume() override; | 33 void OnResume() override; |
34 | 34 |
35 private: | 35 private: |
36 device::mojom::PowerMonitorClientPtr power_monitor_client_; | 36 device::mojom::PowerMonitorClientPtr power_monitor_client_; |
37 | 37 |
38 DISALLOW_COPY_AND_ASSIGN(PowerMonitorMessageBroadcaster); | 38 DISALLOW_COPY_AND_ASSIGN(PowerMonitorMessageBroadcaster); |
39 }; | 39 }; |
40 | 40 |
41 } // namespace content | 41 } // namespace device |
42 | 42 |
43 #endif // CONTENT_BROWSER_POWER_MONITOR_MESSAGE_BROADCASTER_H_ | 43 #endif // DEVICE_POWER_MONITOR_POWER_MONITOR_MESSAGE_BROADCASTER_H_ |
OLD | NEW |