| 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/dom/Document.h" | 7 #include "core/dom/Document.h" |
| 8 #include "core/dom/TaskRunnerHelper.h" | 8 #include "core/dom/TaskRunnerHelper.h" |
| 9 #include "core/events/Event.h" | 9 #include "core/events/Event.h" |
| 10 #include "core/frame/FrameHost.h" | 10 #include "core/frame/FrameHost.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 LocalFrame& frame) { | 36 LocalFrame& frame) { |
| 37 return static_cast<ScreenOrientationControllerImpl*>( | 37 return static_cast<ScreenOrientationControllerImpl*>( |
| 38 ScreenOrientationController::from(frame)); | 38 ScreenOrientationController::from(frame)); |
| 39 } | 39 } |
| 40 | 40 |
| 41 ScreenOrientationControllerImpl::ScreenOrientationControllerImpl( | 41 ScreenOrientationControllerImpl::ScreenOrientationControllerImpl( |
| 42 LocalFrame& frame, | 42 LocalFrame& frame, |
| 43 WebScreenOrientationClient* client) | 43 WebScreenOrientationClient* client) |
| 44 : ScreenOrientationController(frame), | 44 : ScreenOrientationController(frame), |
| 45 ContextLifecycleObserver(frame.document()), | 45 ContextLifecycleObserver(frame.document()), |
| 46 PlatformEventController(frame.page()), | 46 PlatformEventController(&frame), |
| 47 m_client(client), | 47 m_client(client), |
| 48 m_dispatchEventTimer( | 48 m_dispatchEventTimer( |
| 49 TaskRunnerHelper::get(TaskType::MiscPlatformAPI, &frame), | 49 TaskRunnerHelper::get(TaskType::MiscPlatformAPI, &frame), |
| 50 this, | 50 this, |
| 51 &ScreenOrientationControllerImpl::dispatchEventTimerFired) {} | 51 &ScreenOrientationControllerImpl::dispatchEventTimerFired) {} |
| 52 | 52 |
| 53 // Compute the screen orientation using the orientation angle and the screen | 53 // Compute the screen orientation using the orientation angle and the screen |
| 54 // width / height. | 54 // width / height. |
| 55 WebScreenOrientationType ScreenOrientationControllerImpl::computeOrientation( | 55 WebScreenOrientationType ScreenOrientationControllerImpl::computeOrientation( |
| 56 const IntRect& rect, | 56 const IntRect& rect, |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 } | 235 } |
| 236 | 236 |
| 237 DEFINE_TRACE(ScreenOrientationControllerImpl) { | 237 DEFINE_TRACE(ScreenOrientationControllerImpl) { |
| 238 visitor->trace(m_orientation); | 238 visitor->trace(m_orientation); |
| 239 ContextLifecycleObserver::trace(visitor); | 239 ContextLifecycleObserver::trace(visitor); |
| 240 Supplement<LocalFrame>::trace(visitor); | 240 Supplement<LocalFrame>::trace(visitor); |
| 241 PlatformEventController::trace(visitor); | 241 PlatformEventController::trace(visitor); |
| 242 } | 242 } |
| 243 | 243 |
| 244 } // namespace blink | 244 } // namespace blink |
| OLD | NEW |