| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // IPC messages for screen orientation. | 5 // IPC messages for screen orientation. |
| 6 // Multiply-included message file, hence no include guard. | 6 // Multiply-included message file, hence no include guard. |
| 7 | 7 |
| 8 #include "content/common/content_export.h" | 8 #include "content/common/content_export.h" |
| 9 #include "ipc/ipc_message_macros.h" | 9 #include "ipc/ipc_message_macros.h" |
| 10 #include "third_party/WebKit/public/platform/modules/screen_orientation/WebLockO
rientationError.h" | 10 #include "third_party/WebKit/public/platform/modules/screen_orientation/WebLockO
rientationError.h" |
| 11 #include "third_party/WebKit/public/platform/modules/screen_orientation/WebScree
nOrientationLockType.h" | 11 #include "third_party/WebKit/public/platform/modules/screen_orientation/WebScree
nOrientationLockType.h" |
| 12 | 12 |
| 13 #undef IPC_MESSAGE_EXPORT | 13 #undef IPC_MESSAGE_EXPORT |
| 14 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT | 14 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT |
| 15 | 15 |
| 16 #define IPC_MESSAGE_START ScreenOrientationMsgStart | 16 #define IPC_MESSAGE_START ScreenOrientationMsgStart |
| 17 | 17 |
| 18 // Only used by content/common/manifest_manager_messages.h. |
| 18 IPC_ENUM_TRAITS_MIN_MAX_VALUE(blink::WebScreenOrientationLockType, | 19 IPC_ENUM_TRAITS_MIN_MAX_VALUE(blink::WebScreenOrientationLockType, |
| 19 blink::WebScreenOrientationLockDefault, | 20 blink::WebScreenOrientationLockDefault, |
| 20 blink::WebScreenOrientationLockNatural) | 21 blink::WebScreenOrientationLockNatural) |
| 21 IPC_ENUM_TRAITS_MIN_MAX_VALUE( | |
| 22 blink::WebLockOrientationError, | |
| 23 blink::WebLockOrientationErrorNotAvailable, | |
| 24 blink::WebLockOrientationErrorCanceled) | |
| 25 | |
| 26 // The browser process' response to a ScreenOrientationHostMsg_LockRequest when | |
| 27 // the lock actually succeeded. The |request_id| passed when receiving the | |
| 28 // request is passed back so the renderer process can associate the response to | |
| 29 // the right request. | |
| 30 IPC_MESSAGE_ROUTED1(ScreenOrientationMsg_LockSuccess, | |
| 31 int /* request_id */) | |
| 32 | |
| 33 // The browser process' response to a ScreenOrientationHostMsg_LockRequest when | |
| 34 // the lock actually failed. The message includes the |error| type. The | |
| 35 // |request_id| passed when receiving the request is passed back so the renderer | |
| 36 // process can associate the response to the right request. | |
| 37 IPC_MESSAGE_ROUTED2(ScreenOrientationMsg_LockError, | |
| 38 int, /* request_id */ | |
| 39 blink::WebLockOrientationError /* error */) | |
| 40 | |
| 41 // The renderer process requests the browser process to lock the screen | |
| 42 // orientation to the specified |orientations|. The request contains a | |
| 43 // |request_id| that will have to be passed back to the renderer process when | |
| 44 // notifying about a success or error (see ScreenOrientationMsg_LockError and | |
| 45 // ScreenOrientationMsg_LockSuccess). | |
| 46 IPC_MESSAGE_ROUTED2(ScreenOrientationHostMsg_LockRequest, | |
| 47 blink::WebScreenOrientationLockType, /* orientation */ | |
| 48 int /* request_id */) | |
| 49 | |
| 50 // The renderer process requests the browser process to unlock the screen | |
| 51 // orientation. | |
| 52 IPC_MESSAGE_ROUTED0(ScreenOrientationHostMsg_Unlock) | |
| 53 | 22 |
| 54 // The renderer process is now using the Screen Orientation API and informs the | 23 // The renderer process is now using the Screen Orientation API and informs the |
| 55 // browser process that it should start accurately listening to the screen | 24 // browser process that it should start accurately listening to the screen |
| 56 // orientation if it wasn't already. | 25 // orientation if it wasn't already. |
| 57 // This is only expected to be acted upon when the underlying platform requires | 26 // This is only expected to be acted upon when the underlying platform requires |
| 58 // heavy work in order to accurately know the screen orientation. | 27 // heavy work in order to accurately know the screen orientation. |
| 59 IPC_MESSAGE_CONTROL0(ScreenOrientationHostMsg_StartListening) | 28 IPC_MESSAGE_CONTROL0(ScreenOrientationHostMsg_StartListening) |
| 60 | 29 |
| 61 // The renderer process is no longer using the Screen Orientation API and | 30 // The renderer process is no longer using the Screen Orientation API and |
| 62 // informs the browser process that it can stop accurately listening to the | 31 // informs the browser process that it can stop accurately listening to the |
| 63 // screen orientation if no other process cares about it. | 32 // screen orientation if no other process cares about it. |
| 64 // This is only expected to be acted upon when the underlying platform requires | 33 // This is only expected to be acted upon when the underlying platform requires |
| 65 // heavy work in order to accurately know the screen orientation. | 34 // heavy work in order to accurately know the screen orientation. |
| 66 IPC_MESSAGE_CONTROL0(ScreenOrientationHostMsg_StopListening) | 35 IPC_MESSAGE_CONTROL0(ScreenOrientationHostMsg_StopListening) |
| OLD | NEW |