Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(223)

Side by Side Diff: Source/web/WebViewImpl.cpp

Issue 1295053002: Move dispatchDidFirstVisuallyNonEmptyLayout into WebViewImpl. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: simpler. Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/web/WebViewImpl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 #include "core/html/HTMLTextAreaElement.h" 69 #include "core/html/HTMLTextAreaElement.h"
70 #include "core/input/EventHandler.h" 70 #include "core/input/EventHandler.h"
71 #include "core/input/TouchActionUtil.h" 71 #include "core/input/TouchActionUtil.h"
72 #include "core/layout/LayoutPart.h" 72 #include "core/layout/LayoutPart.h"
73 #include "core/layout/LayoutView.h" 73 #include "core/layout/LayoutView.h"
74 #include "core/layout/TextAutosizer.h" 74 #include "core/layout/TextAutosizer.h"
75 #include "core/layout/compositing/DeprecatedPaintLayerCompositor.h" 75 #include "core/layout/compositing/DeprecatedPaintLayerCompositor.h"
76 #include "core/loader/DocumentLoader.h" 76 #include "core/loader/DocumentLoader.h"
77 #include "core/loader/FrameLoadRequest.h" 77 #include "core/loader/FrameLoadRequest.h"
78 #include "core/loader/FrameLoader.h" 78 #include "core/loader/FrameLoader.h"
79 #include "core/loader/FrameLoaderClient.h"
79 #include "core/page/ContextMenuController.h" 80 #include "core/page/ContextMenuController.h"
80 #include "core/page/ContextMenuProvider.h" 81 #include "core/page/ContextMenuProvider.h"
81 #include "core/page/DragController.h" 82 #include "core/page/DragController.h"
82 #include "core/page/DragData.h" 83 #include "core/page/DragData.h"
83 #include "core/page/DragSession.h" 84 #include "core/page/DragSession.h"
84 #include "core/page/FocusController.h" 85 #include "core/page/FocusController.h"
85 #include "core/page/FrameTree.h" 86 #include "core/page/FrameTree.h"
86 #include "core/page/Page.h" 87 #include "core/page/Page.h"
87 #include "core/page/PagePopupClient.h" 88 #include "core/page/PagePopupClient.h"
88 #include "core/page/PointerLockController.h" 89 #include "core/page/PointerLockController.h"
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 , m_recreatingGraphicsContext(false) 450 , m_recreatingGraphicsContext(false)
450 , m_flingModifier(0) 451 , m_flingModifier(0)
451 , m_flingSourceDevice(false) 452 , m_flingSourceDevice(false)
452 , m_fullscreenController(FullscreenController::create(this)) 453 , m_fullscreenController(FullscreenController::create(this))
453 , m_showFPSCounter(false) 454 , m_showFPSCounter(false)
454 , m_continuousPaintingEnabled(false) 455 , m_continuousPaintingEnabled(false)
455 , m_baseBackgroundColor(Color::white) 456 , m_baseBackgroundColor(Color::white)
456 , m_backgroundColorOverride(Color::transparent) 457 , m_backgroundColorOverride(Color::transparent)
457 , m_zoomFactorOverride(0) 458 , m_zoomFactorOverride(0)
458 , m_userGestureObserved(false) 459 , m_userGestureObserved(false)
460 , m_shouldDispatchFirstVisuallyNonEmptyLayout(false)
459 , m_displayMode(WebDisplayModeBrowser) 461 , m_displayMode(WebDisplayModeBrowser)
460 , m_elasticOverscroll(FloatSize()) 462 , m_elasticOverscroll(FloatSize())
461 { 463 {
462 Page::PageClients pageClients; 464 Page::PageClients pageClients;
463 pageClients.chromeClient = &m_chromeClientImpl; 465 pageClients.chromeClient = &m_chromeClientImpl;
464 pageClients.contextMenuClient = &m_contextMenuClientImpl; 466 pageClients.contextMenuClient = &m_contextMenuClientImpl;
465 pageClients.editorClient = &m_editorClientImpl; 467 pageClients.editorClient = &m_editorClientImpl;
466 pageClients.dragClient = &m_dragClientImpl; 468 pageClients.dragClient = &m_dragClientImpl;
467 pageClients.spellCheckerClient = &m_spellCheckerClientImpl; 469 pageClients.spellCheckerClient = &m_spellCheckerClientImpl;
468 470
(...skipping 1454 matching lines...) Expand 10 before | Expand all | Expand 10 after
1923 TRACE_EVENT0("blink", "WebViewImpl::layout"); 1925 TRACE_EVENT0("blink", "WebViewImpl::layout");
1924 if (!mainFrameImpl()) 1926 if (!mainFrameImpl())
1925 return; 1927 return;
1926 1928
1927 PageWidgetDelegate::layout(*m_page, *mainFrameImpl()->frame()); 1929 PageWidgetDelegate::layout(*m_page, *mainFrameImpl()->frame());
1928 updateLayerTreeBackgroundColor(); 1930 updateLayerTreeBackgroundColor();
1929 if (m_inspectorOverlay) 1931 if (m_inspectorOverlay)
1930 m_inspectorOverlay->layout(); 1932 m_inspectorOverlay->layout();
1931 for (size_t i = 0; i < m_linkHighlights.size(); ++i) 1933 for (size_t i = 0; i < m_linkHighlights.size(); ++i)
1932 m_linkHighlights[i]->updateGeometry(); 1934 m_linkHighlights[i]->updateGeometry();
1935
1936 if (FrameView* view = mainFrameImpl()->frameView()) {
1937 if (m_shouldDispatchFirstVisuallyNonEmptyLayout && view->isVisuallyNonEm pty()) {
1938 m_shouldDispatchFirstVisuallyNonEmptyLayout = false;
1939 // TODO(esprehn): Move users of this callback to something
1940 // better, the heuristic for "visually non-empty" is bad.
1941 mainFrameImpl()->frame()->loader().client()->dispatchDidFirstVisuall yNonEmptyLayout();
1942 }
1943 }
1933 } 1944 }
1934 1945
1935 void WebViewImpl::paint(WebCanvas* canvas, const WebRect& rect) 1946 void WebViewImpl::paint(WebCanvas* canvas, const WebRect& rect)
1936 { 1947 {
1937 // This should only be used when compositing is not being used for this 1948 // This should only be used when compositing is not being used for this
1938 // WebView, and it is painting into the recording of its parent. 1949 // WebView, and it is painting into the recording of its parent.
1939 ASSERT(!isAcceleratedCompositingActive()); 1950 ASSERT(!isAcceleratedCompositingActive());
1940 1951
1941 double paintStart = currentTime(); 1952 double paintStart = currentTime();
1942 PageWidgetDelegate::paint(*m_page, canvas, rect, *m_page->deprecatedLocalMai nFrame()); 1953 PageWidgetDelegate::paint(*m_page, canvas, rect, *m_page->deprecatedLocalMai nFrame());
(...skipping 2243 matching lines...) Expand 10 before | Expand all | Expand 10 after
4186 m_layerTreeView->setVisible(visible); 4197 m_layerTreeView->setVisible(visible);
4187 } else { 4198 } else {
4188 m_rootGraphicsLayer = nullptr; 4199 m_rootGraphicsLayer = nullptr;
4189 m_rootLayer = nullptr; 4200 m_rootLayer = nullptr;
4190 m_rootTransformLayer = nullptr; 4201 m_rootTransformLayer = nullptr;
4191 // This means that we're transitioning to a new page. Suppress 4202 // This means that we're transitioning to a new page. Suppress
4192 // commits until Blink generates invalidations so we don't 4203 // commits until Blink generates invalidations so we don't
4193 // attempt to paint too early in the next page load. 4204 // attempt to paint too early in the next page load.
4194 m_layerTreeView->setDeferCommits(true); 4205 m_layerTreeView->setDeferCommits(true);
4195 m_layerTreeView->clearRootLayer(); 4206 m_layerTreeView->clearRootLayer();
4207 m_shouldDispatchFirstVisuallyNonEmptyLayout = true;
4196 page()->frameHost().visualViewport().clearLayersForTreeView(m_layerTreeV iew); 4208 page()->frameHost().visualViewport().clearLayersForTreeView(m_layerTreeV iew);
4197 } 4209 }
4198 4210
4199 suppressInvalidations(false); 4211 suppressInvalidations(false);
4200 } 4212 }
4201 4213
4202 void WebViewImpl::invalidateRect(const IntRect& rect) 4214 void WebViewImpl::invalidateRect(const IntRect& rect)
4203 { 4215 {
4204 if (m_layerTreeView) 4216 if (m_layerTreeView)
4205 updateLayerTreeViewport(); 4217 updateLayerTreeViewport();
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
4500 if (m_pageColorOverlay) 4512 if (m_pageColorOverlay)
4501 m_pageColorOverlay->update(); 4513 m_pageColorOverlay->update();
4502 if (m_inspectorOverlay) { 4514 if (m_inspectorOverlay) {
4503 PageOverlay* inspectorPageOverlay = m_inspectorOverlay->pageOverlay(); 4515 PageOverlay* inspectorPageOverlay = m_inspectorOverlay->pageOverlay();
4504 if (inspectorPageOverlay) 4516 if (inspectorPageOverlay)
4505 inspectorPageOverlay->update(); 4517 inspectorPageOverlay->update();
4506 } 4518 }
4507 } 4519 }
4508 4520
4509 } // namespace blink 4521 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/WebViewImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698