summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/modules/sensor/relative_orientation_sensor.cc
blob: 87d9a9190b467bea59033d53a51ac0fe2557de76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "third_party/blink/renderer/modules/sensor/relative_orientation_sensor.h"

#include "third_party/blink/public/mojom/feature_policy/feature_policy_feature.mojom-blink.h"

using device::mojom::blink::SensorType;

namespace blink {

RelativeOrientationSensor* RelativeOrientationSensor::Create(
    ExecutionContext* execution_context,
    const SpatialSensorOptions* options,
    ExceptionState& exception_state) {
  return MakeGarbageCollected<RelativeOrientationSensor>(
      execution_context, options, exception_state);
}

// static
RelativeOrientationSensor* RelativeOrientationSensor::Create(
    ExecutionContext* execution_context,
    ExceptionState& exception_state) {
  return Create(execution_context, SpatialSensorOptions::Create(),
                exception_state);
}

RelativeOrientationSensor::RelativeOrientationSensor(
    ExecutionContext* execution_context,
    const SpatialSensorOptions* options,
    ExceptionState& exception_state)
    : OrientationSensor(execution_context,
                        options,
                        exception_state,
                        SensorType::RELATIVE_ORIENTATION_QUATERNION,
                        {mojom::FeaturePolicyFeature::kAccelerometer,
                         mojom::FeaturePolicyFeature::kGyroscope}) {}

void RelativeOrientationSensor::Trace(blink::Visitor* visitor) {
  OrientationSensor::Trace(visitor);
}

}  // namespace blink