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

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

Issue 10755002: Refactors DeviceOrientation to make it more extensible (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 5 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.cc
diff --git a/content/browser/device_orientation/data_fetcher_impl_android.cc b/content/browser/device_orientation/data_fetcher_impl_android.cc
index 03546359ae0fe8ff3e2f8638307f33d9f3408165..395432247bad04504dd82a3670e056138fbc9f8b 100644
--- a/content/browser/device_orientation/data_fetcher_impl_android.cc
+++ b/content/browser/device_orientation/data_fetcher_impl_android.cc
@@ -8,6 +8,7 @@
#include "base/android/scoped_java_ref.h"
#include "base/lazy_instance.h"
#include "base/logging.h"
+#include "content/browser/device_orientation/device_data.h"
#include "content/browser/device_orientation/orientation.h"
#include "jni/device_orientation_jni.h"
@@ -54,6 +55,15 @@ DataFetcherImplAndroid::~DataFetcherImplAndroid() {
Stop();
}
+bool DataFetcherImplAndroid::GetDeviceData(DeviceData* device_data) {
+ switch (device_data->device_data_type()) {
+ case DeviceData::kDeviceOrientationData:
+ return GetOrientation(static_cast<Orientation*>(device_data));
+ default:
+ return false;
+ }
+}
+
bool DataFetcherImplAndroid::GetOrientation(Orientation* orientation) {
// Do we have a new orientation value? (It's safe to do this outside the lock
// because we only skip the lock if the value is null. We always enter the

Powered by Google App Engine
This is Rietveld 408576698