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

Unified Diff: device/battery/battery_status_service.h

Issue 457933002: Replace Chrome IPC with Mojo IPC for querying BatteryStatus service Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 3 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
« no previous file with comments | « device/battery/battery_status_manager_win_unittest.cc ('k') | device/battery/battery_status_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/battery/battery_status_service.h
diff --git a/content/browser/battery_status/battery_status_service.h b/device/battery/battery_status_service.h
similarity index 63%
rename from content/browser/battery_status/battery_status_service.h
rename to device/battery/battery_status_service.h
index 1c1e3648363d617ccab553a4ce96355dddc2fcda..e8bbf4a270a48a16d5b596d1ec628c4321b98e4e 100644
--- a/content/browser/battery_status/battery_status_service.h
+++ b/device/battery/battery_status_service.h
@@ -2,22 +2,22 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_BROWSER_BATTERY_STATUS_BATTERY_STATUS_SERVICE_H_
-#define CONTENT_BROWSER_BATTERY_STATUS_BATTERY_STATUS_SERVICE_H_
+#ifndef DEVICE_BATTERY_BATTERY_STATUS_SERVICE_H_
+#define DEVICE_BATTERY_BATTERY_STATUS_SERVICE_H_
#include "base/callback_list.h"
+#include "base/memory/scoped_ptr.h"
#include "base/memory/singleton.h"
-#include "content/common/content_export.h"
-#include "third_party/WebKit/public/platform/WebBatteryStatus.h"
+#include "device/battery/battery_export.h"
+#include "device/battery/battery_status.mojom.h"
-namespace content {
+namespace device {
class BatteryStatusManager;
-class CONTENT_EXPORT BatteryStatusService {
+class DEVICE_BATTERY_EXPORT BatteryStatusService {
public:
- typedef base::Callback<void(const blink::WebBatteryStatus&)>
- BatteryUpdateCallback;
- typedef base::CallbackList<void(const blink::WebBatteryStatus&)>
+ typedef base::Callback<void(const BatteryStatus&)> BatteryUpdateCallback;
+ typedef base::CallbackList<void(const BatteryStatus&)>
BatteryUpdateCallbackList;
typedef BatteryUpdateCallbackList::Subscription BatteryUpdateSubscription;
@@ -33,8 +33,8 @@ class CONTENT_EXPORT BatteryStatusService {
void Shutdown();
// Injects a custom battery status manager for testing purposes.
- // This class takes ownership of the injected object.
- void SetBatteryManagerForTesting(BatteryStatusManager* test_battery_manager);
+ void SetBatteryManagerForTesting(
+ scoped_ptr<BatteryStatusManager> test_battery_manager);
// Returns callback to invoke when battery is changed. Used for testing.
const BatteryUpdateCallback& GetUpdateCallbackForTesting() const;
@@ -47,20 +47,19 @@ class CONTENT_EXPORT BatteryStatusService {
// Updates current battery status and sends new status to interested
// render processes. Can be called on any thread via a callback.
- void UpdateBatteryStatus(const blink::WebBatteryStatus& status);
- void NotifyConsumers(const blink::WebBatteryStatus& status);
+ void NotifyConsumers(const BatteryStatus& status);
void ConsumersChanged();
scoped_ptr<BatteryStatusManager> battery_fetcher_;
BatteryUpdateCallbackList callback_list_;
BatteryUpdateCallback update_callback_;
- blink::WebBatteryStatus status_;
+ BatteryStatus status_;
bool status_updated_;
bool is_shutdown_;
DISALLOW_COPY_AND_ASSIGN(BatteryStatusService);
};
-} // namespace content
+} // namespace device
-#endif // CONTENT_BROWSER_BATTERY_STATUS_BATTERY_STATUS_SERVICE_H_
+#endif // DEVICE_BATTERY_BATTERY_STATUS_SERVICE_H_
« no previous file with comments | « device/battery/battery_status_manager_win_unittest.cc ('k') | device/battery/battery_status_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698