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 PlatformEventDispatcher_h 6#define PlatformEventDispatcher_h 7 8#include "wtf/Vector.h" 9 10namespace blink { 11class PlatformEventController; 12 13class PlatformEventDispatcher { 14public: 15 void addController(PlatformEventController*); 16 void removeController(PlatformEventController*); 17 18protected: 19 PlatformEventDispatcher(); 20 virtual ~PlatformEventDispatcher(); 21 22 void notifyControllers(); 23 24 virtual void startListening() = 0; 25 virtual void stopListening() = 0; 26 27private: 28 void purgeControllers(); 29 30 Vector<PlatformEventController*> m_controllers; 31 bool m_needsPurge; 32 bool m_isDispatching; 33}; 34 35} // namespace blink 36 37#endif // PlatformEventDispatcher_h 38