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 "base/android/jni_android.h" | 8 #include <jni.h> |
Michael van Ouwerkerk
2014/07/23 14:44:01
What's the difference?
mlamouri (slow - plz ping)
2014/07/23 14:51:33
It will include less stuff. I needed JNIEnv and ba
| |
9 | |
9 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
10 #include "content/browser/screen_orientation/screen_orientation_provider.h" | 11 #include "content/browser/screen_orientation/screen_orientation_provider.h" |
11 #include "content/public/browser/web_contents_observer.h" | 12 #include "content/public/browser/web_contents_observer.h" |
12 | 13 |
13 namespace content { | 14 namespace content { |
14 | 15 |
15 class WebContentsImpl; | 16 class WebContentsImpl; |
16 | 17 |
17 class ScreenOrientationProviderAndroid : public ScreenOrientationProvider, | 18 class ScreenOrientationProviderAndroid : public ScreenOrientationProvider, |
18 public WebContentsObserver { | 19 public WebContentsObserver { |
(...skipping 20 matching lines...) Expand all Loading... | |
39 // whether the orientation will need to change to match the |lock|. | 40 // whether the orientation will need to change to match the |lock|. |
40 bool LockMatchesCurrentOrientation(blink::WebScreenOrientationLockType lock); | 41 bool LockMatchesCurrentOrientation(blink::WebScreenOrientationLockType lock); |
41 | 42 |
42 // Returns the lock type that should be associated with 'natural' lock. | 43 // Returns the lock type that should be associated with 'natural' lock. |
43 // Returns WebScreenOrientationLockDefault if the natural lock type can't be | 44 // Returns WebScreenOrientationLockDefault if the natural lock type can't be |
44 // found. | 45 // found. |
45 blink::WebScreenOrientationLockType GetNaturalLockType() const; | 46 blink::WebScreenOrientationLockType GetNaturalLockType() const; |
46 | 47 |
47 virtual ~ScreenOrientationProviderAndroid(); | 48 virtual ~ScreenOrientationProviderAndroid(); |
48 | 49 |
49 base::android::ScopedJavaGlobalRef<jobject> j_screen_orientation_provider_; | |
50 | |
51 // ScreenOrientationDispatcherHost owns ScreenOrientationProvider so | 50 // ScreenOrientationDispatcherHost owns ScreenOrientationProvider so |
52 // dispatcher_ should not point to an invalid memory. | 51 // dispatcher_ should not point to an invalid memory. |
53 ScreenOrientationDispatcherHost* dispatcher_; | 52 ScreenOrientationDispatcherHost* dispatcher_; |
54 | 53 |
55 // Whether the ScreenOrientationProvider currently has a lock applied. | 54 // Whether the ScreenOrientationProvider currently has a lock applied. |
56 bool lock_applied_; | 55 bool lock_applied_; |
57 | 56 |
58 struct LockInformation { | 57 struct LockInformation { |
59 LockInformation(int request_id, blink::WebScreenOrientationLockType lock); | 58 LockInformation(int request_id, blink::WebScreenOrientationLockType lock); |
60 int request_id; | 59 int request_id; |
61 blink::WebScreenOrientationLockType lock; | 60 blink::WebScreenOrientationLockType lock; |
62 }; | 61 }; |
63 LockInformation* pending_lock_; | 62 LockInformation* pending_lock_; |
64 | 63 |
65 DISALLOW_COPY_AND_ASSIGN(ScreenOrientationProviderAndroid); | 64 DISALLOW_COPY_AND_ASSIGN(ScreenOrientationProviderAndroid); |
66 }; | 65 }; |
67 | 66 |
68 } // namespace content | 67 } // namespace content |
69 | 68 |
70 #endif // CONTENT_BROWSER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_PROVIDER_ANDROID _H_ | 69 #endif // CONTENT_BROWSER_SCREEN_ORIENTATION_SCREEN_ORIENTATION_PROVIDER_ANDROID _H_ |
OLD | NEW |