Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(713)

Unified Diff: Source/core/frame/LocalFrame.cpp

Issue 277413002: Make screen.orientation implementation use WebScreenInfo::orientationType (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add FIXME comment Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/frame/LocalFrame.cpp
diff --git a/Source/core/frame/LocalFrame.cpp b/Source/core/frame/LocalFrame.cpp
index af2ea348f072d7a8d19cea84d2083385b6738f8b..09c78c8d4f8ed7b0cb884c85ee56f153ecf98978 100644
--- a/Source/core/frame/LocalFrame.cpp
+++ b/Source/core/frame/LocalFrame.cpp
@@ -164,11 +164,21 @@ void LocalFrame::setView(PassRefPtr<FrameView> view)
void LocalFrame::sendOrientationChangeEvent()
{
- if (!RuntimeEnabledFeatures::orientationEventEnabled())
+ if (!RuntimeEnabledFeatures::orientationEventEnabled() && !RuntimeEnabledFeatures::screenOrientationEnabled())
return;
- if (DOMWindow* window = domWindow())
- window->dispatchEvent(Event::create(EventTypeNames::orientationchange));
+ DOMWindow* window = domWindow();
+ if (!window)
+ return;
+ window->dispatchEvent(Event::create(EventTypeNames::orientationchange));
+
+ // Notify subframes.
+ Vector<RefPtr<LocalFrame> > childFrames;
+ for (LocalFrame* child = tree().firstChild(); child; child = child->tree().nextSibling())
+ childFrames.append(child);
+
+ for (size_t i = 0; i < childFrames.size(); ++i)
+ childFrames[i]->sendOrientationChangeEvent();
}
void LocalFrame::setPrinting(bool printing, const FloatSize& pageSize, const FloatSize& originalPageSize, float maximumShrinkRatio)
« no previous file with comments | « LayoutTests/screen_orientation/resources/iframe-listen-orientation-change.html ('k') | Source/modules/modules.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698