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 // {Start,Stop}AccurateListen are expected to be used when the platform requires | 9 // {Start,Stop}AccurateListen are expected to be used when the platform requires |
10 // heavy work in order to accurately know the screen orientation. | 10 // heavy work in order to accurately know the screen orientation. |
11 // For example, on Android, this is required for Jelly Bean, where there is no | 11 // For example, on Android, this is required for Jelly Bean, where there is no |
12 // API to be notified of a screen orientation change of 180 degrees. | 12 // API to be notified of a screen orientation change of 180 degrees. |
13 interface ScreenOrientation { | 13 interface ScreenOrientation { |
14 LockOrientation(ScreenOrientationLockType orientation) => | 14 LockOrientation(ScreenOrientationLockType lock) => |
15 (ScreenOrientationLockResult result); | 15 (ScreenOrientationLockResult result, ScreenOrientationLockType lock); |
16 UnlockOrientation(); | 16 UnlockOrientation(); |
17 | 17 |
18 // The renderer frame is now using the Screen Orientation API and informs | 18 // The renderer frame is now using the Screen Orientation API and informs |
19 // the browser process that it should start accurately listening to the screen | 19 // the browser process that it should start accurately listening to the screen |
20 // orientation if it wasn't already. | 20 // orientation if it wasn't already. |
21 StartAccurateListen(); | 21 StartAccurateListen(); |
22 // The renderer frame is no longer using the Screen Orientation API and | 22 // The renderer frame is no longer using the Screen Orientation API and |
23 // informs the browser process that it can stop accurately listening to the | 23 // informs the browser process that it can stop accurately listening to the |
24 // screen orientation if no other frame cares about it. | 24 // screen orientation if no other frame cares about it. |
25 StopAccurateListen(); | 25 StopAccurateListen(); |
26 }; | 26 }; |
OLD | NEW |