OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/device_orientation/data_fetcher_impl_android.h" | 5 #include "content/browser/device_orientation/data_fetcher_impl_android.h" |
6 | 6 |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "content/browser/device_orientation/orientation.h" | 9 #include "content/browser/device_orientation/orientation.h" |
10 #include "jni/DeviceMotionAndOrientation_jni.h" | 10 #include "jni/DeviceMotionAndOrientation_jni.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
104 rate_in_milliseconds); | 104 rate_in_milliseconds); |
105 } | 105 } |
106 | 106 |
107 void DataFetcherImplAndroid::Stop(DeviceData::Type event_type) { | 107 void DataFetcherImplAndroid::Stop(DeviceData::Type event_type) { |
108 DCHECK(!device_orientation_.is_null()); | 108 DCHECK(!device_orientation_.is_null()); |
109 Java_DeviceMotionAndOrientation_stop( | 109 Java_DeviceMotionAndOrientation_stop( |
110 AttachCurrentThread(), device_orientation_.obj(), | 110 AttachCurrentThread(), device_orientation_.obj(), |
111 static_cast<jint>(event_type)); | 111 static_cast<jint>(event_type)); |
112 } | 112 } |
113 | 113 |
114 int DataFetcherImplAndroid::GetNumberActiveDeviceMotionSensors() { | |
115 return Java_DeviceMotionAndOrientation_getNumberActiveDeviceMotionSensors( | |
bulach
2013/06/13 09:49:35
nit: for consistency, DCHECK(!device_orientation_
timvolodine
2013/06/13 14:00:40
Done.
| |
116 AttachCurrentThread(), device_orientation_.obj()); | |
117 } | |
118 | |
114 } // namespace content | 119 } // namespace content |
OLD | NEW |