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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 m_exitFullscreenPageScaleFactor = m_webViewImpl->pageScaleFactor
(); | 82 m_exitFullscreenPageScaleFactor = m_webViewImpl->pageScaleFactor
(); |
83 m_exitFullscreenScrollOffset = m_webViewImpl->mainFrame()->scrol
lOffset(); | 83 m_exitFullscreenScrollOffset = m_webViewImpl->mainFrame()->scrol
lOffset(); |
84 m_exitFullscreenPinchViewportOffset = m_webViewImpl->pinchViewpo
rtOffset(); | 84 m_exitFullscreenPinchViewportOffset = m_webViewImpl->pinchViewpo
rtOffset(); |
85 m_webViewImpl->setPageScaleFactor(1.0f); | 85 m_webViewImpl->setPageScaleFactor(1.0f); |
86 } | 86 } |
87 | 87 |
88 FullscreenElementStack::from(*doc).webkitDidEnterFullScreenForElemen
t(0); | 88 FullscreenElementStack::from(*doc).webkitDidEnterFullScreenForElemen
t(0); |
89 if (RuntimeEnabledFeatures::overlayFullscreenVideoEnabled()) { | 89 if (RuntimeEnabledFeatures::overlayFullscreenVideoEnabled()) { |
90 Element* element = FullscreenElementStack::currentFullScreenElem
entFrom(*doc); | 90 Element* element = FullscreenElementStack::currentFullScreenElem
entFrom(*doc); |
91 ASSERT(element); | 91 ASSERT(element); |
92 if (isHTMLMediaElement(*element)) { | 92 if (isHTMLMediaElement(*element) && m_webViewImpl->layerTreeView
()) |
93 HTMLMediaElement* mediaElement = toHTMLMediaElement(element)
; | 93 m_webViewImpl->layerTreeView()->setHasTransparentBackground(
true); |
94 if (mediaElement->player() && mediaElement->player()->canSho
wFullscreenOverlay() | |
95 // FIXME: There is no embedder-side handling in layout t
est mode. | |
96 && !isRunningLayoutTest()) { | |
97 mediaElement->player()->showFullscreenOverlay(); | |
98 } | |
99 if (m_webViewImpl->layerTreeView()) | |
100 m_webViewImpl->layerTreeView()->setHasTransparentBackgro
und(true); | |
101 } | |
102 } | 94 } |
103 } | 95 } |
104 } | 96 } |
105 } | 97 } |
106 | 98 |
107 void FullscreenController::willExitFullScreen() | 99 void FullscreenController::willExitFullScreen() |
108 { | 100 { |
109 if (!m_fullScreenFrame) | 101 if (!m_fullScreenFrame) |
110 return; | 102 return; |
111 | 103 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 } | 151 } |
160 | 152 |
161 // We are already in fullscreen mode. | 153 // We are already in fullscreen mode. |
162 if (m_fullScreenFrame) { | 154 if (m_fullScreenFrame) { |
163 m_provisionalFullScreenElement = element; | 155 m_provisionalFullScreenElement = element; |
164 willEnterFullScreen(); | 156 willEnterFullScreen(); |
165 didEnterFullScreen(); | 157 didEnterFullScreen(); |
166 return; | 158 return; |
167 } | 159 } |
168 | 160 |
| 161 if (RuntimeEnabledFeatures::overlayFullscreenVideoEnabled() |
| 162 && isHTMLMediaElement(element) |
| 163 // FIXME: There is no embedder-side handling in layout test mode. |
| 164 && !isRunningLayoutTest()) { |
| 165 HTMLMediaElement* mediaElement = toHTMLMediaElement(element); |
| 166 if (mediaElement->player() && mediaElement->player()->canShowFullscreenO
verlay()) { |
| 167 mediaElement->player()->showFullscreenOverlay(); |
| 168 m_provisionalFullScreenElement = element; |
| 169 return; |
| 170 } |
| 171 } |
| 172 |
169 // We need to transition to fullscreen mode. | 173 // We need to transition to fullscreen mode. |
170 if (WebViewClient* client = m_webViewImpl->client()) { | 174 if (WebViewClient* client = m_webViewImpl->client()) { |
171 if (client->enterFullScreen()) | 175 if (client->enterFullScreen()) |
172 m_provisionalFullScreenElement = element; | 176 m_provisionalFullScreenElement = element; |
173 } | 177 } |
174 } | 178 } |
175 | 179 |
176 void FullscreenController::exitFullScreenForElement(WebCore::Element* element) | 180 void FullscreenController::exitFullScreenForElement(WebCore::Element* element) |
177 { | 181 { |
178 // The client is exiting full screen, so don't send a notification. | 182 // The client is exiting full screen, so don't send a notification. |
179 if (m_isCancelingFullScreen) | 183 if (m_isCancelingFullScreen) |
180 return; | 184 return; |
181 | 185 if (RuntimeEnabledFeatures::overlayFullscreenVideoEnabled() |
| 186 && isHTMLMediaElement(element) |
| 187 // FIXME: There is no embedder-side handling in layout test mode. |
| 188 && !isRunningLayoutTest()) { |
| 189 HTMLMediaElement* mediaElement = toHTMLMediaElement(element); |
| 190 if (mediaElement->player()) |
| 191 mediaElement->player()->hideFullscreenOverlay(); |
| 192 return; |
| 193 } |
182 if (WebViewClient* client = m_webViewImpl->client()) | 194 if (WebViewClient* client = m_webViewImpl->client()) |
183 client->exitFullScreen(); | 195 client->exitFullScreen(); |
184 } | 196 } |
185 | 197 |
186 } | 198 } |
187 | 199 |
OLD | NEW |