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/ScreenOrientationControllerImpl.h" | 5 #include "modules/screen_orientation/ScreenOrientationControllerImpl.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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 | 202 |
203 void ScreenOrientationControllerImpl::unregisterWithDispatcher() { | 203 void ScreenOrientationControllerImpl::unregisterWithDispatcher() { |
204 ScreenOrientationDispatcher::instance().removeController(this); | 204 ScreenOrientationDispatcher::instance().removeController(this); |
205 } | 205 } |
206 | 206 |
207 bool ScreenOrientationControllerImpl::hasLastData() { | 207 bool ScreenOrientationControllerImpl::hasLastData() { |
208 return true; | 208 return true; |
209 } | 209 } |
210 | 210 |
211 void ScreenOrientationControllerImpl::frameDestroyed() { | 211 void ScreenOrientationControllerImpl::frameDestroyed() { |
| 212 stopUpdating(); |
212 m_client = nullptr; | 213 m_client = nullptr; |
213 DOMWindowProperty::frameDestroyed(); | 214 DOMWindowProperty::frameDestroyed(); |
214 m_activeLock = false; | 215 m_activeLock = false; |
215 } | 216 } |
216 | 217 |
217 void ScreenOrientationControllerImpl::notifyDispatcher() { | 218 void ScreenOrientationControllerImpl::notifyDispatcher() { |
218 if (m_orientation && page()->isPageVisible()) | 219 if (m_orientation && page()->isPageVisible()) |
219 startUpdating(); | 220 startUpdating(); |
220 else | 221 else |
221 stopUpdating(); | 222 stopUpdating(); |
222 } | 223 } |
223 | 224 |
224 DEFINE_TRACE(ScreenOrientationControllerImpl) { | 225 DEFINE_TRACE(ScreenOrientationControllerImpl) { |
225 visitor->trace(m_orientation); | 226 visitor->trace(m_orientation); |
226 DOMWindowProperty::trace(visitor); | 227 DOMWindowProperty::trace(visitor); |
227 Supplement<LocalFrame>::trace(visitor); | 228 Supplement<LocalFrame>::trace(visitor); |
228 PlatformEventController::trace(visitor); | 229 PlatformEventController::trace(visitor); |
229 } | 230 } |
230 | 231 |
231 } // namespace blink | 232 } // namespace blink |
OLD | NEW |