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

Unified Diff: third_party/WebKit/Source/modules/sensor/Accelerometer.cpp

Issue 2788633004: [sensors] Align Accelerometer interface with the specification (Closed)
Patch Set: Created 3 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: third_party/WebKit/Source/modules/sensor/Accelerometer.cpp
diff --git a/third_party/WebKit/Source/modules/sensor/Accelerometer.cpp b/third_party/WebKit/Source/modules/sensor/Accelerometer.cpp
index 2af1644f03d4ce083673a0726a43ad71768fe61d..364e752f1bfe0ba43b1fefae42da7ec7dff369fc 100644
--- a/third_party/WebKit/Source/modules/sensor/Accelerometer.cpp
+++ b/third_party/WebKit/Source/modules/sensor/Accelerometer.cpp
@@ -4,15 +4,12 @@
#include "modules/sensor/Accelerometer.h"
-#include "bindings/core/v8/ScriptPromise.h"
-#include "bindings/core/v8/ScriptPromiseResolver.h"
-
using device::mojom::blink::SensorType;
namespace blink {
Accelerometer* Accelerometer::create(ExecutionContext* executionContext,
- const AccelerometerOptions& options,
+ const SensorOptions& options,
ExceptionState& exceptionState) {
return new Accelerometer(executionContext, options, exceptionState);
}
@@ -20,18 +17,16 @@ Accelerometer* Accelerometer::create(ExecutionContext* executionContext,
// static
Accelerometer* Accelerometer::create(ExecutionContext* executionContext,
ExceptionState& exceptionState) {
- return create(executionContext, AccelerometerOptions(), exceptionState);
+ return create(executionContext, SensorOptions(), exceptionState);
}
Accelerometer::Accelerometer(ExecutionContext* executionContext,
- const AccelerometerOptions& options,
+ const SensorOptions& options,
ExceptionState& exceptionState)
: Sensor(executionContext,
options,
exceptionState,
- options.includeGravity() ? SensorType::ACCELEROMETER
- : SensorType::LINEAR_ACCELERATION),
- m_accelerometerOptions(options) {}
+ SensorType::ACCELEROMETER) {}
double Accelerometer::x(bool& isNull) const {
return readingValue(0, isNull);
@@ -45,10 +40,6 @@ double Accelerometer::z(bool& isNull) const {
return readingValue(2, isNull);
}
-bool Accelerometer::includesGravity() const {
- return m_accelerometerOptions.includeGravity();
-}
-
DEFINE_TRACE(Accelerometer) {
Sensor::trace(visitor);
}
« no previous file with comments | « third_party/WebKit/Source/modules/sensor/Accelerometer.h ('k') | third_party/WebKit/Source/modules/sensor/Accelerometer.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698