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

Unified Diff: content/common/battery_status_messages.h

Issue 252113006: Add Battery Status API support in content/renderer and IPC messages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 6 years, 7 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 | « content/common/DEPS ('k') | content/common/content_message_generator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/battery_status_messages.h
diff --git a/content/common/battery_status_messages.h b/content/common/battery_status_messages.h
new file mode 100644
index 0000000000000000000000000000000000000000..dd09ed0ca240a617fee81720cddf378c3d694e52
--- /dev/null
+++ b/content/common/battery_status_messages.h
@@ -0,0 +1,32 @@
+// 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.
+
+// IPC messages for Battery Status API.
+// Multiply-included message file, hence no include guard.
+
+#include "ipc/ipc_message_macros.h"
+#include "third_party/WebKit/public/platform/WebBatteryStatus.h"
+
+#undef IPC_MESSAGE_EXPORT
+#define IPC_MESSAGE_EXPORT CONTENT_EXPORT
+#define IPC_MESSAGE_START BatteryStatusMsgStart
+
+IPC_STRUCT_TRAITS_BEGIN(blink::WebBatteryStatus)
+ IPC_STRUCT_TRAITS_MEMBER(charging)
+ IPC_STRUCT_TRAITS_MEMBER(chargingTime)
+ IPC_STRUCT_TRAITS_MEMBER(dischargingTime)
+ IPC_STRUCT_TRAITS_MEMBER(level)
+IPC_STRUCT_TRAITS_END()
+
+// Notifies the browser process that the renderer process wants
+// to listen to battery status updates.
+IPC_MESSAGE_CONTROL0(BatteryStatusHostMsg_Start)
+
+// Notifies the render process with new battery status data.
+IPC_MESSAGE_CONTROL1(BatteryStatusMsg_DidChange,
+ blink::WebBatteryStatus /* new status */)
+
+// Notifies the browser process that the renderer process is not using the
+// battery status data anymore.
+IPC_MESSAGE_CONTROL0(BatteryStatusHostMsg_Stop)
« no previous file with comments | « content/common/DEPS ('k') | content/common/content_message_generator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698