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

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: Improve test 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 e8297a930010183b21fa250154237d9f29175844..0c9b02ebe4a331016f1d53da9ccdeec4e0975d1d 100644
--- a/Source/core/frame/LocalFrame.cpp
+++ b/Source/core/frame/LocalFrame.cpp
@@ -164,11 +164,15 @@ void LocalFrame::setView(PassRefPtr<FrameView> view)
void LocalFrame::sendOrientationChangeEvent()
{
- if (!RuntimeEnabledFeatures::orientationEventEnabled())
+ if (!RuntimeEnabledFeatures::orientationEventEnabled() && !RuntimeEnabledFeatures::screenOrientationEnabled())
return;
- if (DOMWindow* window = domWindow())
+ if (DOMWindow* window = domWindow()) {
window->dispatchEvent(Event::create(EventTypeNames::orientationchange));
+ // Notify subframes.
+ for (RefPtr<LocalFrame> child = tree().firstChild(); child; child = child->tree().nextSibling())
+ child->sendOrientationChangeEvent();
mlamouri (slow - plz ping) 2014/05/20 20:09:26 I would prefer having that in Page to prevent the
jochen (gone - plz use gerrit) 2014/05/26 10:02:11 when iterating over the tree and dispatching event
Inactive 2014/05/27 14:22:15 Good point, sorry I missed that. I fixed it.
+ }
}
void LocalFrame::setPrinting(bool printing, const FloatSize& pageSize, const FloatSize& originalPageSize, float maximumShrinkRatio)

Powered by Google App Engine
This is Rietveld 408576698