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 #include "modules/screen_orientation/ScreenOrientationController.h" | 5 #include "modules/screen_orientation/ScreenOrientationController.h" |
6 | 6 |
7 #include "core/events/Event.h" | 7 #include "core/events/Event.h" |
8 #include "core/frame/FrameHost.h" | 8 #include "core/frame/FrameHost.h" |
9 #include "core/frame/FrameView.h" | 9 #include "core/frame/FrameView.h" |
10 #include "core/frame/LocalFrame.h" | 10 #include "core/frame/LocalFrame.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 orientationType = computeOrientation(chromeClient.screenInfo().rect, scr
eenInfo.orientationAngle); | 86 orientationType = computeOrientation(chromeClient.screenInfo().rect, scr
eenInfo.orientationAngle); |
87 } | 87 } |
88 ASSERT(orientationType != WebScreenOrientationUndefined); | 88 ASSERT(orientationType != WebScreenOrientationUndefined); |
89 | 89 |
90 m_orientation->setType(orientationType); | 90 m_orientation->setType(orientationType); |
91 m_orientation->setAngle(screenInfo.orientationAngle); | 91 m_orientation->setAngle(screenInfo.orientationAngle); |
92 } | 92 } |
93 | 93 |
94 bool ScreenOrientationController::isActiveAndVisible() const | 94 bool ScreenOrientationController::isActiveAndVisible() const |
95 { | 95 { |
96 return m_orientation && m_client && frame() && page() && page()->isPageVisib
le(); | 96 return m_orientation && m_client && page() && page()->isPageVisible(); |
97 } | 97 } |
98 | 98 |
99 void ScreenOrientationController::pageVisibilityChanged() | 99 void ScreenOrientationController::pageVisibilityChanged() |
100 { | 100 { |
101 notifyDispatcher(); | 101 notifyDispatcher(); |
102 | 102 |
103 if (!isActiveAndVisible()) | 103 if (!isActiveAndVisible()) |
104 return; | 104 return; |
105 | 105 |
106 DCHECK(frame()); | 106 DCHECK(frame()); |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 | 214 |
215 DEFINE_TRACE(ScreenOrientationController) | 215 DEFINE_TRACE(ScreenOrientationController) |
216 { | 216 { |
217 visitor->trace(m_orientation); | 217 visitor->trace(m_orientation); |
218 DOMWindowProperty::trace(visitor); | 218 DOMWindowProperty::trace(visitor); |
219 Supplement<LocalFrame>::trace(visitor); | 219 Supplement<LocalFrame>::trace(visitor); |
220 PlatformEventController::trace(visitor); | 220 PlatformEventController::trace(visitor); |
221 } | 221 } |
222 | 222 |
223 } // namespace blink | 223 } // namespace blink |
OLD | NEW |