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

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

Issue 381753002: Revert of [screen-orientation] Update implementation to match recent spec changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 5 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
« no previous file with comments | « Source/core/frame/LocalFrame.h ('k') | Source/modules/EventTargetModulesFactory.in » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/LocalFrame.cpp
diff --git a/Source/core/frame/LocalFrame.cpp b/Source/core/frame/LocalFrame.cpp
index 7d801447ee086cc95ec36cf16c02b687e1f3008b..366b8f016ab3270992d0c20a59aa0c703e6113e9 100644
--- a/Source/core/frame/LocalFrame.cpp
+++ b/Source/core/frame/LocalFrame.cpp
@@ -159,6 +159,30 @@
}
}
+void LocalFrame::sendOrientationChangeEvent()
+{
+ if (!RuntimeEnabledFeatures::orientationEventEnabled() && !RuntimeEnabledFeatures::screenOrientationEnabled())
+ return;
+
+ if (page()->visibilityState() != PageVisibilityStateVisible)
+ return;
+
+ LocalDOMWindow* window = domWindow();
+ if (!window)
+ return;
+ window->dispatchEvent(Event::create(EventTypeNames::orientationchange));
+
+ // Notify subframes.
+ Vector<RefPtr<LocalFrame> > childFrames;
+ for (Frame* child = tree().firstChild(); child; child = child->tree().nextSibling()) {
+ if (child->isLocalFrame())
+ childFrames.append(toLocalFrame(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)
{
// In setting printing, we should not validate resources already cached for the document.
« no previous file with comments | « Source/core/frame/LocalFrame.h ('k') | Source/modules/EventTargetModulesFactory.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698