OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_RENDERER_BATTERY_STATUS_BATTERY_STATUS_DISPATCHER_H_ | 5 #ifndef CONTENT_RENDERER_BATTERY_STATUS_BATTERY_STATUS_DISPATCHER_H_ |
6 #define CONTENT_RENDERER_BATTERY_STATUS_BATTERY_STATUS_DISPATCHER_H_ | 6 #define CONTENT_RENDERER_BATTERY_STATUS_BATTERY_STATUS_DISPATCHER_H_ |
7 | 7 |
8 #include "content/public/renderer/platform_event_observer.h" | 8 #include "content/public/renderer/platform_event_observer.h" |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
11 class WebBatteryStatus; | 11 class WebBatteryStatus; |
12 class WebBatteryStatusListener; | 12 class WebBatteryStatusListener; |
13 } | 13 } |
14 | 14 |
15 namespace content { | 15 namespace content { |
16 class RenderThread; | 16 class RenderThread; |
17 | 17 |
18 class CONTENT_EXPORT BatteryStatusDispatcher | 18 class CONTENT_EXPORT BatteryStatusDispatcher |
19 : NON_EXPORTED_BASE( | 19 : NON_EXPORTED_BASE( |
20 public PlatformEventObserver<blink::WebBatteryStatusListener>) { | 20 public PlatformEventObserver<blink::WebBatteryStatusListener>) { |
21 public: | 21 public: |
22 explicit BatteryStatusDispatcher(RenderThread* thread); | 22 explicit BatteryStatusDispatcher(RenderThread* thread); |
23 virtual ~BatteryStatusDispatcher(); | 23 virtual ~BatteryStatusDispatcher(); |
24 | 24 |
25 // PlatformEventObserver public methods. | 25 // PlatformEventObserver public methods. |
26 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE; | 26 virtual bool OnControlMessageReceived(const IPC::Message& message) override; |
27 virtual void SendFakeDataForTesting(void* data) OVERRIDE; | 27 virtual void SendFakeDataForTesting(void* data) override; |
28 | 28 |
29 protected: | 29 protected: |
30 // PlatformEventObserver protected methods. | 30 // PlatformEventObserver protected methods. |
31 virtual void SendStartMessage() OVERRIDE; | 31 virtual void SendStartMessage() override; |
32 virtual void SendStopMessage() OVERRIDE; | 32 virtual void SendStopMessage() override; |
33 | 33 |
34 private: | 34 private: |
35 void OnDidChange(const blink::WebBatteryStatus& status); | 35 void OnDidChange(const blink::WebBatteryStatus& status); |
36 | 36 |
37 DISALLOW_COPY_AND_ASSIGN(BatteryStatusDispatcher); | 37 DISALLOW_COPY_AND_ASSIGN(BatteryStatusDispatcher); |
38 }; | 38 }; |
39 | 39 |
40 } // namespace content | 40 } // namespace content |
41 | 41 |
42 #endif // CONTENT_RENDERER_BATTERY_STATUS_BATTERY_STATUS_DISPATCHER_H_ | 42 #endif // CONTENT_RENDERER_BATTERY_STATUS_BATTERY_STATUS_DISPATCHER_H_ |
OLD | NEW |