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

Unified Diff: Source/modules/battery/NavigatorBattery.h

Issue 182613002: Add support to Battery Status API in blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add to RunTimeEnabledFeatures 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 side-by-side diff with in-line comments
Download patch
Index: Source/modules/battery/NavigatorBattery.h
diff --git a/Source/modules/battery/NavigatorBattery.h b/Source/modules/battery/NavigatorBattery.h
new file mode 100644
index 0000000000000000000000000000000000000000..5ee20bff8ba4b4cde49756661f4c133224ea3de9
--- /dev/null
+++ b/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 "core/frame/Navigator.h"
+#include "platform/Supplementable.h"
+
+namespace WebCore {
+
+class BatteryManager;
+class Navigator;
+class ScriptExecutionContext;
abarth-chromium 2014/02/28 06:45:14 This forward declaration doesn't appear to be used
+
+class NavigatorBattery : public Supplement<Navigator>, DOMWindowProperty {
abarth-chromium 2014/02/28 06:45:14 Why does this class need to be a DOMWindowProperty
+public:
+ virtual ~NavigatorBattery();
+
+ static NavigatorBattery& from(Navigator&);
+
+ static BatteryManager* battery(Navigator&);
+ BatteryManager* battery();
+
+ BatteryManager* batteryManager();
abarth-chromium 2014/02/28 06:45:14 What's the difference between battery() and batter
+
+private:
+ NavigatorBattery(Frame*);
abarth-chromium 2014/02/28 06:45:14 Please mark one-argument constructors explicit.
+ static const char* supplementName();
+
+ RefPtr<BatteryManager> m_batteryManager;
+};
+
+} // namespace WebCore
+
+#endif // NavigatorBattery_h
+
+
abarth-chromium 2014/02/28 06:45:14 Please remove these extra blank lines at the end o

Powered by Google App Engine
This is Rietveld 408576698