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

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: Resets last_motion_ 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 6598f0ff03d3556ab506ffbae42d1ec17ffeff6a..1ffe07a7745489a9a729c0d5df094a5c044ec0af 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,16 @@ void ObserverDelegate::OnDeviceDataUpdate(
}
DeviceData* ObserverDelegate::EmptyDeviceData(DeviceData::Type type) {
- DCHECK(type == DeviceData::kTypeOrientation);
- return new Orientation();
+ switch (type) {
+ case DeviceData::kTypeMotion:
+ return new Motion();
+ case DeviceData::kTypeOrientation:
+ return new Orientation();
+ case DeviceData::kTypeTest:
+ NOTREACHED();
+ }
+ NOTREACHED();
+ return NULL;
}
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698