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

Unified Diff: content/browser/web_contents/aura/overscroll_navigation_overlay.cc

Issue 217373003: Dismissing the GestureNav overlay after the first non-empty paint to improve UX/responsiveness (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Re-adding StopObservingIfDone() calls to load handlers - needed when need_paint_update_ is false. Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/web_contents/aura/overscroll_navigation_overlay_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/aura/overscroll_navigation_overlay.cc
diff --git a/content/browser/web_contents/aura/overscroll_navigation_overlay.cc b/content/browser/web_contents/aura/overscroll_navigation_overlay.cc
index ac7b20c3af495bb144a507669e3b605818bfc14f..4e742634d5e5838df2926c62f7a68d1046e0675d 100644
--- a/content/browser/web_contents/aura/overscroll_navigation_overlay.cc
+++ b/content/browser/web_contents/aura/overscroll_navigation_overlay.cc
@@ -156,13 +156,7 @@ void OverscrollNavigationOverlay::SetupForTesting() {
}
void OverscrollNavigationOverlay::StopObservingIfDone() {
- // If there is a screenshot displayed in the overlay window, then wait for
- // the navigated page to complete loading and some paint update before
- // hiding the overlay.
- // If there is no screenshot in the overlay window, then hide this view
- // as soon as there is any new painting notification.
- if ((need_paint_update_ && !received_paint_update_) ||
- (image_delegate_->has_image() && !loading_complete_)) {
+ if ((need_paint_update_ && !received_paint_update_)) {
return;
}
@@ -313,8 +307,7 @@ void OverscrollNavigationOverlay::DocumentOnLoadCompletedInMainFrame(
// pending entry has been created.
int committed_entry_id =
web_contents_->GetController().GetLastCommittedEntry()->GetUniqueID();
- // For the purposes of dismissing the overlay - consider the loading completed
- // once the main frame has loaded.
+ // Consider the loading completed once the main frame has loaded.
if (committed_entry_id == pending_entry_id_ || !pending_entry_id_) {
loading_complete_ = true;
StopObservingIfDone();
@@ -337,7 +330,7 @@ void OverscrollNavigationOverlay::DidStopLoading(RenderViewHost* host) {
web_contents_->GetController().GetLastCommittedEntry()->GetUniqueID();
if (committed_entry_id == pending_entry_id_ || !pending_entry_id_) {
loading_complete_ = true;
- if (!received_paint_update_) {
+ if (!received_paint_update_ && need_paint_update_) {
// Force a repaint after the page is loaded.
RenderViewHostImpl* view = static_cast<RenderViewHostImpl*>(host);
view->ScheduleComposite();
« no previous file with comments | « no previous file | content/browser/web_contents/aura/overscroll_navigation_overlay_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698