Chromium Code Reviews| 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 "platform/Supplementable.h" | 11 #include "platform/Supplementable.h" |
| 11 #include "platform/Timer.h" | 12 #include "platform/Timer.h" |
| 12 #include "public/platform/WebScreenOrientation.h" | 13 #include "public/platform/WebScreenOrientation.h" |
| 13 #include "wtf/Vector.h" | 14 #include "wtf/Vector.h" |
| 14 #include "wtf/text/AtomicString.h" | 15 #include "wtf/text/AtomicString.h" |
| 15 #include "wtf/text/WTFString.h" | 16 #include "wtf/text/WTFString.h" |
| 16 | 17 |
| 17 namespace WebCore { | 18 namespace WebCore { |
| 18 | 19 |
| 19 class Document; | 20 class Document; |
| 20 class Screen; | 21 class Screen; |
| 21 | 22 |
| 22 class ScreenOrientation FINAL : public Supplement<Screen>, DOMWindowProperty { | 23 class ScreenOrientation FINAL : public NoBaseWillBeGarbageCollectedFinalized<Scr eenOrientation>, public WillBeHeapSupplement<Screen>, DOMWindowProperty { |
| 24 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ScreenOrientation); | |
| 23 public: | 25 public: |
| 24 static ScreenOrientation& from(Screen&); | 26 static ScreenOrientation& from(Screen&); |
| 25 virtual ~ScreenOrientation(); | 27 virtual ~ScreenOrientation(); |
| 26 | 28 |
| 27 DEFINE_STATIC_ATTRIBUTE_EVENT_LISTENER(orientationchange); | 29 DEFINE_STATIC_ATTRIBUTE_EVENT_LISTENER(orientationchange); |
| 28 | 30 |
| 29 static const AtomicString& orientation(Screen&); | 31 static const AtomicString& orientation(Screen&); |
| 30 static bool lockOrientation(Screen&, const Vector<String>& orientations); | 32 static bool lockOrientation(Screen&, const Vector<String>& orientations); |
| 31 static bool lockOrientation(Screen&, const AtomicString& orientation); | 33 static bool lockOrientation(Screen&, const AtomicString& orientation); |
| 32 static void unlockOrientation(Screen&); | 34 static void unlockOrientation(Screen&); |
| 33 | 35 |
| 36 virtual void trace(Visitor*) { } | |
|
haraken
2014/03/14 11:39:45
Don't you need to trace WillBeHeapSupplement::trac
zerny-chromium
2014/03/14 11:54:48
Yes. I missed that one. The ToT plugin should catc
sof
2014/03/14 12:01:31
Why? Isn't that the method that's implemented here
| |
| 37 | |
| 34 private: | 38 private: |
| 35 explicit ScreenOrientation(Screen&); | 39 explicit ScreenOrientation(Screen&); |
| 36 | 40 |
| 37 void lockOrientationAsync(blink::WebScreenOrientations); | 41 void lockOrientationAsync(blink::WebScreenOrientations); |
| 38 void orientationLockTimerFired(Timer<ScreenOrientation>*); | 42 void orientationLockTimerFired(Timer<ScreenOrientation>*); |
| 39 | 43 |
| 40 static const char* supplementName(); | 44 static const char* supplementName(); |
| 41 Document* document() const; | 45 Document* document() const; |
| 42 | 46 |
| 43 Timer<ScreenOrientation> m_orientationLockTimer; | 47 Timer<ScreenOrientation> m_orientationLockTimer; |
| 44 blink::WebScreenOrientations m_lockedOrientations; | 48 blink::WebScreenOrientations m_lockedOrientations; |
| 45 }; | 49 }; |
| 46 | 50 |
| 47 } // namespace WebCore | 51 } // namespace WebCore |
| 48 | 52 |
| 49 #endif // ScreenOrientation_h | 53 #endif // ScreenOrientation_h |
| OLD | NEW |