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 24 matching lines...) Expand all Loading... |
35 #include "core/dom/FullscreenElementStack.h" | 35 #include "core/dom/FullscreenElementStack.h" |
36 #include "core/frame/LocalFrame.h" | 36 #include "core/frame/LocalFrame.h" |
37 #include "core/html/HTMLMediaElement.h" | 37 #include "core/html/HTMLMediaElement.h" |
38 #include "platform/LayoutTestSupport.h" | 38 #include "platform/LayoutTestSupport.h" |
39 #include "platform/RuntimeEnabledFeatures.h" | 39 #include "platform/RuntimeEnabledFeatures.h" |
40 #include "public/web/WebFrame.h" | 40 #include "public/web/WebFrame.h" |
41 #include "public/web/WebViewClient.h" | 41 #include "public/web/WebViewClient.h" |
42 #include "web/WebSettingsImpl.h" | 42 #include "web/WebSettingsImpl.h" |
43 #include "web/WebViewImpl.h" | 43 #include "web/WebViewImpl.h" |
44 | 44 |
45 using namespace blink; | |
46 | |
47 namespace blink { | 45 namespace blink { |
48 | 46 |
49 PassOwnPtr<FullscreenController> FullscreenController::create(WebViewImpl* webVi
ewImpl) | 47 PassOwnPtr<FullscreenController> FullscreenController::create(WebViewImpl* webVi
ewImpl) |
50 { | 48 { |
51 return adoptPtr(new FullscreenController(webViewImpl)); | 49 return adoptPtr(new FullscreenController(webViewImpl)); |
52 } | 50 } |
53 | 51 |
54 FullscreenController::FullscreenController(WebViewImpl* webViewImpl) | 52 FullscreenController::FullscreenController(WebViewImpl* webViewImpl) |
55 : m_webViewImpl(webViewImpl) | 53 : m_webViewImpl(webViewImpl) |
56 , m_exitFullscreenPageScaleFactor(0) | 54 , m_exitFullscreenPageScaleFactor(0) |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 } | 144 } |
147 | 145 |
148 fullscreen->didExitFullScreenForElement(0); | 146 fullscreen->didExitFullScreenForElement(0); |
149 } | 147 } |
150 } | 148 } |
151 } | 149 } |
152 | 150 |
153 m_fullScreenFrame.clear(); | 151 m_fullScreenFrame.clear(); |
154 } | 152 } |
155 | 153 |
156 void FullscreenController::enterFullScreenForElement(blink::Element* element) | 154 void FullscreenController::enterFullScreenForElement(Element* element) |
157 { | 155 { |
158 // We are already transitioning to fullscreen for a different element. | 156 // We are already transitioning to fullscreen for a different element. |
159 if (m_provisionalFullScreenElement) { | 157 if (m_provisionalFullScreenElement) { |
160 m_provisionalFullScreenElement = element; | 158 m_provisionalFullScreenElement = element; |
161 return; | 159 return; |
162 } | 160 } |
163 | 161 |
164 // We are already in fullscreen mode. | 162 // We are already in fullscreen mode. |
165 if (m_fullScreenFrame) { | 163 if (m_fullScreenFrame) { |
166 m_provisionalFullScreenElement = element; | 164 m_provisionalFullScreenElement = element; |
167 willEnterFullScreen(); | 165 willEnterFullScreen(); |
168 didEnterFullScreen(); | 166 didEnterFullScreen(); |
169 return; | 167 return; |
170 } | 168 } |
171 | 169 |
172 // We need to transition to fullscreen mode. | 170 // We need to transition to fullscreen mode. |
173 if (WebViewClient* client = m_webViewImpl->client()) { | 171 if (WebViewClient* client = m_webViewImpl->client()) { |
174 if (client->enterFullScreen()) | 172 if (client->enterFullScreen()) |
175 m_provisionalFullScreenElement = element; | 173 m_provisionalFullScreenElement = element; |
176 } | 174 } |
177 } | 175 } |
178 | 176 |
179 void FullscreenController::exitFullScreenForElement(blink::Element* element) | 177 void FullscreenController::exitFullScreenForElement(Element* element) |
180 { | 178 { |
181 // The client is exiting full screen, so don't send a notification. | 179 // The client is exiting full screen, so don't send a notification. |
182 if (m_isCancelingFullScreen) | 180 if (m_isCancelingFullScreen) |
183 return; | 181 return; |
184 if (WebViewClient* client = m_webViewImpl->client()) | 182 if (WebViewClient* client = m_webViewImpl->client()) |
185 client->exitFullScreen(); | 183 client->exitFullScreen(); |
186 } | 184 } |
187 | 185 |
188 } | 186 } // namespace blink |
189 | 187 |
OLD | NEW |