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

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

Issue 2046793002: Move didMeaningfulLayout calls from WebViewClient to WebWidgetClient. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: print Created 4 years, 5 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
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 2008 matching lines...) Expand 10 before | Expand all | Expand 10 after
2019 if (m_pageColorOverlay) 2019 if (m_pageColorOverlay)
2020 m_pageColorOverlay->graphicsLayer()->paint(nullptr); 2020 m_pageColorOverlay->graphicsLayer()->paint(nullptr);
2021 2021
2022 // TODO(chrishtr): link highlights don't currently paint themselves, it's st ill driven by cc. 2022 // TODO(chrishtr): link highlights don't currently paint themselves, it's st ill driven by cc.
2023 // Fix this. 2023 // Fix this.
2024 for (size_t i = 0; i < m_linkHighlights.size(); ++i) 2024 for (size_t i = 0; i < m_linkHighlights.size(); ++i)
2025 m_linkHighlights[i]->updateGeometry(); 2025 m_linkHighlights[i]->updateGeometry();
2026 2026
2027 if (FrameView* view = mainFrameImpl()->frameView()) { 2027 if (FrameView* view = mainFrameImpl()->frameView()) {
2028 LocalFrame* frame = mainFrameImpl()->frame(); 2028 LocalFrame* frame = mainFrameImpl()->frame();
2029 WebWidgetClient* client = WebLocalFrameImpl::fromFrame(frame)->frameWidg et()->client();
dcheng 2016/07/07 01:54:56 Hmm, does this entire function need to move to Web
lfg 2016/07/07 14:27:46 Yes, but we'll also need to do some stuff in Frame
2029 2030
2030 if (m_shouldDispatchFirstVisuallyNonEmptyLayout && view->isVisuallyNonEm pty()) { 2031 if (m_shouldDispatchFirstVisuallyNonEmptyLayout && view->isVisuallyNonEm pty()) {
2031 m_shouldDispatchFirstVisuallyNonEmptyLayout = false; 2032 m_shouldDispatchFirstVisuallyNonEmptyLayout = false;
2032 // TODO(esprehn): Move users of this callback to something 2033 // TODO(esprehn): Move users of this callback to something
2033 // better, the heuristic for "visually non-empty" is bad. 2034 // better, the heuristic for "visually non-empty" is bad.
2034 client()->didMeaningfulLayout(WebMeaningfulLayout::VisuallyNonEmpty) ; 2035 client->didMeaningfulLayout(WebMeaningfulLayout::VisuallyNonEmpty);
2035 } 2036 }
2036 2037
2037 if (m_shouldDispatchFirstLayoutAfterFinishedParsing && frame->document() ->hasFinishedParsing()) { 2038 if (m_shouldDispatchFirstLayoutAfterFinishedParsing && frame->document() ->hasFinishedParsing()) {
2038 m_shouldDispatchFirstLayoutAfterFinishedParsing = false; 2039 m_shouldDispatchFirstLayoutAfterFinishedParsing = false;
2039 client()->didMeaningfulLayout(WebMeaningfulLayout::FinishedParsing); 2040 client->didMeaningfulLayout(WebMeaningfulLayout::FinishedParsing);
2040 } 2041 }
2041 2042
2042 if (m_shouldDispatchFirstLayoutAfterFinishedLoading && frame->document() ->isLoadCompleted()) { 2043 if (m_shouldDispatchFirstLayoutAfterFinishedLoading && frame->document() ->isLoadCompleted()) {
2043 m_shouldDispatchFirstLayoutAfterFinishedLoading = false; 2044 m_shouldDispatchFirstLayoutAfterFinishedLoading = false;
2044 client()->didMeaningfulLayout(WebMeaningfulLayout::FinishedLoading); 2045 client->didMeaningfulLayout(WebMeaningfulLayout::FinishedLoading);
2045 } 2046 }
2046 } 2047 }
2047 } 2048 }
2048 2049
2049 void WebViewImpl::paint(WebCanvas* canvas, const WebRect& rect) 2050 void WebViewImpl::paint(WebCanvas* canvas, const WebRect& rect)
2050 { 2051 {
2051 // This should only be used when compositing is not being used for this 2052 // This should only be used when compositing is not being used for this
2052 // WebView, and it is painting into the recording of its parent. 2053 // WebView, and it is painting into the recording of its parent.
2053 DCHECK(!isAcceleratedCompositingActive()); 2054 DCHECK(!isAcceleratedCompositingActive());
2054 2055
(...skipping 2478 matching lines...) Expand 10 before | Expand all | Expand 10 after
4533 { 4534 {
4534 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa ctor rather than 4535 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa ctor rather than
4535 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. 4536 // page's scale factor, which can be 1 in use-zoom-for-dsf mode.
4536 if (!page()) 4537 if (!page())
4537 return 1; 4538 return 1;
4538 4539
4539 return page()->deviceScaleFactor(); 4540 return page()->deviceScaleFactor();
4540 } 4541 }
4541 4542
4542 } // namespace blink 4543 } // namespace blink
OLDNEW
« no previous file with comments | « content/renderer/render_view_impl.cc ('k') | third_party/WebKit/Source/web/tests/FrameTestHelpers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698