OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be found | 2 // Use of this source code is governed by a BSD-style license that can be found |
3 // in the LICENSE file. | 3 // in the LICENSE file. |
4 | 4 |
5 #include "web/WebViewFrameWidget.h" | 5 #include "web/WebViewFrameWidget.h" |
6 | 6 |
7 #include "web/WebLocalFrameImpl.h" | 7 #include "web/WebLocalFrameImpl.h" |
8 #include "web/WebViewImpl.h" | 8 #include "web/WebViewImpl.h" |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
11 | 11 |
12 WebViewFrameWidget::WebViewFrameWidget(WebWidgetClient* client, WebViewImpl& web
View, WebLocalFrameImpl& mainFrame) | 12 WebViewFrameWidget::WebViewFrameWidget(WebWidgetClient* client, WebViewImpl& web
View, WebLocalFrameImpl& mainFrame) |
13 : m_client(client), m_webView(&webView), m_mainFrame(&mainFrame) | 13 : m_client(client), m_webView(&webView), m_mainFrame(&mainFrame) |
14 { | 14 { |
15 m_mainFrame->setFrameWidget(this); | 15 m_mainFrame->setFrameWidget(this); |
| 16 m_webView->setCompositorVisibility(true); |
16 } | 17 } |
17 | 18 |
18 WebViewFrameWidget::~WebViewFrameWidget() | 19 WebViewFrameWidget::~WebViewFrameWidget() |
19 { | 20 { |
20 } | 21 } |
21 | 22 |
22 void WebViewFrameWidget::close() | 23 void WebViewFrameWidget::close() |
23 { | 24 { |
24 // Note: it's important to use the captured main frame pointer here. During | 25 // Note: it's important to use the captured main frame pointer here. During |
25 // a frame swap, the swapped frame is detached *after* the frame tree is | 26 // a frame swap, the swapped frame is detached *after* the frame tree is |
26 // updated. If the main frame is being swapped, then | 27 // updated. If the main frame is being swapped, then |
27 // m_webView()->mainFrameImpl() will no longer point to the original frame. | 28 // m_webView()->mainFrameImpl() will no longer point to the original frame. |
| 29 m_webView->setCompositorVisibility(false); |
28 m_mainFrame->setFrameWidget(nullptr); | 30 m_mainFrame->setFrameWidget(nullptr); |
29 m_mainFrame = nullptr; | 31 m_mainFrame = nullptr; |
30 m_webView = nullptr; | 32 m_webView = nullptr; |
31 m_client = nullptr; | 33 m_client = nullptr; |
32 | 34 |
33 // Note: this intentionally does not forward to WebView::close(), to make it | 35 // Note: this intentionally does not forward to WebView::close(), to make it |
34 // easier to untangle the cleanup logic later. | 36 // easier to untangle the cleanup logic later. |
35 | 37 |
36 delete this; | 38 delete this; |
37 } | 39 } |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 WebPagePopup* WebViewFrameWidget::pagePopup() const | 230 WebPagePopup* WebViewFrameWidget::pagePopup() const |
229 { | 231 { |
230 return m_webView->pagePopup(); | 232 return m_webView->pagePopup(); |
231 } | 233 } |
232 | 234 |
233 void WebViewFrameWidget::updateTopControlsState(WebTopControlsState constraints,
WebTopControlsState current, bool animate) | 235 void WebViewFrameWidget::updateTopControlsState(WebTopControlsState constraints,
WebTopControlsState current, bool animate) |
234 { | 236 { |
235 return m_webView->updateTopControlsState(constraints, current, animate); | 237 return m_webView->updateTopControlsState(constraints, current, animate); |
236 } | 238 } |
237 | 239 |
238 void WebViewFrameWidget::setVisibilityState(WebPageVisibilityState visibilitySta
te, bool isInitialState) | 240 void WebViewFrameWidget::setVisibilityState(WebPageVisibilityState visibilitySta
te) |
239 { | 241 { |
240 return m_webView->setVisibilityState(visibilityState, isInitialState); | 242 return m_webView->setVisibilityState(visibilityState, false); |
241 } | 243 } |
242 | 244 |
243 void WebViewFrameWidget::setIsTransparent(bool isTransparent) | 245 void WebViewFrameWidget::setIsTransparent(bool isTransparent) |
244 { | 246 { |
245 m_webView->setIsTransparent(isTransparent); | 247 m_webView->setIsTransparent(isTransparent); |
246 } | 248 } |
247 | 249 |
248 bool WebViewFrameWidget::isTransparent() const | 250 bool WebViewFrameWidget::isTransparent() const |
249 { | 251 { |
250 return m_webView->isTransparent(); | 252 return m_webView->isTransparent(); |
251 } | 253 } |
252 | 254 |
253 void WebViewFrameWidget::setBaseBackgroundColor(WebColor color) | 255 void WebViewFrameWidget::setBaseBackgroundColor(WebColor color) |
254 { | 256 { |
255 m_webView->setBaseBackgroundColor(color); | 257 m_webView->setBaseBackgroundColor(color); |
256 } | 258 } |
257 | 259 |
258 void WebViewFrameWidget::scheduleAnimation() | 260 void WebViewFrameWidget::scheduleAnimation() |
259 { | 261 { |
260 m_webView->scheduleAnimation(); | 262 m_webView->scheduleAnimation(); |
261 } | 263 } |
262 | 264 |
263 CompositorProxyClient* WebViewFrameWidget::createCompositorProxyClient() | 265 CompositorProxyClient* WebViewFrameWidget::createCompositorProxyClient() |
264 { | 266 { |
265 return m_webView->createCompositorProxyClient(); | 267 return m_webView->createCompositorProxyClient(); |
266 } | 268 } |
267 | 269 |
268 } // namespace blink | 270 } // namespace blink |
OLD | NEW |