OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 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 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 , m_recreatingGraphicsContext(false) | 447 , m_recreatingGraphicsContext(false) |
448 , m_flingModifier(0) | 448 , m_flingModifier(0) |
449 , m_flingSourceDevice(false) | 449 , m_flingSourceDevice(false) |
450 , m_fullscreenController(FullscreenController::create(this)) | 450 , m_fullscreenController(FullscreenController::create(this)) |
451 , m_showFPSCounter(false) | 451 , m_showFPSCounter(false) |
452 , m_baseBackgroundColor(Color::white) | 452 , m_baseBackgroundColor(Color::white) |
453 , m_backgroundColorOverride(Color::transparent) | 453 , m_backgroundColorOverride(Color::transparent) |
454 , m_zoomFactorOverride(0) | 454 , m_zoomFactorOverride(0) |
455 , m_userGestureObserved(false) | 455 , m_userGestureObserved(false) |
456 , m_shouldDispatchFirstVisuallyNonEmptyLayout(false) | 456 , m_shouldDispatchFirstVisuallyNonEmptyLayout(false) |
| 457 , m_shouldDispatchFirstLayoutAfterFinishedParsing(false) |
457 , m_displayMode(WebDisplayModeBrowser) | 458 , m_displayMode(WebDisplayModeBrowser) |
458 , m_elasticOverscroll(FloatSize()) | 459 , m_elasticOverscroll(FloatSize()) |
459 { | 460 { |
460 Page::PageClients pageClients; | 461 Page::PageClients pageClients; |
461 pageClients.chromeClient = m_chromeClientImpl.get(); | 462 pageClients.chromeClient = m_chromeClientImpl.get(); |
462 pageClients.contextMenuClient = &m_contextMenuClientImpl; | 463 pageClients.contextMenuClient = &m_contextMenuClientImpl; |
463 pageClients.editorClient = &m_editorClientImpl; | 464 pageClients.editorClient = &m_editorClientImpl; |
464 pageClients.dragClient = &m_dragClientImpl; | 465 pageClients.dragClient = &m_dragClientImpl; |
465 pageClients.spellCheckerClient = &m_spellCheckerClientImpl; | 466 pageClients.spellCheckerClient = &m_spellCheckerClientImpl; |
466 | 467 |
(...skipping 1425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1892 return; | 1893 return; |
1893 | 1894 |
1894 PageWidgetDelegate::layout(*m_page, *mainFrameImpl()->frame()); | 1895 PageWidgetDelegate::layout(*m_page, *mainFrameImpl()->frame()); |
1895 updateLayerTreeBackgroundColor(); | 1896 updateLayerTreeBackgroundColor(); |
1896 if (m_inspectorOverlay) | 1897 if (m_inspectorOverlay) |
1897 m_inspectorOverlay->layout(); | 1898 m_inspectorOverlay->layout(); |
1898 for (size_t i = 0; i < m_linkHighlights.size(); ++i) | 1899 for (size_t i = 0; i < m_linkHighlights.size(); ++i) |
1899 m_linkHighlights[i]->updateGeometry(); | 1900 m_linkHighlights[i]->updateGeometry(); |
1900 | 1901 |
1901 if (FrameView* view = mainFrameImpl()->frameView()) { | 1902 if (FrameView* view = mainFrameImpl()->frameView()) { |
| 1903 LocalFrame* frame = mainFrameImpl()->frame(); |
| 1904 |
1902 if (m_shouldDispatchFirstVisuallyNonEmptyLayout && view->isVisuallyNonEm
pty()) { | 1905 if (m_shouldDispatchFirstVisuallyNonEmptyLayout && view->isVisuallyNonEm
pty()) { |
1903 m_shouldDispatchFirstVisuallyNonEmptyLayout = false; | 1906 m_shouldDispatchFirstVisuallyNonEmptyLayout = false; |
1904 // TODO(esprehn): Move users of this callback to something | 1907 // TODO(esprehn): Move users of this callback to something |
1905 // better, the heuristic for "visually non-empty" is bad. | 1908 // better, the heuristic for "visually non-empty" is bad. |
1906 mainFrameImpl()->frame()->loader().client()->dispatchDidFirstVisuall
yNonEmptyLayout(); | 1909 // TODO(dglazkov): This should likely be a WebViewClient API. |
| 1910 frame->loader().client()->dispatchDidFirstVisuallyNonEmptyLayout(); |
| 1911 } |
| 1912 |
| 1913 if (m_shouldDispatchFirstLayoutAfterFinishedParsing && frame->document()
->hasFinishedParsing()) { |
| 1914 m_shouldDispatchFirstLayoutAfterFinishedParsing = false; |
| 1915 client()->didFirstLayoutAfterFinishedParsing(); |
1907 } | 1916 } |
1908 } | 1917 } |
1909 } | 1918 } |
1910 | 1919 |
1911 void WebViewImpl::paint(WebCanvas* canvas, const WebRect& rect) | 1920 void WebViewImpl::paint(WebCanvas* canvas, const WebRect& rect) |
1912 { | 1921 { |
1913 // This should only be used when compositing is not being used for this | 1922 // This should only be used when compositing is not being used for this |
1914 // WebView, and it is painting into the recording of its parent. | 1923 // WebView, and it is painting into the recording of its parent. |
1915 ASSERT(!isAcceleratedCompositingActive()); | 1924 ASSERT(!isAcceleratedCompositingActive()); |
1916 | 1925 |
(...skipping 2175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4092 } else { | 4101 } else { |
4093 m_rootGraphicsLayer = nullptr; | 4102 m_rootGraphicsLayer = nullptr; |
4094 m_rootLayer = nullptr; | 4103 m_rootLayer = nullptr; |
4095 m_rootTransformLayer = nullptr; | 4104 m_rootTransformLayer = nullptr; |
4096 // This means that we're transitioning to a new page. Suppress | 4105 // This means that we're transitioning to a new page. Suppress |
4097 // commits until Blink generates invalidations so we don't | 4106 // commits until Blink generates invalidations so we don't |
4098 // attempt to paint too early in the next page load. | 4107 // attempt to paint too early in the next page load. |
4099 m_layerTreeView->setDeferCommits(true); | 4108 m_layerTreeView->setDeferCommits(true); |
4100 m_layerTreeView->clearRootLayer(); | 4109 m_layerTreeView->clearRootLayer(); |
4101 m_shouldDispatchFirstVisuallyNonEmptyLayout = true; | 4110 m_shouldDispatchFirstVisuallyNonEmptyLayout = true; |
| 4111 m_shouldDispatchFirstLayoutAfterFinishedParsing = true; |
4102 page()->frameHost().visualViewport().clearLayersForTreeView(m_layerTreeV
iew); | 4112 page()->frameHost().visualViewport().clearLayersForTreeView(m_layerTreeV
iew); |
4103 } | 4113 } |
4104 | 4114 |
4105 suppressInvalidations(false); | 4115 suppressInvalidations(false); |
4106 } | 4116 } |
4107 | 4117 |
4108 void WebViewImpl::invalidateRect(const IntRect& rect) | 4118 void WebViewImpl::invalidateRect(const IntRect& rect) |
4109 { | 4119 { |
4110 if (m_layerTreeView) | 4120 if (m_layerTreeView) |
4111 updateLayerTreeViewport(); | 4121 updateLayerTreeViewport(); |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4406 if (m_pageColorOverlay) | 4416 if (m_pageColorOverlay) |
4407 m_pageColorOverlay->update(); | 4417 m_pageColorOverlay->update(); |
4408 if (m_inspectorOverlay) { | 4418 if (m_inspectorOverlay) { |
4409 PageOverlay* inspectorPageOverlay = m_inspectorOverlay->pageOverlay(); | 4419 PageOverlay* inspectorPageOverlay = m_inspectorOverlay->pageOverlay(); |
4410 if (inspectorPageOverlay) | 4420 if (inspectorPageOverlay) |
4411 inspectorPageOverlay->update(); | 4421 inspectorPageOverlay->update(); |
4412 } | 4422 } |
4413 } | 4423 } |
4414 | 4424 |
4415 } // namespace blink | 4425 } // namespace blink |
OLD | NEW |