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

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

Issue 212643010: Add Dispatcher class to the Battery Status API module. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove comments and stopUpdating in the destructor. Created 6 years, 8 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
« no previous file with comments | « Source/modules/battery/BatteryManager.cpp ('k') | Source/modules/battery/BatteryStatus.cpp » ('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 BatteryStatus_h 5 #ifndef BatteryStatus_h
6 #define BatteryStatus_h 6 #define BatteryStatus_h
7 7
8 #include "wtf/PassOwnPtr.h" 8 #include "wtf/PassRefPtr.h"
9 #include "wtf/RefCounted.h" 9 #include "wtf/RefCounted.h"
10 10
11 namespace WebCore { 11 namespace WebCore {
12 12
13 class BatteryStatus { 13 class BatteryStatus : public RefCounted<BatteryStatus> {
14 public: 14 public:
15 static PassOwnPtr<BatteryStatus> create(); 15 static PassRefPtr<BatteryStatus> create();
16 static PassOwnPtr<BatteryStatus> create(bool charging, double chargingTime, double dischargingTime, double level); 16 static PassRefPtr<BatteryStatus> create(bool charging, double chargingTime, double dischargingTime, double level);
17 17
18 bool charging() const { return m_charging; } 18 bool charging() const { return m_charging; }
19 double chargingTime() const { return m_chargingTime; } 19 double chargingTime() const { return m_chargingTime; }
20 double dischargingTime() const { return m_dischargingTime; } 20 double dischargingTime() const { return m_dischargingTime; }
21 double level() const { return m_level; } 21 double level() const { return m_level; }
22 22
23 private: 23 private:
24 BatteryStatus(); 24 BatteryStatus();
25 BatteryStatus(bool charging, double chargingTime, double dischargingTime, do uble level); 25 BatteryStatus(bool charging, double chargingTime, double dischargingTime, do uble level);
26 26
27 bool m_charging; 27 bool m_charging;
28 double m_chargingTime; 28 double m_chargingTime;
29 double m_dischargingTime; 29 double m_dischargingTime;
30 double m_level; 30 double m_level;
31 }; 31 };
32 32
33 } // namespace WebCore 33 } // namespace WebCore
34 34
35 #endif // BatteryStatus_h 35 #endif // BatteryStatus_h
36 36
OLDNEW
« no previous file with comments | « Source/modules/battery/BatteryManager.cpp ('k') | Source/modules/battery/BatteryStatus.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698