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 DeviceOrientationController_h
6 #define DeviceOrientationController_h
8 #include "core/dom/DocumentSupplementable.h"
9 #include "core/frame/DeviceSingleWindowEventController.h"
13 class DeviceOrientationData;
16 class DeviceOrientationController FINAL : public DeviceSingleWindowEventController, public DocumentSupplement {
17 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(DeviceOrientationController);
19 virtual ~DeviceOrientationController();
21 static const char* supplementName();
22 static DeviceOrientationController& from(Document&);
24 // Inherited from DeviceSingleWindowEventController.
25 void didUpdateData() OVERRIDE;
27 void setOverride(DeviceOrientationData*);
30 virtual void trace(Visitor*) OVERRIDE;
33 explicit DeviceOrientationController(Document&);
35 // Inherited from DeviceEventControllerBase.
36 virtual void registerWithDispatcher() OVERRIDE;
37 virtual void unregisterWithDispatcher() OVERRIDE;
38 virtual bool hasLastData() OVERRIDE;
40 // Inherited from DeviceSingleWindowEventController.
41 virtual PassRefPtrWillBeRawPtr<Event> lastEvent() const OVERRIDE;
42 virtual const AtomicString& eventTypeName() const OVERRIDE;
43 virtual bool isNullEvent(Event*) const OVERRIDE;
45 DeviceOrientationData* lastData() const;
47 PersistentWillBeMember<DeviceOrientationData> m_overrideOrientationData;
52 #endif // DeviceOrientationController_h