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

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

Issue 182613002: Add support to Battery Status API in blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 10 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
OLDNEW
(Empty)
1 /*
2 * Copyright (C) 2012 Samsung Electronics
3 * Copyright (C) 2014 Intel Corporation
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
14 *
15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19 */
20
21 #ifndef BatteryStatus_h
22 #define BatteryStatus_h
23
24 #include "wtf/PassRefPtr.h"
25 #include "wtf/RefCounted.h"
26
27 namespace WebCore {
28
29 class BatteryStatus : public RefCounted<BatteryStatus> {
abarth-chromium 2014/02/27 05:42:09 Why is this object RefCounted? It looks like ther
30 public:
31 static PassRefPtr<BatteryStatus> create();
32 static PassRefPtr<BatteryStatus> create(bool charging, double chargingTime, double dischargingTime, double level);
33
34 bool charging() const { return m_charging; }
35 double chargingTime() const { return m_chargingTime; }
36 double dischargingTime() const { return m_dischargingTime; }
37 double level() const { return m_level; }
38
39 private:
40 BatteryStatus();
41 BatteryStatus(bool charging, double chargingTime, double dischargingTime, do uble level);
42
43 bool m_charging;
44 double m_chargingTime;
45 double m_dischargingTime;
46 double m_level;
47 };
48
49 } // namespace WebCore
50
51 #endif // BatteryStatus_h
52
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698