| 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 "config.h" | 5 #include "config.h" |
| 6 #include "modules/screen_orientation/ScreenOrientationController.h" | 6 #include "modules/screen_orientation/ScreenOrientationController.h" |
| 7 | 7 |
| 8 #include "core/events/Event.h" | 8 #include "core/events/Event.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 17 matching lines...) Expand all Loading... |
| 28 ScreenOrientationController* controller = new ScreenOrientationController(fr
ame, client); | 28 ScreenOrientationController* controller = new ScreenOrientationController(fr
ame, client); |
| 29 WillBeHeapSupplement<LocalFrame>::provideTo(frame, supplementName(), adoptPt
rWillBeNoop(controller)); | 29 WillBeHeapSupplement<LocalFrame>::provideTo(frame, supplementName(), adoptPt
rWillBeNoop(controller)); |
| 30 } | 30 } |
| 31 | 31 |
| 32 ScreenOrientationController* ScreenOrientationController::from(LocalFrame& frame
) | 32 ScreenOrientationController* ScreenOrientationController::from(LocalFrame& frame
) |
| 33 { | 33 { |
| 34 return static_cast<ScreenOrientationController*>(WillBeHeapSupplement<LocalF
rame>::from(frame, supplementName())); | 34 return static_cast<ScreenOrientationController*>(WillBeHeapSupplement<LocalF
rame>::from(frame, supplementName())); |
| 35 } | 35 } |
| 36 | 36 |
| 37 ScreenOrientationController::ScreenOrientationController(LocalFrame& frame, WebS
creenOrientationClient* client) | 37 ScreenOrientationController::ScreenOrientationController(LocalFrame& frame, WebS
creenOrientationClient* client) |
| 38 : FrameDestructionObserver(&frame) | 38 : LocalFrameLifecycleObserver(&frame) |
| 39 , PlatformEventController(frame.page()) | 39 , PlatformEventController(frame.page()) |
| 40 , m_client(client) | 40 , m_client(client) |
| 41 , m_dispatchEventTimer(this, &ScreenOrientationController::dispatchEventTime
rFired) | 41 , m_dispatchEventTimer(this, &ScreenOrientationController::dispatchEventTime
rFired) |
| 42 { | 42 { |
| 43 } | 43 } |
| 44 | 44 |
| 45 const char* ScreenOrientationController::supplementName() | 45 const char* ScreenOrientationController::supplementName() |
| 46 { | 46 { |
| 47 return "ScreenOrientationController"; | 47 return "ScreenOrientationController"; |
| 48 } | 48 } |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 { | 205 { |
| 206 if (m_orientation && page()->visibilityState() == PageVisibilityStateVisible
) | 206 if (m_orientation && page()->visibilityState() == PageVisibilityStateVisible
) |
| 207 startUpdating(); | 207 startUpdating(); |
| 208 else | 208 else |
| 209 stopUpdating(); | 209 stopUpdating(); |
| 210 } | 210 } |
| 211 | 211 |
| 212 DEFINE_TRACE(ScreenOrientationController) | 212 DEFINE_TRACE(ScreenOrientationController) |
| 213 { | 213 { |
| 214 visitor->trace(m_orientation); | 214 visitor->trace(m_orientation); |
| 215 FrameDestructionObserver::trace(visitor); | 215 LocalFrameLifecycleObserver::trace(visitor); |
| 216 WillBeHeapSupplement<LocalFrame>::trace(visitor); | 216 WillBeHeapSupplement<LocalFrame>::trace(visitor); |
| 217 PlatformEventController::trace(visitor); | 217 PlatformEventController::trace(visitor); |
| 218 } | 218 } |
| 219 | 219 |
| 220 } // namespace blink | 220 } // namespace blink |
| OLD | NEW |