1// Copyright 2014 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// IPC messages for Battery Status API.
6// Multiply-included message file, hence no include guard.
7
8#include "ipc/ipc_message_macros.h"
9#include "third_party/WebKit/public/platform/WebBatteryStatus.h"
10
11#undef IPC_MESSAGE_EXPORT
12#define IPC_MESSAGE_EXPORT CONTENT_EXPORT
13#define IPC_MESSAGE_START BatteryStatusMsgStart
14
15IPC_STRUCT_TRAITS_BEGIN(blink::WebBatteryStatus)
16  IPC_STRUCT_TRAITS_MEMBER(charging)
17  IPC_STRUCT_TRAITS_MEMBER(chargingTime)
18  IPC_STRUCT_TRAITS_MEMBER(dischargingTime)
19  IPC_STRUCT_TRAITS_MEMBER(level)
20IPC_STRUCT_TRAITS_END()
21
22// Notifies the browser process that the renderer process wants
23// to listen to battery status updates.
24IPC_MESSAGE_CONTROL0(BatteryStatusHostMsg_Start)
25
26// Notifies the render process with new battery status data.
27IPC_MESSAGE_CONTROL1(BatteryStatusMsg_DidChange,
28                     blink::WebBatteryStatus /* new status */)
29
30// Notifies the browser process that the renderer process is not using the
31// battery status data anymore.
32IPC_MESSAGE_CONTROL0(BatteryStatusHostMsg_Stop)
33