summaryrefslogtreecommitdiffstats
path: root/chromium/third_party/WebKit/Source/modules/battery/NavigatorBattery.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/WebKit/Source/modules/battery/NavigatorBattery.h')
-rw-r--r--chromium/third_party/WebKit/Source/modules/battery/NavigatorBattery.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/chromium/third_party/WebKit/Source/modules/battery/NavigatorBattery.h b/chromium/third_party/WebKit/Source/modules/battery/NavigatorBattery.h
new file mode 100644
index 00000000000..d5319e08cda
--- /dev/null
+++ b/chromium/third_party/WebKit/Source/modules/battery/NavigatorBattery.h
@@ -0,0 +1,39 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef NavigatorBattery_h
+#define NavigatorBattery_h
+
+#include "bindings/v8/ScriptPromise.h"
+#include "core/frame/Navigator.h"
+#include "platform/Supplementable.h"
+#include "platform/heap/Handle.h"
+
+namespace WebCore {
+
+class BatteryManager;
+class Navigator;
+
+class NavigatorBattery FINAL : public NoBaseWillBeGarbageCollectedFinalized<NavigatorBattery>, public WillBeHeapSupplement<Navigator> {
+ WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(NavigatorBattery);
+public:
+ virtual ~NavigatorBattery();
+
+ static NavigatorBattery& from(Navigator&);
+
+ static ScriptPromise getBattery(ScriptState*, Navigator&);
+ ScriptPromise getBattery(ScriptState*);
+
+ void trace(Visitor*);
+
+private:
+ NavigatorBattery();
+ static const char* supplementName();
+
+ RefPtrWillBeMember<BatteryManager> m_batteryManager;
+};
+
+} // namespace WebCore
+
+#endif // NavigatorBattery_h