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

Unified Diff: content/browser/device_orientation/data_fetcher_impl_android.h

Issue 12771008: Implement java-side browser sensor polling for device motion and device orientation DOM events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed Marcus's comments Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/device_orientation/data_fetcher_impl_android.h
diff --git a/content/browser/device_orientation/data_fetcher_impl_android.h b/content/browser/device_orientation/data_fetcher_impl_android.h
index cbcb363bfaac37cc17de14efc57d1aa83347936a..568fe557a7a1f69bb00ec82cf1df847c9952e8c1 100644
--- a/content/browser/device_orientation/data_fetcher_impl_android.h
+++ b/content/browser/device_orientation/data_fetcher_impl_android.h
@@ -37,6 +37,12 @@ class DataFetcherImplAndroid : public DataFetcher {
// Called from Java via JNI.
void GotOrientation(JNIEnv*, jobject,
double alpha, double beta, double gamma);
+ void GotAcceleration(JNIEnv*, jobject,
+ double x, double y, double z);
+ void GotAccelerationIncludingGravity(JNIEnv*, jobject,
+ double x, double y, double z);
+ void GotRotationRate(JNIEnv*, jobject,
+ double alpha, double beta, double gamma);
// Implementation of DataFetcher.
virtual const DeviceData* GetDeviceData(DeviceData::Type type) OVERRIDE;
@@ -46,8 +52,10 @@ class DataFetcherImplAndroid : public DataFetcher {
const Orientation* GetOrientation();
// Wrappers for JNI methods.
- bool Start(int rate_in_milliseconds);
- void Stop();
+ // TODO(timvolodine): move the DeviceData::Type enum to the service class
+ // once it is implemented.
+ bool Start(DeviceData::Type event_type, int rate_in_milliseconds);
+ void Stop(DeviceData::Type event_type);
// Value returned by GetDeviceData.
scoped_refptr<Orientation> current_orientation_;

Powered by Google App Engine
This is Rietveld 408576698