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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 ASSERT(RuntimeEnabledFeatures::screenOrientationEnabled()); | 121 ASSERT(RuntimeEnabledFeatures::screenOrientationEnabled()); |
122 | 122 |
123 if (!isActiveAndVisible()) | 123 if (!isActiveAndVisible()) |
124 return; | 124 return; |
125 | 125 |
126 updateOrientation(); | 126 updateOrientation(); |
127 | 127 |
128 // Keep track of the frames that need to be notified before notifying the | 128 // Keep track of the frames that need to be notified before notifying the |
129 // current frame as it will prevent side effects from the change event | 129 // current frame as it will prevent side effects from the change event |
130 // handlers. | 130 // handlers. |
131 WillBeHeapVector<RefPtrWillBeMember<LocalFrame> > childFrames; | 131 WillBeHeapVector<RefPtrWillBeMember<LocalFrame>> childFrames; |
132 for (Frame* child = frame()->tree().firstChild(); child; child = child->tree
().nextSibling()) { | 132 for (Frame* child = frame()->tree().firstChild(); child; child = child->tree
().nextSibling()) { |
133 if (child->isLocalFrame()) | 133 if (child->isLocalFrame()) |
134 childFrames.append(toLocalFrame(child)); | 134 childFrames.append(toLocalFrame(child)); |
135 } | 135 } |
136 | 136 |
137 // Notify current orientation object. | 137 // Notify current orientation object. |
138 if (!m_dispatchEventTimer.isActive()) | 138 if (!m_dispatchEventTimer.isActive()) |
139 m_dispatchEventTimer.startOneShot(0, FROM_HERE); | 139 m_dispatchEventTimer.startOneShot(0, FROM_HERE); |
140 | 140 |
141 // ... and child frames, if they have a ScreenOrientationController. | 141 // ... and child frames, if they have a ScreenOrientationController. |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 | 211 |
212 void ScreenOrientationController::trace(Visitor* visitor) | 212 void ScreenOrientationController::trace(Visitor* visitor) |
213 { | 213 { |
214 visitor->trace(m_orientation); | 214 visitor->trace(m_orientation); |
215 FrameDestructionObserver::trace(visitor); | 215 FrameDestructionObserver::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 |