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

Side by Side Diff: device/power_monitor/power_monitor_message_broadcaster.h

Issue 2460823002: Decouple Power Monitor from //content. (Closed)
Patch Set: code rebase Created 4 years, 1 month 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
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 // device::mojom::PowerMonitor:
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 // base::PowerObserver:
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_
OLDNEW
« no previous file with comments | « device/power_monitor/power_monitor_export.h ('k') | device/power_monitor/power_monitor_message_broadcaster.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698