| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef DeviceLightController_h | 5 #ifndef DeviceLightController_h |
| 6 #define DeviceLightController_h | 6 #define DeviceLightController_h |
| 7 | 7 |
| 8 #include "core/dom/DocumentSupplementable.h" | 8 #include "core/dom/DocumentSupplementable.h" |
| 9 #include "core/frame/DOMWindowLifecycleObserver.h" | 9 #include "core/frame/DeviceSingleWindowEventController.h" |
| 10 #include "core/frame/DeviceSensorEventController.h" | |
| 11 #include "modules/EventModules.h" | |
| 12 | 10 |
| 13 namespace WebCore { | 11 namespace WebCore { |
| 14 | 12 |
| 15 class DOMWindow; | 13 class DOMWindow; |
| 14 class Event; |
| 16 | 15 |
| 17 class DeviceLightController FINAL : public NoBaseWillBeGarbageCollectedFinalized
<DeviceLightController>, public DeviceSensorEventController, public DocumentSupp
lement, public DOMWindowLifecycleObserver { | 16 class DeviceLightController FINAL : public NoBaseWillBeGarbageCollectedFinalized
<DeviceLightController>, public DeviceSingleWindowEventController, public Docume
ntSupplement { |
| 18 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(DeviceLightController); | 17 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(DeviceLightController); |
| 19 public: | 18 public: |
| 20 virtual ~DeviceLightController(); | 19 virtual ~DeviceLightController(); |
| 21 | 20 |
| 22 static const char* supplementName(); | 21 static const char* supplementName(); |
| 23 static DeviceLightController& from(Document&); | 22 static DeviceLightController& from(Document&); |
| 24 | 23 |
| 25 void didChangeDeviceLight(double); | |
| 26 | |
| 27 private: | 24 private: |
| 28 explicit DeviceLightController(Document&); | 25 explicit DeviceLightController(Document&); |
| 26 |
| 27 // Inherited from DeviceEventControllerBase. |
| 29 virtual void registerWithDispatcher() OVERRIDE; | 28 virtual void registerWithDispatcher() OVERRIDE; |
| 30 virtual void unregisterWithDispatcher() OVERRIDE; | 29 virtual void unregisterWithDispatcher() OVERRIDE; |
| 30 virtual bool hasLastData() OVERRIDE; |
| 31 | 31 |
| 32 // Inherited from DOMWindowLifecycleObserver. | 32 // Inherited from DeviceSingleWindowEventController. |
| 33 virtual void didAddEventListener(DOMWindow*, const AtomicString&) OVERRIDE; | 33 virtual PassRefPtrWillBeRawPtr<Event> lastEvent() const OVERRIDE; |
| 34 virtual void didRemoveEventListener(DOMWindow*, const AtomicString&) OVERRID
E; | 34 virtual const AtomicString& eventTypeName() const OVERRIDE; |
| 35 virtual void didRemoveAllEventListeners(DOMWindow*) OVERRIDE; | 35 virtual bool isNullEvent(Event*) const OVERRIDE; |
| 36 | |
| 37 virtual bool hasLastData() OVERRIDE; | |
| 38 virtual PassRefPtrWillBeRawPtr<Event> getLastEvent() OVERRIDE; | |
| 39 virtual bool isNullEvent(Event*) OVERRIDE; | |
| 40 virtual Document* document() OVERRIDE; | |
| 41 | |
| 42 Document& m_document; | |
| 43 }; | 36 }; |
| 44 | 37 |
| 45 } // namespace WebCore | 38 } // namespace WebCore |
| 46 | 39 |
| 47 #endif // DeviceLightController_h | 40 #endif // DeviceLightController_h |
| OLD | NEW |