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/WebLockOrientationCallback.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::WebScreenOrientationLockPortrait
)
25 IPC_ENUM_TRAITS_MIN_MAX_VALUE(
26 blink::WebLockOrientationCallback::ErrorType
,
27 blink::WebLockOrientationCallback::ErrorTypeNotAvailable
,
28 blink::WebLockOrientationCallback::ErrorTypeCanceled
)
30 // The browser process informs the renderer process that the screen orientation
31 // has changed. |orientation| contains the new screen orientation in degrees.
32 IPC_MESSAGE_CONTROL1(ScreenOrientationMsg_OrientationChange
,
33 blink::WebScreenOrientationType
/* orientation */ )
35 // The browser process' response to a ScreenOrientationHostMsg_LockRequest when
36 // the lock actually succeeded. The message includes the new |angle| and |type|
37 // of orientation. The |request_id| passed when receiving the request is passed
38 // back so the renderer process can associate the response to the right request.
39 IPC_MESSAGE_CONTROL3(ScreenOrientationMsg_LockSuccess
,
42 blink::WebScreenOrientationType
/* type */)
44 // The browser process' response to a ScreenOrientationHostMsg_LockRequest when
45 // the lock actually failed. The message includes the |error| type. The
46 // |request_id| passed when receiving the request is passed back so the renderer
47 // process can associate the response to the right request.
48 IPC_MESSAGE_CONTROL2(ScreenOrientationMsg_LockError
,
50 blink::WebLockOrientationCallback::ErrorType
/* error */);
52 // The renderer process requests the browser process to lock the screen
53 // orientation to the specified |orientations|. The request contains a
54 // |request_id| that will have to be passed back to the renderer process when
55 // notifying about a success or error (see ScreenOrientationMsg_LockError and
56 // ScreenOrientationMsg_LockSuccess).
57 IPC_MESSAGE_CONTROL2(ScreenOrientationHostMsg_LockRequest
,
58 blink::WebScreenOrientationLockType
, /* orientation */
61 // The renderer process requests the browser process to unlock the screen
63 IPC_MESSAGE_CONTROL0(ScreenOrientationHostMsg_Unlock
)