| // Copyright 2016 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| module device.mojom; |
| |
| import "services/device/public/mojom/screen_orientation_lock_types.mojom"; |
| |
| interface ScreenOrientation { |
| LockOrientation(ScreenOrientationLockType orientation) => |
| (ScreenOrientationLockResult result); |
| UnlockOrientation(); |
| }; |
| |
| // ScreenOrientationListener is expected to be used when the platform requires |
| // heavy work in order to accurately know the screen orientation. |
| // For example, on Android, this is required for Jelly Bean, where there is no |
| // API to be notified of a screen orientation change of 180 degrees. |
| interface ScreenOrientationListener { |
| // The renderer process is now using the Screen Orientation API and informs |
| // the browser process that it should start accurately listening to the screen |
| // orientation if it wasn't already. |
| Start(); |
| |
| // The renderer process is no longer using the Screen Orientation API and |
| // informs the browser process that it can stop accurately listening to the |
| // screen orientation if no other process cares about it. |
| Stop(); |
| |
| // Queries whether accelerometer auto rotation of screen orientation is |
| // enabled, or the user has locked the screen orientation at the OS level. |
| // This can be called at any time, whether or not the listener is started. |
| // It's currently only implemented on Android. |
| IsAutoRotateEnabledByUser() => (bool enabled); |
| }; |