Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(719)

Side by Side Diff: content/browser/device_orientation/data_fetcher_impl_android.cc

Issue 15817019: Additions to the Android java-side Device Motion/Orientation fetching (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed comments from Marcus Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 DCHECK(!device_orientation_.is_null());
116 return Java_DeviceMotionAndOrientation_getNumberActiveDeviceMotionSensors(
117 AttachCurrentThread(), device_orientation_.obj());
118 }
119
114 } // namespace content 120 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698