Chromium Code Reviews| Index: content/child/power_monitor_broadcast_source.h |
| diff --git a/content/child/power_monitor_broadcast_source.h b/content/child/power_monitor_broadcast_source.h |
| index 2f3e5c19694a65e31f1f8b7d2edfd37ecd0b25c3..c5358eaed29978b583a3e7c82bb54348dab2d006 100644 |
| --- a/content/child/power_monitor_broadcast_source.h |
| +++ b/content/child/power_monitor_broadcast_source.h |
| @@ -8,37 +8,28 @@ |
| #include "base/macros.h" |
| #include "base/power_monitor/power_monitor_source.h" |
| #include "content/common/content_export.h" |
| -#include "ipc/ipc_channel.h" |
| - |
| -namespace IPC { |
| -class MessageFilter; |
| -} |
| +#include "device/power_monitor/public/interfaces/power_monitor.mojom.h" |
| +#include "mojo/public/cpp/bindings/binding.h" |
| namespace content { |
| -class PowerMessageFilter; |
| - |
| // Receives Power Monitor IPC messages sent from the browser process and relays |
| // them to the PowerMonitor of the current process. |
| -class CONTENT_EXPORT PowerMonitorBroadcastSource : |
| - public base::PowerMonitorSource { |
| +class CONTENT_EXPORT PowerMonitorBroadcastSource |
| + : public base::PowerMonitorSource, |
| + NON_EXPORTED_BASE(public device::mojom::PowerMonitorClient) { |
| public: |
| explicit PowerMonitorBroadcastSource(); |
| ~PowerMonitorBroadcastSource() override; |
| - IPC::MessageFilter* GetMessageFilter(); |
| + void PowerStateChange(bool on_battery_power) override; |
| + void Suspend() override; |
| + void Resume() override; |
| private: |
| - friend class PowerMessageFilter; |
| - |
| bool IsOnBatteryPowerImpl() override; |
| - |
| - void OnPowerStateChange(bool on_battery_power); |
| - void OnSuspend(); |
| - void OnResume(); |
| - |
| bool last_reported_battery_power_state_; |
| - scoped_refptr<PowerMessageFilter> message_filter_; |
| + mojo::Binding<device::mojom::PowerMonitorClient> binding_; |
|
blundell
2016/10/25 16:53:44
This can be just a StrongBinding and ChildThreadIm
ke.he
2016/10/26 10:01:51
@blundell, Big thanks for your comments:)
Here the
blundell
2016/10/26 16:18:02
Thanks for the clarification. The current structur
|
| DISALLOW_COPY_AND_ASSIGN(PowerMonitorBroadcastSource); |
| }; |