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. 4 5#ifndef DeviceMotionController_h 6#define DeviceMotionController_h 7 8#include "core/dom/DocumentSupplementable.h" 9#include "core/frame/DeviceSingleWindowEventController.h" 10 11namespace blink { 12 13class DeviceMotionData; 14class Event; 15 16class DeviceMotionController FINAL : public DeviceSingleWindowEventController, public DocumentSupplement { 17 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(DeviceMotionController); 18public: 19 virtual ~DeviceMotionController(); 20 21 static const char* supplementName(); 22 static DeviceMotionController& from(Document&); 23 24 virtual void trace(Visitor*) OVERRIDE; 25 26private: 27 explicit DeviceMotionController(Document&); 28 29 // Inherited from DeviceEventControllerBase. 30 virtual void registerWithDispatcher() OVERRIDE; 31 virtual void unregisterWithDispatcher() OVERRIDE; 32 virtual bool hasLastData() OVERRIDE; 33 34 // Inherited from DeviceSingleWindowEventController. 35 virtual PassRefPtrWillBeRawPtr<Event> lastEvent() const OVERRIDE; 36 virtual const AtomicString& eventTypeName() const OVERRIDE; 37 virtual bool isNullEvent(Event*) const OVERRIDE; 38}; 39 40} // namespace blink 41 42#endif // DeviceMotionController_h 43