| 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 ScreenOrientation_h | 5 #ifndef ScreenOrientation_h |
| 6 #define ScreenOrientation_h | 6 #define ScreenOrientation_h |
| 7 | 7 |
| 8 #include "core/events/EventTarget.h" | 8 #include "core/events/EventTarget.h" |
| 9 #include "core/frame/DOMWindowProperty.h" | 9 #include "core/frame/DOMWindowProperty.h" |
| 10 #include "heap/Handle.h" | 10 #include "heap/Handle.h" |
| 11 #include "platform/Supplementable.h" | 11 #include "platform/Supplementable.h" |
| 12 #include "platform/Timer.h" | 12 #include "platform/Timer.h" |
| 13 #include "public/platform/WebScreenOrientation.h" | 13 #include "public/platform/WebScreenOrientationLockType.h" |
| 14 #include "wtf/text/AtomicString.h" | 14 #include "wtf/text/AtomicString.h" |
| 15 #include "wtf/text/WTFString.h" | 15 #include "wtf/text/WTFString.h" |
| 16 | 16 |
| 17 namespace WebCore { | 17 namespace WebCore { |
| 18 | 18 |
| 19 class Document; | 19 class Document; |
| 20 class Screen; | 20 class Screen; |
| 21 | 21 |
| 22 class ScreenOrientation FINAL : public NoBaseWillBeGarbageCollectedFinalized<Scr
eenOrientation>, public WillBeHeapSupplement<Screen>, DOMWindowProperty { | 22 class ScreenOrientation FINAL : public NoBaseWillBeGarbageCollectedFinalized<Scr
eenOrientation>, public WillBeHeapSupplement<Screen>, DOMWindowProperty { |
| 23 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ScreenOrientation); | 23 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ScreenOrientation); |
| 24 public: | 24 public: |
| 25 static ScreenOrientation& from(Screen&); | 25 static ScreenOrientation& from(Screen&); |
| 26 virtual ~ScreenOrientation(); | 26 virtual ~ScreenOrientation(); |
| 27 | 27 |
| 28 DEFINE_STATIC_ATTRIBUTE_EVENT_LISTENER(orientationchange); | 28 DEFINE_STATIC_ATTRIBUTE_EVENT_LISTENER(orientationchange); |
| 29 | 29 |
| 30 static const AtomicString& orientation(Screen&); | 30 static const AtomicString& orientation(Screen&); |
| 31 static bool lockOrientation(Screen&, const AtomicString& orientation); | 31 static bool lockOrientation(Screen&, const AtomicString& orientation); |
| 32 static void unlockOrientation(Screen&); | 32 static void unlockOrientation(Screen&); |
| 33 | 33 |
| 34 virtual void trace(Visitor*) { } | 34 virtual void trace(Visitor*) { } |
| 35 | 35 |
| 36 private: | 36 private: |
| 37 explicit ScreenOrientation(Screen&); | 37 explicit ScreenOrientation(Screen&); |
| 38 | 38 |
| 39 void lockOrientationAsync(blink::WebScreenOrientations); | 39 void lockOrientationAsync(blink::WebScreenOrientationLockType); |
| 40 void orientationLockTimerFired(Timer<ScreenOrientation>*); | 40 void orientationLockTimerFired(Timer<ScreenOrientation>*); |
| 41 | 41 |
| 42 static const char* supplementName(); | 42 static const char* supplementName(); |
| 43 Document* document() const; | 43 Document* document() const; |
| 44 | 44 |
| 45 Timer<ScreenOrientation> m_orientationLockTimer; | 45 Timer<ScreenOrientation> m_orientationLockTimer; |
| 46 blink::WebScreenOrientations m_lockedOrientations; | 46 blink::WebScreenOrientationLockType m_prospectiveLock; |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 } // namespace WebCore | 49 } // namespace WebCore |
| 50 | 50 |
| 51 #endif // ScreenOrientation_h | 51 #endif // ScreenOrientation_h |
| OLD | NEW |