From b1c26a82bb8daf52443ec586abe91f7bf54dbf98 Mon Sep 17 00:00:00 2001 From: jdduke Date: Wed, 29 Apr 2015 10:42:19 -0700 Subject: [PATCH] [Android] Disable the refresh effect for fullscreen HTML5 scenarios This regressed recently with the transition to the View-based pull-to-refresh implementation. Restore the proper behavior which is to suppress pull-to-refresh for fullscreen HTML5 scenarios. BUG=435732 Review URL: https://codereview.chromium.org/1084533004 Cr-Commit-Position: refs/heads/master@{#327519} --- content/browser/android/overscroll_controller_android.cc | 8 ++++++++ content/browser/android/overscroll_controller_android.h | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/content/browser/android/overscroll_controller_android.cc b/content/browser/android/overscroll_controller_android.cc index 02e2c01383eb..d73cd22247ca 100644 --- a/content/browser/android/overscroll_controller_android.cc +++ b/content/browser/android/overscroll_controller_android.cc @@ -97,6 +97,13 @@ OverscrollControllerAndroid::OverscrollControllerAndroid( refresh_effect_(CreateRefreshEffect(content_view_core)), is_fullscreen_(false) { DCHECK(compositor_); + // Fullscreen state is only relevant for the refresh effect. + if (refresh_effect_) { + WebContentsImpl* web_contents = + static_cast(content_view_core->GetWebContents()); + is_fullscreen_ = web_contents->IsFullscreenForCurrentTab(); + Observe(web_contents); + } } OverscrollControllerAndroid::~OverscrollControllerAndroid() { @@ -268,6 +275,7 @@ void OverscrollControllerAndroid::Disable() { void OverscrollControllerAndroid::DidToggleFullscreenModeForTab( bool entered_fullscreen) { + DCHECK(refresh_effect_); if (is_fullscreen_ == entered_fullscreen) return; is_fullscreen_ = entered_fullscreen; diff --git a/content/browser/android/overscroll_controller_android.h b/content/browser/android/overscroll_controller_android.h index 5f76dab43527..128b803eca23 100644 --- a/content/browser/android/overscroll_controller_android.h +++ b/content/browser/android/overscroll_controller_android.h @@ -79,7 +79,8 @@ class OverscrollControllerAndroid : public OverscrollGlowClient, // TODO(jdduke): Factor out a common API from the two overscroll effects. scoped_ptr glow_effect_; scoped_ptr refresh_effect_; - bool has_initialized_refresh_effect_; + + // For fullscreen HTML5 scenarios, the refresh effect will be disabled. bool is_fullscreen_; DISALLOW_COPY_AND_ASSIGN(OverscrollControllerAndroid); -- 2.11.4.GIT