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 FrameView; |
| 14 |
13 class ScreenOrientationController FINAL : public NoBaseWillBeGarbageCollected<Sc
reenOrientationController>, public DocumentSupplement { | 15 class ScreenOrientationController FINAL : public NoBaseWillBeGarbageCollected<Sc
reenOrientationController>, public DocumentSupplement { |
14 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ScreenOrientationController); | 16 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ScreenOrientationController); |
15 public: | 17 public: |
16 #if !ENABLE(OILPAN) | |
17 virtual ~ScreenOrientationController(); | 18 virtual ~ScreenOrientationController(); |
18 #endif | |
19 | 19 |
20 void didChangeScreenOrientation(blink::WebScreenOrientationType); | 20 blink::WebScreenOrientationType orientation() const; |
21 | |
22 blink::WebScreenOrientationType orientation() const { return m_orientation;
} | |
23 | 21 |
24 // DocumentSupplement API. | 22 // DocumentSupplement API. |
25 static ScreenOrientationController& from(Document&); | 23 static ScreenOrientationController& from(Document&); |
26 static const char* supplementName(); | 24 static const char* supplementName(); |
27 | 25 |
28 private: | 26 private: |
29 explicit ScreenOrientationController(Document&); | 27 explicit ScreenOrientationController(Document&); |
30 | 28 static blink::WebScreenOrientationType computeOrientation(FrameView*); |
31 void dispatchOrientationChangeEvent(); | |
32 | 29 |
33 Document& m_document; | 30 Document& m_document; |
34 blink::WebScreenOrientationType m_orientation; | |
35 }; | 31 }; |
36 | 32 |
37 } // namespace WebCore | 33 } // namespace WebCore |
38 | 34 |
39 #endif // ScreenOrientationController_h | 35 #endif // ScreenOrientationController_h |
OLD | NEW |