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

Unified Diff: content/public/browser/battery_status_provider.cc

Issue 10024013: chromeos: Add support for the battery status API on chromeos. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: file-move Created 8 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 side-by-side diff with in-line comments
Download patch
Index: content/public/browser/battery_status_provider.cc
diff --git a/content/public/browser/battery_status_provider.cc b/content/public/browser/battery_status_provider.cc
new file mode 100644
index 0000000000000000000000000000000000000000..fdda005e8ef04aff2971f84648c4b028e236bd32
--- /dev/null
+++ b/content/public/browser/battery_status_provider.cc
@@ -0,0 +1,32 @@
+// Copyright (c) 2012 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.
+
+#include "content/public/browser/battery_status_provider.h"
+
+namespace content {
+
+BatteryStatusProvider* BatteryStatusProvider::GetInstance() {
+ return Singleton<BatteryStatusProvider>::get();
+}
+
+void BatteryStatusProvider::AddObserver(BatteryStatusProvider::Observer* obs) {
+ observers_.AddObserver(obs);
+}
+
+void BatteryStatusProvider::RemoveObserver(
+ BatteryStatusProvider::Observer* obs) {
+ observers_.RemoveObserver(obs);
+}
+
+void BatteryStatusProvider::SendUpdate(const PowerSupplyStatus& status) {
+ FOR_EACH_OBSERVER(Observer, observers_, PowerChanged(status));
+}
+
+BatteryStatusProvider::BatteryStatusProvider() {
+}
+
+BatteryStatusProvider::~BatteryStatusProvider() {
+}
+
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698