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

Side by Side Diff: content/renderer/battery_status/battery_status_dispatcher.h

Issue 457933002: Replace Chrome IPC with Mojo IPC for querying BatteryStatus service Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 3 months 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 | Annotate | Revision Log
« no previous file with comments | « content/renderer/DEPS ('k') | content/renderer/battery_status/battery_status_dispatcher.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/macros.h"
9 #include "content/common/content_export.h"
10 #include "device/battery/battery_monitor.mojom.h"
9 11
10 namespace blink { 12 namespace blink {
11 class WebBatteryStatus;
12 class WebBatteryStatusListener; 13 class WebBatteryStatusListener;
13 } 14 }
14 15
15 namespace content { 16 namespace content {
16 class RenderThread;
17 17
18 class CONTENT_EXPORT BatteryStatusDispatcher 18 class CONTENT_EXPORT BatteryStatusDispatcher
19 : NON_EXPORTED_BASE( 19 : public NON_EXPORTED_BASE(device::BatteryMonitorClient) {
20 public PlatformEventObserver<blink::WebBatteryStatusListener>) {
21 public: 20 public:
22 explicit BatteryStatusDispatcher(RenderThread* thread); 21 explicit BatteryStatusDispatcher(blink::WebBatteryStatusListener* listener);
23 virtual ~BatteryStatusDispatcher(); 22 virtual ~BatteryStatusDispatcher();
24 23
25 // PlatformEventObserver public methods. 24 private:
26 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE; 25 // BatteryMonitorClient method.
27 virtual void SendFakeDataForTesting(void* data) OVERRIDE; 26 virtual void DidChange(device::BatteryStatusPtr battery_status) OVERRIDE;
28 27
29 protected: 28 void Start();
30 // PlatformEventObserver protected methods. 29 void Stop();
31 virtual void SendStartMessage() OVERRIDE;
32 virtual void SendStopMessage() OVERRIDE;
33 30
34 private: 31 device::BatteryMonitorPtr monitor_;
35 void OnDidChange(const blink::WebBatteryStatus& status); 32 blink::WebBatteryStatusListener* listener_;
36 33
37 DISALLOW_COPY_AND_ASSIGN(BatteryStatusDispatcher); 34 DISALLOW_COPY_AND_ASSIGN(BatteryStatusDispatcher);
38 }; 35 };
39 36
40 } // namespace content 37 } // namespace content
41 38
42 #endif // CONTENT_RENDERER_BATTERY_STATUS_BATTERY_STATUS_DISPATCHER_H_ 39 #endif // CONTENT_RENDERER_BATTERY_STATUS_BATTERY_STATUS_DISPATCHER_H_
OLDNEW
« no previous file with comments | « content/renderer/DEPS ('k') | content/renderer/battery_status/battery_status_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698