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_DELEGATE_ANDROID_H
_ | 5 #ifndef CONTENT_BROWSER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_DELEGATE_ANDROID_H
_ |
6 #define CONTENT_BROWSER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_DELEGATE_ANDROID_H
_ | 6 #define CONTENT_BROWSER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_DELEGATE_ANDROID_H
_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "content/public/browser/screen_orientation_delegate.h" | 11 #include "content/public/browser/screen_orientation_delegate.h" |
12 #include "third_party/WebKit/public/platform/modules/screen_orientation/WebScree
nOrientationLockType.h" | 12 #include "third_party/WebKit/public/platform/modules/screen_orientation/WebScree
nOrientationLockType.h" |
13 | 13 |
14 namespace content { | 14 namespace content { |
15 | 15 |
16 class WebContents; | 16 class WebContents; |
17 | 17 |
18 // Android implementation of ScreenOrientationDelegate. The functionality of | 18 // Android implementation of ScreenOrientationDelegate. The functionality of |
19 // ScreenOrientationProvider is always supported. | 19 // ScreenOrientationProvider is always supported. |
20 class ScreenOrientationDelegateAndroid : public ScreenOrientationDelegate { | 20 class ScreenOrientationDelegateAndroid : public ScreenOrientationDelegate { |
21 public: | 21 public: |
22 ScreenOrientationDelegateAndroid(); | 22 ScreenOrientationDelegateAndroid(); |
23 ~ScreenOrientationDelegateAndroid() override; | 23 ~ScreenOrientationDelegateAndroid() override; |
24 | 24 |
25 static bool Register(JNIEnv* env); | |
26 | |
27 // Ask the ScreenOrientationListener (Java) to start accurately listening to | 25 // Ask the ScreenOrientationListener (Java) to start accurately listening to |
28 // the screen orientation. It keep track of the number of start request if it | 26 // the screen orientation. It keep track of the number of start request if it |
29 // is already running an accurate listening. | 27 // is already running an accurate listening. |
30 static void StartAccurateListening(); | 28 static void StartAccurateListening(); |
31 | 29 |
32 // Ask the ScreenOrientationListener (Java) to stop accurately listening to | 30 // Ask the ScreenOrientationListener (Java) to stop accurately listening to |
33 // the screen orientation. It will actually stop only if the number of stop | 31 // the screen orientation. It will actually stop only if the number of stop |
34 // requests matches the number of start requests. | 32 // requests matches the number of start requests. |
35 static void StopAccurateListening(); | 33 static void StopAccurateListening(); |
36 | 34 |
37 // ScreenOrientationDelegate: | 35 // ScreenOrientationDelegate: |
38 bool FullScreenRequired(WebContents* web_contents) override; | 36 bool FullScreenRequired(WebContents* web_contents) override; |
39 void Lock(WebContents* web_contents, | 37 void Lock(WebContents* web_contents, |
40 blink::WebScreenOrientationLockType lock_orientation) override; | 38 blink::WebScreenOrientationLockType lock_orientation) override; |
41 bool ScreenOrientationProviderSupported() override; | 39 bool ScreenOrientationProviderSupported() override; |
42 void Unlock(WebContents* web_contents) override; | 40 void Unlock(WebContents* web_contents) override; |
43 | 41 |
44 private: | 42 private: |
45 DISALLOW_COPY_AND_ASSIGN(ScreenOrientationDelegateAndroid); | 43 DISALLOW_COPY_AND_ASSIGN(ScreenOrientationDelegateAndroid); |
46 }; | 44 }; |
47 | 45 |
48 } // namespace content | 46 } // namespace content |
49 | 47 |
50 #endif // CONTENT_BROWSER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_DELEGATE_ANDROI
D_H_ | 48 #endif // CONTENT_BROWSER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_DELEGATE_ANDROI
D_H_ |
OLD | NEW |