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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 } | 99 } |
100 } | 100 } |
101 | 101 |
102 void FullscreenController::didExitFullScreen() | 102 void FullscreenController::didExitFullScreen() |
103 { | 103 { |
104 if (!m_fullScreenFrame) | 104 if (!m_fullScreenFrame) |
105 return; | 105 return; |
106 | 106 |
107 if (Document* document = m_fullScreenFrame->document()) { | 107 if (Document* document = m_fullScreenFrame->document()) { |
108 if (Fullscreen* fullscreen = Fullscreen::fromIfExists(*document)) { | 108 if (Fullscreen* fullscreen = Fullscreen::fromIfExists(*document)) { |
109 if (fullscreen->webkitCurrentFullScreenElement()) { | 109 Element* element = fullscreen->webkitCurrentFullScreenElement(); |
| 110 if (element) { |
110 // When the client exits from full screen we have to call fullyE
xitFullscreen to notify | 111 // When the client exits from full screen we have to call fullyE
xitFullscreen to notify |
111 // the document. While doing that, suppress notifications back t
o the client. | 112 // the document. While doing that, suppress notifications back t
o the client. |
112 m_isCancelingFullScreen = true; | 113 m_isCancelingFullScreen = true; |
113 Fullscreen::fullyExitFullscreen(*document); | 114 Fullscreen::fullyExitFullscreen(*document); |
114 m_isCancelingFullScreen = false; | 115 m_isCancelingFullScreen = false; |
115 | 116 |
116 if (RuntimeEnabledFeatures::overlayFullscreenVideoEnabled() && m
_webViewImpl->layerTreeView()) | 117 // If the video used overlay fullscreen mode, the background was
made transparent. Restore the transparency. |
| 118 if (isHTMLVideoElement(element) && m_webViewImpl->layerTreeView(
)) |
117 m_webViewImpl->layerTreeView()->setHasTransparentBackground(
m_webViewImpl->isTransparent()); | 119 m_webViewImpl->layerTreeView()->setHasTransparentBackground(
m_webViewImpl->isTransparent()); |
118 | 120 |
119 if (m_exitFullscreenPageScaleFactor) { | 121 if (m_exitFullscreenPageScaleFactor) { |
120 updatePageScaleConstraints(true); | 122 updatePageScaleConstraints(true); |
121 m_webViewImpl->setPageScaleFactor(m_exitFullscreenPageScaleF
actor); | 123 m_webViewImpl->setPageScaleFactor(m_exitFullscreenPageScaleF
actor); |
122 m_webViewImpl->mainFrame()->setScrollOffset(WebSize(m_exitFu
llscreenScrollOffset)); | 124 m_webViewImpl->mainFrame()->setScrollOffset(WebSize(m_exitFu
llscreenScrollOffset)); |
123 m_webViewImpl->setVisualViewportOffset(m_exitFullscreenVisua
lViewportOffset); | 125 m_webViewImpl->setVisualViewportOffset(m_exitFullscreenVisua
lViewportOffset); |
124 m_exitFullscreenPageScaleFactor = 0; | 126 m_exitFullscreenPageScaleFactor = 0; |
125 m_exitFullscreenScrollOffset = IntSize(); | 127 m_exitFullscreenScrollOffset = IntSize(); |
126 } | 128 } |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 } | 196 } |
195 | 197 |
196 DEFINE_TRACE(FullscreenController) | 198 DEFINE_TRACE(FullscreenController) |
197 { | 199 { |
198 visitor->trace(m_provisionalFullScreenElement); | 200 visitor->trace(m_provisionalFullScreenElement); |
199 visitor->trace(m_fullScreenFrame); | 201 visitor->trace(m_fullScreenFrame); |
200 } | 202 } |
201 | 203 |
202 } // namespace blink | 204 } // namespace blink |
203 | 205 |
OLD | NEW |