| OLD | NEW |
| (Empty) |
| 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 ScreenOrientationDispatcher_h | |
| 6 #define ScreenOrientationDispatcher_h | |
| 7 | |
| 8 #include "platform/heap/Handle.h" | |
| 9 #include "public/platform/WebScreenOrientationListener.h" | |
| 10 | |
| 11 #if ENABLE(OILPAN) | |
| 12 #include "wtf/HashSet.h" | |
| 13 #else | |
| 14 #include "wtf/Vector.h" | |
| 15 #endif | |
| 16 | |
| 17 namespace WebCore { | |
| 18 | |
| 19 class ScreenOrientationController; | |
| 20 | |
| 21 class ScreenOrientationDispatcher FINAL : public NoBaseWillBeGarbageCollectedFin
alized<ScreenOrientationDispatcher>, public blink::WebScreenOrientationListener
{ | |
| 22 public: | |
| 23 static ScreenOrientationDispatcher& instance(); | |
| 24 | |
| 25 void addController(ScreenOrientationController*); | |
| 26 | |
| 27 #if ENABLE(OILPAN) | |
| 28 void trace(Visitor*); | |
| 29 #else | |
| 30 void removeController(ScreenOrientationController*); | |
| 31 #endif | |
| 32 | |
| 33 private: | |
| 34 ScreenOrientationDispatcher(); | |
| 35 | |
| 36 #if !ENABLE(OILPAN) | |
| 37 void purgeControllers(); | |
| 38 #endif | |
| 39 | |
| 40 void startListening(); | |
| 41 void stopListening(); | |
| 42 | |
| 43 // WebScreenOrientationListener API. | |
| 44 virtual void didChangeScreenOrientation(blink::WebScreenOrientationType) OVE
RRIDE; | |
| 45 | |
| 46 #if ENABLE(OILPAN) | |
| 47 HeapHashSet<WeakMember<ScreenOrientationController> > m_controllers; | |
| 48 #else | |
| 49 Vector<ScreenOrientationController*> m_controllers; | |
| 50 bool m_needsPurge; | |
| 51 bool m_isDispatching; | |
| 52 #endif | |
| 53 | |
| 54 }; | |
| 55 | |
| 56 } // namespace WebCore | |
| 57 | |
| 58 #endif // ScreenOrientationDispatcher_h | |
| OLD | NEW |