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

Unified Diff: content/browser/battery_status/battery_status_manager.h

Issue 676953005: Revert of Replace Chrome IPC with Mojo IPC for querying BatteryStatus service (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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/browser/battery_status/battery_status_manager.h
diff --git a/content/browser/battery_status/battery_status_manager.h b/content/browser/battery_status/battery_status_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..6d312e7988cc44d502029e9a62fd3188792052e6
--- /dev/null
+++ b/content/browser/battery_status/battery_status_manager.h
@@ -0,0 +1,36 @@
+// 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 CHROME_BROWSER_BATTERY_STATUS_BATTERY_STATUS_MANAGER_H_
+#define CHROME_BROWSER_BATTERY_STATUS_BATTERY_STATUS_MANAGER_H_
+
+#include "base/memory/scoped_ptr.h"
+#include "build/build_config.h"
+#include "content/browser/battery_status/battery_status_service.h"
+
+namespace content {
+
+// Platform specific manager class for fetching battery status data.
+class CONTENT_EXPORT BatteryStatusManager {
+ public:
+ // Creates a BatteryStatusManager object. |callback| should be called when the
+ // battery status changes.
+ static scoped_ptr<BatteryStatusManager> Create(
+ const BatteryStatusService::BatteryUpdateCallback& callback);
+
+ virtual ~BatteryStatusManager() {}
+
+ // Start listening for battery status changes. New updates are signalled
+ // by invoking the callback provided at construction time.
+ // Note that this is called in the IO thread.
+ virtual bool StartListeningBatteryChange() = 0;
+
+ // Stop listening for battery status changes.
+ // Note that this is called in the IO thread.
+ virtual void StopListeningBatteryChange() = 0;
+};
+
+} // namespace content
+
+#endif // CHROME_BROWSER_BATTERY_STATUS_BATTERY_STATUS_MANAGER_H_

Powered by Google App Engine
This is Rietveld 408576698