| 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/FrameHost.h" | 9 #include "core/frame/FrameHost.h" |
| 10 #include "core/frame/FrameView.h" | 10 #include "core/frame/FrameView.h" |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 // current frame as it will prevent side effects from the change event | 143 // current frame as it will prevent side effects from the change event |
| 144 // handlers. | 144 // handlers. |
| 145 WillBeHeapVector<RefPtrWillBeMember<LocalFrame>> childFrames; | 145 WillBeHeapVector<RefPtrWillBeMember<LocalFrame>> childFrames; |
| 146 for (Frame* child = frame()->tree().firstChild(); child; child = child->tree
().nextSibling()) { | 146 for (Frame* child = frame()->tree().firstChild(); child; child = child->tree
().nextSibling()) { |
| 147 if (child->isLocalFrame()) | 147 if (child->isLocalFrame()) |
| 148 childFrames.append(toLocalFrame(child)); | 148 childFrames.append(toLocalFrame(child)); |
| 149 } | 149 } |
| 150 | 150 |
| 151 // Notify current orientation object. | 151 // Notify current orientation object. |
| 152 if (!m_dispatchEventTimer.isActive()) | 152 if (!m_dispatchEventTimer.isActive()) |
| 153 m_dispatchEventTimer.startOneShot(0, FROM_HERE); | 153 m_dispatchEventTimer.startOneShot(0, BLINK_FROM_HERE); |
| 154 | 154 |
| 155 // ... and child frames, if they have a ScreenOrientationController. | 155 // ... and child frames, if they have a ScreenOrientationController. |
| 156 for (size_t i = 0; i < childFrames.size(); ++i) { | 156 for (size_t i = 0; i < childFrames.size(); ++i) { |
| 157 if (ScreenOrientationController* controller = ScreenOrientationControlle
r::from(*childFrames[i])) | 157 if (ScreenOrientationController* controller = ScreenOrientationControlle
r::from(*childFrames[i])) |
| 158 controller->notifyOrientationChanged(); | 158 controller->notifyOrientationChanged(); |
| 159 } | 159 } |
| 160 } | 160 } |
| 161 | 161 |
| 162 void ScreenOrientationController::setOrientation(ScreenOrientation* orientation) | 162 void ScreenOrientationController::setOrientation(ScreenOrientation* orientation) |
| 163 { | 163 { |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 | 239 |
| 240 DEFINE_TRACE(ScreenOrientationController) | 240 DEFINE_TRACE(ScreenOrientationController) |
| 241 { | 241 { |
| 242 visitor->trace(m_orientation); | 242 visitor->trace(m_orientation); |
| 243 LocalFrameLifecycleObserver::trace(visitor); | 243 LocalFrameLifecycleObserver::trace(visitor); |
| 244 WillBeHeapSupplement<LocalFrame>::trace(visitor); | 244 WillBeHeapSupplement<LocalFrame>::trace(visitor); |
| 245 PlatformEventController::trace(visitor); | 245 PlatformEventController::trace(visitor); |
| 246 } | 246 } |
| 247 | 247 |
| 248 } // namespace blink | 248 } // namespace blink |
| OLD | NEW |