OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 module device.mojom; | 5 module device.mojom; |
6 | 6 |
7 import "device/screen_orientation/public/interfaces/screen_orientation_lock_type
s.mojom"; | 7 import "device/screen_orientation/public/interfaces/screen_orientation_lock_type
s.mojom"; |
8 | 8 |
9 interface ScreenOrientation { | 9 interface ScreenOrientation { |
10 LockOrientation(ScreenOrientationLockType orientation) => | 10 LockOrientation(ScreenOrientationLockType orientation) => |
11 (ScreenOrientationLockResult result); | 11 (ScreenOrientationLockResult result); |
12 UnlockOrientation(); | 12 UnlockOrientation(); |
13 }; | 13 }; |
14 | 14 |
15 // ScreenOrientationListener is expected to be used when the platform requires | 15 // ScreenOrientationListener is expected to be used when the platform requires |
16 // heavy work in order to accurately know the screen orientation. | 16 // heavy work in order to accurately know the screen orientation. |
17 // For example, on Android, this is required for Jelly Bean, where there is no | 17 // For example, on Android, this is required for Jelly Bean, where there is no |
18 // API to be notified of a screen orientation change of 180 degrees. | 18 // API to be notified of a screen orientation change of 180 degrees. |
19 interface ScreenOrientationListener { | 19 interface ScreenOrientationListener { |
20 // The renderer process is now using the Screen Orientation API and informs | 20 // The renderer process is now using the Screen Orientation API and informs |
21 // the browser process that it should start accurately listening to the screen | 21 // the browser process that it should start accurately listening to the screen |
22 // orientation if it wasn't already. | 22 // orientation if it wasn't already. |
23 Start(); | 23 Start(); |
24 | 24 |
25 // The renderer process is no longer using the Screen Orientation API and | 25 // The renderer process is no longer using the Screen Orientation API and |
26 // informs the browser process that it can stop accurately listening to the | 26 // informs the browser process that it can stop accurately listening to the |
27 // screen orientation if no other process cares about it. | 27 // screen orientation if no other process cares about it. |
28 Stop(); | 28 Stop(); |
| 29 |
| 30 // Queries whether accelerometer auto rotation of screen orientation is |
| 31 // enabled, or the user has locked the screen orientation at the OS level. |
| 32 // This can be called at any time, whether or not the listener is started. |
| 33 // It's currently only implemented on Android. |
| 34 IsAutoRotateEnabledByUser() => (bool enabled); |
29 }; | 35 }; |
OLD | NEW |