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 #ifndef CONTENT_BROWSER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_PROVIDER_ANDROID_H
_ | 5 #ifndef CONTENT_BROWSER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_PROVIDER_ANDROID_H
_ |
6 #define CONTENT_BROWSER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_PROVIDER_ANDROID_H
_ | 6 #define CONTENT_BROWSER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_PROVIDER_ANDROID_H
_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 // ScreenOrientationProvider | 27 // ScreenOrientationProvider |
28 virtual void LockOrientation(int request_id, | 28 virtual void LockOrientation(int request_id, |
29 blink::WebScreenOrientationLockType) OVERRIDE; | 29 blink::WebScreenOrientationLockType) OVERRIDE; |
30 virtual void UnlockOrientation() OVERRIDE; | 30 virtual void UnlockOrientation() OVERRIDE; |
31 virtual void OnOrientationChange() OVERRIDE; | 31 virtual void OnOrientationChange() OVERRIDE; |
32 | 32 |
33 // WebContentsObserver | 33 // WebContentsObserver |
34 virtual void DidToggleFullscreenModeForTab(bool entered_fullscreen) OVERRIDE; | 34 virtual void DidToggleFullscreenModeForTab(bool entered_fullscreen) OVERRIDE; |
35 | 35 |
| 36 // Ask the ScreenOrientationListener (Java) to start accurately listening to |
| 37 // the screen orientation. It keep track of the number of start request if it |
| 38 // is already running an accurate listening. |
| 39 static void StartAccurateListening(); |
| 40 |
| 41 // Ask the ScreenOrientationListener (Java) to stop accurately listening to |
| 42 // the screen orientation. It will actually stop only if the number of stop |
| 43 // requests matches the number of start requests. |
| 44 static void StopAccurateListening(); |
| 45 |
36 private: | 46 private: |
37 WebContentsImpl* web_contents_impl(); | 47 WebContentsImpl* web_contents_impl(); |
38 | 48 |
39 // Whether the passed |lock| matches the current orientation. In other words, | 49 // Whether the passed |lock| matches the current orientation. In other words, |
40 // whether the orientation will need to change to match the |lock|. | 50 // whether the orientation will need to change to match the |lock|. |
41 bool LockMatchesCurrentOrientation(blink::WebScreenOrientationLockType lock); | 51 bool LockMatchesCurrentOrientation(blink::WebScreenOrientationLockType lock); |
42 | 52 |
43 // Returns the lock type that should be associated with 'natural' lock. | 53 // Returns the lock type that should be associated with 'natural' lock. |
44 // Returns WebScreenOrientationLockDefault if the natural lock type can't be | 54 // Returns WebScreenOrientationLockDefault if the natural lock type can't be |
45 // found. | 55 // found. |
(...skipping 14 matching lines...) Expand all Loading... |
60 blink::WebScreenOrientationLockType lock; | 70 blink::WebScreenOrientationLockType lock; |
61 }; | 71 }; |
62 LockInformation* pending_lock_; | 72 LockInformation* pending_lock_; |
63 | 73 |
64 DISALLOW_COPY_AND_ASSIGN(ScreenOrientationProviderAndroid); | 74 DISALLOW_COPY_AND_ASSIGN(ScreenOrientationProviderAndroid); |
65 }; | 75 }; |
66 | 76 |
67 } // namespace content | 77 } // namespace content |
68 | 78 |
69 #endif // CONTENT_BROWSER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_PROVIDER_ANDROID
_H_ | 79 #endif // CONTENT_BROWSER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_PROVIDER_ANDROID
_H_ |
OLD | NEW |