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.
5 // IPC messages for screen orientation.
6 // Multiply-included message file, hence no include guard.
8 #include "content/common/content_export.h"
9 #include "ipc/ipc_message_macros.h"
10 #include "third_party/WebKit/public/platform/WebLockOrientationError.h"
11 #include "third_party/WebKit/public/platform/WebScreenOrientationLockType.h"
12 #include "third_party/WebKit/public/platform/WebScreenOrientationType.h"
14 #undef IPC_MESSAGE_EXPORT
15 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT
17 #define IPC_MESSAGE_START ScreenOrientationMsgStart
19 IPC_ENUM_TRAITS_MIN_MAX_VALUE(blink::WebScreenOrientationType
,
20 blink::WebScreenOrientationUndefined
,
21 blink::WebScreenOrientationLandscapeSecondary
)
22 IPC_ENUM_TRAITS_MIN_MAX_VALUE(blink::WebScreenOrientationLockType
,
23 blink::WebScreenOrientationLockDefault
,
24 blink::WebScreenOrientationLockNatural
)
25 IPC_ENUM_TRAITS_MIN_MAX_VALUE(
26 blink::WebLockOrientationError
,
27 blink::WebLockOrientationErrorNotAvailable
,
28 blink::WebLockOrientationErrorCanceled
)
30 // The browser process informs the renderer process that the screen orientation
31 // has changed. |orientation| contains the new screen orientation in degrees.
32 // TODO(mlamouri): we could probably get rid of it.
33 IPC_MESSAGE_CONTROL1(ScreenOrientationMsg_OrientationChange
,
34 blink::WebScreenOrientationType
/* orientation */ )
36 // The browser process' response to a ScreenOrientationHostMsg_LockRequest when
37 // the lock actually succeeded. The message includes the new |angle| and |type|
38 // of orientation. The |request_id| passed when receiving the request is passed
39 // back so the renderer process can associate the response to the right request.
40 IPC_MESSAGE_ROUTED3(ScreenOrientationMsg_LockSuccess
,
43 blink::WebScreenOrientationType
/* type */)
45 // The browser process' response to a ScreenOrientationHostMsg_LockRequest when
46 // the lock actually failed. The message includes the |error| type. The
47 // |request_id| passed when receiving the request is passed back so the renderer
48 // process can associate the response to the right request.
49 IPC_MESSAGE_ROUTED2(ScreenOrientationMsg_LockError
,
51 blink::WebLockOrientationError
/* error */)
53 // The renderer process requests the browser process to lock the screen
54 // orientation to the specified |orientations|. The request contains a
55 // |request_id| that will have to be passed back to the renderer process when
56 // notifying about a success or error (see ScreenOrientationMsg_LockError and
57 // ScreenOrientationMsg_LockSuccess).
58 IPC_MESSAGE_ROUTED2(ScreenOrientationHostMsg_LockRequest
,
59 blink::WebScreenOrientationLockType
, /* orientation */
62 // The renderer process requests the browser process to unlock the screen
64 IPC_MESSAGE_ROUTED0(ScreenOrientationHostMsg_Unlock
)