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 ScreenOrientationController_h | 5 #ifndef ScreenOrientationController_h |
| 6 #define ScreenOrientationController_h | 6 #define ScreenOrientationController_h |
| 7 | 7 |
| 8 #include "core/dom/DocumentSupplementable.h" | 8 #include "core/dom/DocumentSupplementable.h" |
| 9 #include "public/platform/WebScreenOrientationType.h" | 9 #include "public/platform/WebScreenOrientationType.h" |
| 10 | 10 |
| 11 namespace WebCore { | 11 namespace WebCore { |
| 12 | 12 |
| 13 class ScreenOrientationController FINAL : public NoBaseWillBeGarbageCollected<Sc reenOrientationController>, public DocumentSupplement { | 13 class ScreenOrientationController FINAL : public NoBaseWillBeGarbageCollected<Sc reenOrientationController>, public DocumentSupplement { |
| 14 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ScreenOrientationController); | 14 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ScreenOrientationController); |
| 15 public: | 15 public: |
| 16 #if !ENABLE(OILPAN) | 16 #if !ENABLE(OILPAN) |
| 17 virtual ~ScreenOrientationController(); | 17 virtual ~ScreenOrientationController(); |
| 18 #endif | 18 #endif |
| 19 | 19 |
| 20 void didChangeScreenOrientation(blink::WebScreenOrientationType); | 20 void didChangeScreenOrientation(blink::WebScreenOrientationType); |
| 21 | 21 |
| 22 blink::WebScreenOrientationType orientation() const { return m_orientation; } | 22 blink::WebScreenOrientationType orientation() const { return m_orientation; } |
| 23 | 23 |
| 24 // DocumentSupplement API. | 24 // DocumentSupplement API. |
| 25 static ScreenOrientationController& from(Document&); | 25 static ScreenOrientationController& from(Document&); |
| 26 static const char* supplementName(); | 26 static const char* supplementName(); |
| 27 | 27 |
| 28 virtual void trace(Visitor* visitor) OVERRIDE { DocumentSupplement::trace(vi sitor); } | |
|
haraken
2014/05/07 12:22:44
Nit: We'll need this once we make Document& a Memb
| |
| 29 | |
| 30 private: | 28 private: |
| 31 explicit ScreenOrientationController(Document&); | 29 explicit ScreenOrientationController(Document&); |
| 32 | 30 |
| 33 void dispatchOrientationChangeEvent(); | 31 void dispatchOrientationChangeEvent(); |
| 34 | 32 |
| 35 Document& m_document; | 33 Document& m_document; |
| 36 blink::WebScreenOrientationType m_orientation; | 34 blink::WebScreenOrientationType m_orientation; |
| 37 }; | 35 }; |
| 38 | 36 |
| 39 } // namespace WebCore | 37 } // namespace WebCore |
| 40 | 38 |
| 41 #endif // ScreenOrientationController_h | 39 #endif // ScreenOrientationController_h |
| OLD | NEW |