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 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
442 , m_flingModifier(0) | 442 , m_flingModifier(0) |
443 , m_flingSourceDevice(false) | 443 , m_flingSourceDevice(false) |
444 , m_fullscreenController(FullscreenController::create(this)) | 444 , m_fullscreenController(FullscreenController::create(this)) |
445 , m_showFPSCounter(false) | 445 , m_showFPSCounter(false) |
446 , m_baseBackgroundColor(Color::white) | 446 , m_baseBackgroundColor(Color::white) |
447 , m_backgroundColorOverride(Color::transparent) | 447 , m_backgroundColorOverride(Color::transparent) |
448 , m_zoomFactorOverride(0) | 448 , m_zoomFactorOverride(0) |
449 , m_userGestureObserved(false) | 449 , m_userGestureObserved(false) |
450 , m_shouldDispatchFirstVisuallyNonEmptyLayout(false) | 450 , m_shouldDispatchFirstVisuallyNonEmptyLayout(false) |
451 , m_shouldDispatchFirstLayoutAfterFinishedParsing(false) | 451 , m_shouldDispatchFirstLayoutAfterFinishedParsing(false) |
| 452 , m_shouldDispatchFirstPaintAfterLoad(false) |
452 , m_displayMode(WebDisplayModeBrowser) | 453 , m_displayMode(WebDisplayModeBrowser) |
453 , m_elasticOverscroll(FloatSize()) | 454 , m_elasticOverscroll(FloatSize()) |
454 { | 455 { |
455 Page::PageClients pageClients; | 456 Page::PageClients pageClients; |
456 pageClients.chromeClient = m_chromeClientImpl.get(); | 457 pageClients.chromeClient = m_chromeClientImpl.get(); |
457 pageClients.contextMenuClient = &m_contextMenuClientImpl; | 458 pageClients.contextMenuClient = &m_contextMenuClientImpl; |
458 pageClients.editorClient = &m_editorClientImpl; | 459 pageClients.editorClient = &m_editorClientImpl; |
459 pageClients.dragClient = &m_dragClientImpl; | 460 pageClients.dragClient = &m_dragClientImpl; |
460 pageClients.spellCheckerClient = &m_spellCheckerClientImpl; | 461 pageClients.spellCheckerClient = &m_spellCheckerClientImpl; |
461 | 462 |
(...skipping 3398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3860 #endif | 3861 #endif |
3861 } | 3862 } |
3862 | 3863 |
3863 void WebViewImpl::didCommitLoad(bool isNewNavigation, bool isNavigationWithinPag
e) | 3864 void WebViewImpl::didCommitLoad(bool isNewNavigation, bool isNavigationWithinPag
e) |
3864 { | 3865 { |
3865 if (isNewNavigation && !isNavigationWithinPage) { | 3866 if (isNewNavigation && !isNavigationWithinPage) { |
3866 pageScaleConstraintsSet().setNeedsReset(true); | 3867 pageScaleConstraintsSet().setNeedsReset(true); |
3867 m_pageImportanceSignals.onCommitLoad(); | 3868 m_pageImportanceSignals.onCommitLoad(); |
3868 } | 3869 } |
3869 | 3870 |
| 3871 if (m_shouldDispatchFirstPaintAfterLoad) { |
| 3872 m_shouldDispatchFirstPaintAfterLoad = false; |
| 3873 client()->didFirstPaintAfterLoad(); |
| 3874 } |
| 3875 |
3870 // Give the visual viewport's scroll layer its initial size. | 3876 // Give the visual viewport's scroll layer its initial size. |
3871 page()->frameHost().visualViewport().mainFrameDidChangeSize(); | 3877 page()->frameHost().visualViewport().mainFrameDidChangeSize(); |
3872 | 3878 |
3873 // Make sure link highlight from previous page is cleared. | 3879 // Make sure link highlight from previous page is cleared. |
3874 m_linkHighlights.clear(); | 3880 m_linkHighlights.clear(); |
3875 endActiveFlingAnimation(); | 3881 endActiveFlingAnimation(); |
3876 m_userGestureObserved = false; | 3882 m_userGestureObserved = false; |
3877 } | 3883 } |
3878 | 3884 |
3879 void WebViewImpl::documentElementAvailable(WebLocalFrameImpl* webframe) | 3885 void WebViewImpl::documentElementAvailable(WebLocalFrameImpl* webframe) |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4140 m_rootGraphicsLayer = nullptr; | 4146 m_rootGraphicsLayer = nullptr; |
4141 m_rootLayer = nullptr; | 4147 m_rootLayer = nullptr; |
4142 m_rootTransformLayer = nullptr; | 4148 m_rootTransformLayer = nullptr; |
4143 // This means that we're transitioning to a new page. Suppress | 4149 // This means that we're transitioning to a new page. Suppress |
4144 // commits until Blink generates invalidations so we don't | 4150 // commits until Blink generates invalidations so we don't |
4145 // attempt to paint too early in the next page load. | 4151 // attempt to paint too early in the next page load. |
4146 m_layerTreeView->setDeferCommits(true); | 4152 m_layerTreeView->setDeferCommits(true); |
4147 m_layerTreeView->clearRootLayer(); | 4153 m_layerTreeView->clearRootLayer(); |
4148 m_shouldDispatchFirstVisuallyNonEmptyLayout = true; | 4154 m_shouldDispatchFirstVisuallyNonEmptyLayout = true; |
4149 m_shouldDispatchFirstLayoutAfterFinishedParsing = true; | 4155 m_shouldDispatchFirstLayoutAfterFinishedParsing = true; |
| 4156 m_shouldDispatchFirstPaintAfterLoad = true; |
4150 page()->frameHost().visualViewport().clearLayersForTreeView(m_layerTreeV
iew); | 4157 page()->frameHost().visualViewport().clearLayersForTreeView(m_layerTreeV
iew); |
4151 } | 4158 } |
4152 } | 4159 } |
4153 | 4160 |
4154 void WebViewImpl::invalidateRect(const IntRect& rect) | 4161 void WebViewImpl::invalidateRect(const IntRect& rect) |
4155 { | 4162 { |
4156 if (m_layerTreeView) | 4163 if (m_layerTreeView) |
4157 updateLayerTreeViewport(); | 4164 updateLayerTreeViewport(); |
4158 else if (m_client) | 4165 else if (m_client) |
4159 m_client->didInvalidateRect(rect); | 4166 m_client->didInvalidateRect(rect); |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4452 if (m_pageColorOverlay) | 4459 if (m_pageColorOverlay) |
4453 m_pageColorOverlay->update(); | 4460 m_pageColorOverlay->update(); |
4454 if (InspectorOverlay* overlay = inspectorOverlay()) { | 4461 if (InspectorOverlay* overlay = inspectorOverlay()) { |
4455 PageOverlay* inspectorPageOverlay = overlay->pageOverlay(); | 4462 PageOverlay* inspectorPageOverlay = overlay->pageOverlay(); |
4456 if (inspectorPageOverlay) | 4463 if (inspectorPageOverlay) |
4457 inspectorPageOverlay->update(); | 4464 inspectorPageOverlay->update(); |
4458 } | 4465 } |
4459 } | 4466 } |
4460 | 4467 |
4461 } // namespace blink | 4468 } // namespace blink |
OLD | NEW |