| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "web/FullscreenController.h" | 31 #include "web/FullscreenController.h" |
| 32 | 32 |
| 33 #include "core/dom/Document.h" | 33 #include "core/dom/Document.h" |
| 34 #include "core/dom/Fullscreen.h" | 34 #include "core/dom/Fullscreen.h" |
| 35 #include "core/frame/LocalFrame.h" | 35 #include "core/frame/LocalFrame.h" |
| 36 #include "core/frame/PageScaleConstraintsSet.h" | 36 #include "core/frame/PageScaleConstraintsSet.h" |
| 37 #include "core/html/HTMLMediaElement.h" | 37 #include "core/html/HTMLMediaElement.h" |
| 38 #include "core/html/HTMLVideoElement.h" | 38 #include "core/html/HTMLVideoElement.h" |
| 39 #include "platform/LayoutTestSupport.h" | |
| 40 #include "platform/RuntimeEnabledFeatures.h" | 39 #include "platform/RuntimeEnabledFeatures.h" |
| 41 #include "public/platform/WebLayerTreeView.h" | 40 #include "public/platform/WebLayerTreeView.h" |
| 42 #include "public/web/WebFrameClient.h" | 41 #include "public/web/WebFrameClient.h" |
| 43 #include "web/WebLocalFrameImpl.h" | 42 #include "web/WebLocalFrameImpl.h" |
| 44 #include "web/WebSettingsImpl.h" | 43 #include "web/WebSettingsImpl.h" |
| 45 #include "web/WebViewImpl.h" | 44 #include "web/WebViewImpl.h" |
| 46 | 45 |
| 47 namespace blink { | 46 namespace blink { |
| 48 | 47 |
| 49 PassOwnPtrWillBeRawPtr<FullscreenController> FullscreenController::create(WebVie
wImpl* webViewImpl) | 48 PassOwnPtrWillBeRawPtr<FullscreenController> FullscreenController::create(WebVie
wImpl* webViewImpl) |
| (...skipping 27 matching lines...) Expand all Loading... |
| 77 m_webViewImpl->mainFrame()->setScrollOffset(WebSize()); | 76 m_webViewImpl->mainFrame()->setScrollOffset(WebSize()); |
| 78 m_webViewImpl->setVisualViewportOffset(FloatPoint()); | 77 m_webViewImpl->setVisualViewportOffset(FloatPoint()); |
| 79 m_haveEnteredFullscreen = true; | 78 m_haveEnteredFullscreen = true; |
| 80 } | 79 } |
| 81 | 80 |
| 82 Fullscreen::from(document).didEnterFullScreenForElement(element.get()); | 81 Fullscreen::from(document).didEnterFullScreenForElement(element.get()); |
| 83 ASSERT(Fullscreen::currentFullScreenElementFrom(document) == element); | 82 ASSERT(Fullscreen::currentFullScreenElementFrom(document) == element); |
| 84 | 83 |
| 85 if (isHTMLVideoElement(element)) { | 84 if (isHTMLVideoElement(element)) { |
| 86 HTMLVideoElement* videoElement = toHTMLVideoElement(element); | 85 HTMLVideoElement* videoElement = toHTMLVideoElement(element); |
| 87 if (videoElement->usesOverlayFullscreenVideo()) { | 86 if (videoElement->usesOverlayFullscreenVideo() && m_webViewImpl->layerTr
eeView()) |
| 88 if (videoElement->webMediaPlayer() | 87 m_webViewImpl->layerTreeView()->setHasTransparentBackground(true); |
| 89 // FIXME: There is no embedder-side handling in layout test mode
. | |
| 90 && !LayoutTestSupport::isRunningLayoutTest()) { | |
| 91 videoElement->webMediaPlayer()->enterFullscreen(); | |
| 92 } | |
| 93 if (m_webViewImpl->layerTreeView()) | |
| 94 m_webViewImpl->layerTreeView()->setHasTransparentBackground(true
); | |
| 95 } | |
| 96 } | 88 } |
| 97 } | 89 } |
| 98 | 90 |
| 99 void FullscreenController::didExitFullScreen() | 91 void FullscreenController::didExitFullScreen() |
| 100 { | 92 { |
| 101 if (!m_fullScreenFrame) | 93 if (!m_fullScreenFrame) |
| 102 return; | 94 return; |
| 103 | 95 |
| 104 if (Document* document = m_fullScreenFrame->document()) { | 96 if (Document* document = m_fullScreenFrame->document()) { |
| 105 if (Fullscreen* fullscreen = Fullscreen::fromIfExists(*document)) { | 97 if (Fullscreen* fullscreen = Fullscreen::fromIfExists(*document)) { |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 } | 193 } |
| 202 | 194 |
| 203 DEFINE_TRACE(FullscreenController) | 195 DEFINE_TRACE(FullscreenController) |
| 204 { | 196 { |
| 205 visitor->trace(m_provisionalFullScreenElement); | 197 visitor->trace(m_provisionalFullScreenElement); |
| 206 visitor->trace(m_fullScreenFrame); | 198 visitor->trace(m_fullScreenFrame); |
| 207 } | 199 } |
| 208 | 200 |
| 209 } // namespace blink | 201 } // namespace blink |
| 210 | 202 |
| OLD | NEW |