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

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 NeedsRebaseline for 4 tests for Mac. Created 6 years, 9 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..754ef7d01496705a5caf3c1b347241b0824589aa
--- /dev/null
+++ b/Source/modules/battery/NavigatorBattery.h
@@ -0,0 +1,34 @@
+// 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 NavigatorBattery : public Supplement<Navigator> {
+public:
+ virtual ~NavigatorBattery();
+
+ static NavigatorBattery& from(Navigator&);
+
+ static BatteryManager* battery(Navigator&);
+ BatteryManager* batteryManager(Navigator&);
+
+private:
+ explicit NavigatorBattery();
Inactive 2014/03/06 13:45:39 A bit odd to make this constructor explicit since
+ static const char* supplementName();
+
+ RefPtr<BatteryManager> m_batteryManager;
+};
+
+} // namespace WebCore
+
+#endif // NavigatorBattery_h

Powered by Google App Engine
This is Rietveld 408576698