| 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 ScreenOrientationDispatcher_h | 5 #ifndef ScreenOrientationDispatcher_h |
| 6 #define ScreenOrientationDispatcher_h | 6 #define ScreenOrientationDispatcher_h |
| 7 | 7 |
| 8 #include "public/platform/WebScreenOrientationListener.h" | 8 #include "public/platform/WebScreenOrientationListener.h" |
| 9 #include "wtf/Vector.h" | 9 #include "wtf/Vector.h" |
| 10 | 10 |
| 11 namespace WebCore { | 11 namespace WebCore { |
| 12 | 12 |
| 13 class ScreenOrientationController; | 13 class ScreenOrientationController; |
| 14 | 14 |
| 15 class ScreenOrientationDispatcher FINAL : public blink::WebScreenOrientationList
ener { | 15 class ScreenOrientationDispatcher FINAL : public blink::WebScreenOrientationList
ener { |
| 16 public: | 16 public: |
| 17 static ScreenOrientationDispatcher& instance(); | 17 static ScreenOrientationDispatcher& instance(); |
| 18 | 18 |
| 19 void addController(ScreenOrientationController*); | 19 void addController(ScreenOrientationController*); |
| 20 void removeController(ScreenOrientationController*); | 20 void removeController(ScreenOrientationController*); |
| 21 | 21 |
| 22 private: | 22 private: |
| 23 ScreenOrientationDispatcher(); | 23 ScreenOrientationDispatcher(); |
| 24 | 24 |
| 25 void purgeControllers(); | 25 void purgeControllers(); |
| 26 void startListening(); | 26 void startListening(); |
| 27 void stopListening(); | 27 void stopListening(); |
| 28 | 28 |
| 29 // WebScreenOrientationListener API. | 29 // WebScreenOrientationListener API. |
| 30 virtual void didChangeScreenOrientation(blink::WebScreenOrientation) OVERRID
E; | 30 virtual void didChangeScreenOrientation(blink::WebScreenOrientationType) OVE
RRIDE; |
| 31 | 31 |
| 32 Vector<ScreenOrientationController*> m_controllers; | 32 Vector<ScreenOrientationController*> m_controllers; |
| 33 bool m_needsPurge; | 33 bool m_needsPurge; |
| 34 bool m_isDispatching; | 34 bool m_isDispatching; |
| 35 }; | 35 }; |
| 36 | 36 |
| 37 } // namespace WebCore | 37 } // namespace WebCore |
| 38 | 38 |
| 39 #endif // ScreenOrientationDispatcher_h | 39 #endif // ScreenOrientationDispatcher_h |
| OLD | NEW |