Chromium Code Reviews| Index: Source/web/WebLocalFrameImpl.cpp |
| diff --git a/Source/web/WebLocalFrameImpl.cpp b/Source/web/WebLocalFrameImpl.cpp |
| index ba48c3cb59054cfdc24b06f04a1bbe9967519abf..5ff02bd49e5a2921711f241ab2e908aa7e5cc975 100644 |
| --- a/Source/web/WebLocalFrameImpl.cpp |
| +++ b/Source/web/WebLocalFrameImpl.cpp |
| @@ -1374,8 +1374,16 @@ void WebLocalFrameImpl::resetMatchCount() |
| void WebLocalFrameImpl::sendOrientationChangeEvent() |
| { |
| - if (frame()) |
| - frame()->sendOrientationChangeEvent(); |
| + if (!frame()) |
| + return; |
| + |
| + // Screen Orientation API |
| + if (ScreenOrientationController::from(*frame())) |
|
sof
2014/07/09 07:02:53
Would be preferable (to my eyes) to create a bindi
|
| + ScreenOrientationController::from(*frame())->notifyOrientationChanged(); |
| + |
| + // Legacy window.orientation API. |
| + if (frame()->domWindow()) |
| + frame()->domWindow()->dispatchEvent(Event::create(EventTypeNames::orientationchange)); |
| } |
| void WebLocalFrameImpl::dispatchMessageEventWithOriginCheck(const WebSecurityOrigin& intendedTargetOrigin, const WebDOMEvent& event) |
| @@ -1536,9 +1544,9 @@ void WebLocalFrameImpl::setWebCoreFrame(PassRefPtr<WebCore::LocalFrame> frame) |
| provideGeolocationTo(*m_frame, m_geolocationClientProxy.get()); |
| m_geolocationClientProxy->setController(GeolocationController::from(m_frame.get())); |
| provideMIDITo(*m_frame, MIDIClientProxy::create(m_client ? m_client->webMIDIClient() : 0)); |
| - if (RuntimeEnabledFeatures::screenOrientationEnabled()) |
| - ScreenOrientationController::provideTo(*m_frame, m_client ? m_client->webScreenOrientationClient() : 0); |
| provideLocalFileSystemTo(*m_frame, LocalFileSystemClient::create()); |
| + |
| + ScreenOrientationController::provideTo(*m_frame, m_client ? m_client->webScreenOrientationClient() : 0); |
| } |
| } |