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 DeviceSingleWindowEventController_h 6 #define DeviceSingleWindowEventController_h 7 8 #include "core/frame/DOMWindowLifecycleObserver.h" 9 #include "core/frame/DeviceEventControllerBase.h" 10 #include "platform/heap/Handle.h" 11 12 namespace WebCore { 13 14 class Document; 15 class Event; 16 17 class DeviceSingleWindowEventController : public DeviceEventControllerBase, public DOMWindowLifecycleObserver { 18 public: 19 // Inherited from DeviceEventControllerBase. 20 virtual void didUpdateData() OVERRIDE; 21 22 // Inherited from DOMWindowLifecycleObserver. 23 virtual void didAddEventListener(LocalDOMWindow*, const AtomicString&) OVERRIDE; 24 virtual void didRemoveEventListener(LocalDOMWindow*, const AtomicString&) OVERRIDE; 25 virtual void didRemoveAllEventListeners(LocalDOMWindow*) OVERRIDE; 26 27 protected: 28 explicit DeviceSingleWindowEventController(Document&); 29 virtual ~DeviceSingleWindowEventController(); 30 31 void dispatchDeviceEvent(const PassRefPtrWillBeRawPtr<Event>); 32 33 virtual PassRefPtrWillBeRawPtr<Event> lastEvent() const = 0; 34 virtual const AtomicString& eventTypeName() const = 0; 35 virtual bool isNullEvent(Event*) const = 0; 36 37 private: 38 bool m_needsCheckingNullEvents; 39 Document& m_document; 40 }; 41 42 } // namespace WebCore 43 44 #endif // DeviceSingleWindowEventController_h 45