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 "core/page/PageLifecycleObserver.h" | |
9 #include "public/platform/WebScreenOrientationType.h" | 10 #include "public/platform/WebScreenOrientationType.h" |
10 | 11 |
11 namespace WebCore { | 12 namespace WebCore { |
12 | 13 |
13 class FrameView; | 14 class FrameView; |
14 | 15 |
15 class ScreenOrientationController FINAL : public NoBaseWillBeGarbageCollected<Sc reenOrientationController>, public DocumentSupplement { | 16 class ScreenOrientationController FINAL : public NoBaseWillBeGarbageCollected<Sc reenOrientationController>, public DocumentSupplement, public PageLifecycleObser ver { |
16 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ScreenOrientationController); | 17 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ScreenOrientationController); |
17 public: | 18 public: |
18 virtual ~ScreenOrientationController(); | 19 virtual ~ScreenOrientationController(); |
19 | 20 |
20 blink::WebScreenOrientationType orientation() const; | 21 blink::WebScreenOrientationType orientation() const; |
21 | 22 |
22 // DocumentSupplement API. | 23 // DocumentSupplement API. |
23 static ScreenOrientationController& from(Document&); | 24 static ScreenOrientationController& from(Document&); |
24 static const char* supplementName(); | 25 static const char* supplementName(); |
25 | 26 |
26 private: | 27 private: |
27 explicit ScreenOrientationController(Document&); | 28 explicit ScreenOrientationController(Document&); |
28 static blink::WebScreenOrientationType computeOrientation(FrameView*); | 29 static blink::WebScreenOrientationType computeOrientation(FrameView*); |
29 | 30 |
31 // Inherited from PageLifecycleObserver. | |
32 virtual void pageVisibilityChanged() OVERRIDE; | |
33 | |
30 Document& m_document; | 34 Document& m_document; |
35 blink::WebScreenOrientationType m_lastVisibleOrientation; | |
mlamouri (slow - plz ping)
2014/05/28 14:05:33
Hmm, with your current implementation, this ought
Inactive
2014/05/28 15:27:28
Done.
| |
31 }; | 36 }; |
32 | 37 |
33 } // namespace WebCore | 38 } // namespace WebCore |
34 | 39 |
35 #endif // ScreenOrientationController_h | 40 #endif // ScreenOrientationController_h |
OLD | NEW |