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 #include "content/browser/screen_orientation/screen_orientation_delegate_android
.h" | 5 #include "content/browser/screen_orientation/screen_orientation_delegate_android
.h" |
6 | 6 |
7 #include "content/browser/android/content_view_core_impl.h" | 7 #include "content/browser/android/content_view_core_impl.h" |
8 #include "jni/ScreenOrientationProvider_jni.h" | 8 #include "jni/ScreenOrientationProvider_jni.h" |
9 | 9 |
10 namespace content { | 10 namespace content { |
11 | 11 |
12 ScreenOrientationDelegateAndroid::ScreenOrientationDelegateAndroid() { | 12 ScreenOrientationDelegateAndroid::ScreenOrientationDelegateAndroid() { |
13 } | 13 } |
14 | 14 |
15 ScreenOrientationDelegateAndroid::~ScreenOrientationDelegateAndroid() { | 15 ScreenOrientationDelegateAndroid::~ScreenOrientationDelegateAndroid() { |
16 } | 16 } |
17 | 17 |
18 // static | 18 // static |
19 bool ScreenOrientationDelegateAndroid::Register(JNIEnv* env) { | |
20 return RegisterNativesImpl(env); | |
21 } | |
22 | |
23 // static | |
24 void ScreenOrientationDelegateAndroid::StartAccurateListening() { | 19 void ScreenOrientationDelegateAndroid::StartAccurateListening() { |
25 Java_ScreenOrientationProvider_startAccurateListening( | 20 Java_ScreenOrientationProvider_startAccurateListening( |
26 base::android::AttachCurrentThread()); | 21 base::android::AttachCurrentThread()); |
27 } | 22 } |
28 | 23 |
29 // static | 24 // static |
30 void ScreenOrientationDelegateAndroid::StopAccurateListening() { | 25 void ScreenOrientationDelegateAndroid::StopAccurateListening() { |
31 Java_ScreenOrientationProvider_stopAccurateListening( | 26 Java_ScreenOrientationProvider_stopAccurateListening( |
32 base::android::AttachCurrentThread()); | 27 base::android::AttachCurrentThread()); |
33 } | 28 } |
(...skipping 18 matching lines...) Expand all Loading... |
52 // Always supported on Android | 47 // Always supported on Android |
53 return true; | 48 return true; |
54 } | 49 } |
55 | 50 |
56 void ScreenOrientationDelegateAndroid::Unlock(WebContents* web_contents) { | 51 void ScreenOrientationDelegateAndroid::Unlock(WebContents* web_contents) { |
57 Java_ScreenOrientationProvider_unlockOrientation( | 52 Java_ScreenOrientationProvider_unlockOrientation( |
58 base::android::AttachCurrentThread()); | 53 base::android::AttachCurrentThread()); |
59 } | 54 } |
60 | 55 |
61 } // namespace content | 56 } // namespace content |
OLD | NEW |