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

Side by Side Diff: content/browser/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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_BROWSER_POWER_MONITOR_MESSAGE_BROADCASTER_H_
6 #define CONTENT_BROWSER_POWER_MONITOR_MESSAGE_BROADCASTER_H_
7
8 #include "base/macros.h"
9 #include "base/power_monitor/power_observer.h"
10 #include "content/common/content_export.h"
11 #include "device/power_monitor/public/interfaces/power_monitor.mojom.h"
12
13 namespace content {
14
15 // A class used to monitor the power state change and communicate it to child
16 // processes via IPC.
17 class CONTENT_EXPORT PowerMonitorMessageBroadcaster
18 : public base::PowerObserver,
19 NON_EXPORTED_BASE(public device::mojom::PowerMonitor) {
20 public:
21 explicit PowerMonitorMessageBroadcaster();
22 ~PowerMonitorMessageBroadcaster() override;
23
24 static void Create(device::mojom::PowerMonitorRequest request);
25
26 // Implement device::mojom::PowerMonitor:
27 void SetClient(
28 device::mojom::PowerMonitorClientPtr power_monitor_client) override;
29
30 // Implement PowerObserver:
31 void OnPowerStateChange(bool on_battery_power) override;
32 void OnSuspend() override;
33 void OnResume() override;
34
35 private:
36 device::mojom::PowerMonitorClientPtr power_monitor_client_;
37
38 DISALLOW_COPY_AND_ASSIGN(PowerMonitorMessageBroadcaster);
39 };
40
41 } // namespace content
42
43 #endif // CONTENT_BROWSER_POWER_MONITOR_MESSAGE_BROADCASTER_H_
OLDNEW
« no previous file with comments | « content/browser/browser_child_process_host_impl.cc ('k') | content/browser/power_monitor_message_broadcaster.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698