1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef DeviceMotionController_h
6 #define DeviceMotionController_h
8 #include "core/dom/DocumentSupplementable.h"
9 #include "core/frame/DeviceSingleWindowEventController.h"
15 class DeviceMotionController final : public DeviceSingleWindowEventController, public DocumentSupplement {
16 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(DeviceMotionController);
18 virtual ~DeviceMotionController();
20 static const char* supplementName();
21 static DeviceMotionController& from(Document&);
23 virtual void trace(Visitor*) override;
26 explicit DeviceMotionController(Document&);
28 // Inherited from DeviceEventControllerBase.
29 virtual void registerWithDispatcher() override;
30 virtual void unregisterWithDispatcher() override;
31 virtual bool hasLastData() override;
33 // Inherited from DeviceSingleWindowEventController.
34 virtual PassRefPtrWillBeRawPtr<Event> lastEvent() const override;
35 virtual const AtomicString& eventTypeName() const override;
36 virtual bool isNullEvent(Event*) const override;
41 #endif // DeviceMotionController_h