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

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

Issue 10698046: Implements part of Device Motion in the Renderer (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Implements new WebKit API, rebases after large refactorings Created 8 years, 4 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/observer_delegate.cc
diff --git a/content/browser/device_orientation/observer_delegate.cc b/content/browser/device_orientation/observer_delegate.cc
index 05798101923b3cd4bcd2a959a97e38bc27991edf..6e1a799e609d814b92de25c74dedc9e94b075446 100644
--- a/content/browser/device_orientation/observer_delegate.cc
+++ b/content/browser/device_orientation/observer_delegate.cc
@@ -6,6 +6,7 @@
#include "base/logging.h"
#include "content/browser/device_orientation/device_data.h"
+#include "content/browser/device_orientation/motion.h"
#include "content/browser/device_orientation/orientation.h"
#include "ipc/ipc_sender.h"
@@ -35,8 +36,14 @@ void ObserverDelegate::OnDeviceDataUpdate(
}
DeviceData* ObserverDelegate::EmptyDeviceData(DeviceData::Type type) {
hans 2012/08/13 13:35:19 maybe a switch here would be better: switch (type
aousterh 2012/08/16 15:23:49 Done.
- DCHECK(type == DeviceData::kTypeOrientation);
- return new Orientation();
+ if (type == DeviceData::kTypeMotion)
+ return new Motion();
+ else if (type == DeviceData::kTypeOrientation)
+ return new Orientation();
+ else {
+ NOTREACHED();
+ return NULL;
+ }
}
} // namespace device_orientation

Powered by Google App Engine
This is Rietveld 408576698