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

Side by Side Diff: Source/modules/battery/BatteryDispatcher.h

Issue 315023006: Revert of Generalize and refactor DeviceSensorEvent* architecture to support multi-event type targets. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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
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 BatteryDispatcher_h 5 #ifndef BatteryDispatcher_h
6 #define BatteryDispatcher_h 6 #define BatteryDispatcher_h
7 7
8 #include "core/frame/DeviceEventDispatcherBase.h" 8 #include "core/frame/DeviceSensorEventDispatcher.h"
9 #include "modules/battery/BatteryManager.h" 9 #include "modules/battery/BatteryManager.h"
10 #include "modules/battery/BatteryStatus.h" 10 #include "modules/battery/BatteryStatus.h"
11 #include "public/platform/WebBatteryStatusListener.h" 11 #include "public/platform/WebBatteryStatusListener.h"
12 12
13 namespace blink { 13 namespace blink {
14 class WebBatteryStatus; 14 class WebBatteryStatus;
15 } 15 }
16 16
17 namespace WebCore { 17 namespace WebCore {
18 18
19 class BatteryDispatcher FINAL : public DeviceEventDispatcherBase, public blink:: WebBatteryStatusListener { 19 class BatteryDispatcher FINAL : public DeviceSensorEventDispatcher, public blink ::WebBatteryStatusListener {
20 public: 20 public:
21 static BatteryDispatcher& instance(); 21 static BatteryDispatcher& instance();
22 virtual ~BatteryDispatcher(); 22 virtual ~BatteryDispatcher();
23 23
24 BatteryStatus* latestData(); 24 void addClient(BatteryManager*);
25 void removeClient(BatteryManager*);
25 26
26 // Inherited from blink::WebBatteryStatusListener. 27 const BatteryStatus* getLatestData();
27 virtual void updateBatteryStatus(const blink::WebBatteryStatus&) OVERRIDE; 28 virtual void updateBatteryStatus(const blink::WebBatteryStatus&) OVERRIDE;
28 29
29 private: 30 private:
30 BatteryDispatcher(); 31 BatteryDispatcher();
31 32
32 // Inherited from DeviceEventDispatcherBase. 33 void didChangeBatteryStatus(const AtomicString& eventType);
34
33 virtual void startListening() OVERRIDE; 35 virtual void startListening() OVERRIDE;
34 virtual void stopListening() OVERRIDE; 36 virtual void stopListening() OVERRIDE;
35 37
36 RefPtr<BatteryStatus> m_batteryStatus; 38 RefPtr<BatteryStatus> m_batteryStatus;
37 }; 39 };
38 40
39 } 41 }
40 42
41 #endif // BatteryDispatcher_h 43 #endif // BatteryDispatcher_h
OLDNEW
« no previous file with comments | « Source/core/frame/DeviceSingleWindowEventController.cpp ('k') | Source/modules/battery/BatteryDispatcher.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698