summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/modules/xr/xr_input_source_event.cc
blob: c9e918a53b9da0830d4475d487f5d34805c2472b (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
// Copyright 2018 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/xr/xr_input_source_event.h"

namespace blink {

XRInputSourceEvent::XRInputSourceEvent() {}

XRInputSourceEvent::XRInputSourceEvent(const AtomicString& type,
                                       XRFrame* frame,
                                       XRInputSource* input_source)
    : Event(type, Bubbles::kYes, Cancelable::kNo),
      frame_(frame),
      input_source_(input_source) {}

XRInputSourceEvent::XRInputSourceEvent(
    const AtomicString& type,
    const XRInputSourceEventInit& initializer)
    : Event(type, initializer) {
  if (initializer.hasFrame())
    frame_ = initializer.frame();
  if (initializer.hasInputSource())
    input_source_ = initializer.inputSource();
}

XRInputSourceEvent::~XRInputSourceEvent() {}

const AtomicString& XRInputSourceEvent::InterfaceName() const {
  return EventNames::XRInputSourceEvent;
}

void XRInputSourceEvent::Trace(blink::Visitor* visitor) {
  visitor->Trace(frame_);
  visitor->Trace(input_source_);
  Event::Trace(visitor);
}

}  // namespace blink