Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
Propagate fullscreen state to interstitial's when shown.
Browse files Browse the repository at this point in the history
Without this interstitials will be able to be scroll off the top controls,
which is definitely not the correct behavior.

BUG=474795

Review URL: https://codereview.chromium.org/1070293002

Cr-Commit-Position: refs/branch-heads/2357@{#34}
Cr-Branched-From: 59d4494-refs/heads/master@{#323860}
  • Loading branch information
Ted Choc committed Apr 9, 2015
1 parent 1f7c3cb commit 63e0caf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions chrome/android/java/src/org/chromium/chrome/browser/Tab.java
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,8 @@ public void didAttachInterstitialPage() {
for (TabObserver observer : mObservers) {
observer.onDidAttachInterstitialPage(Tab.this);
}

updateFullscreenEnabledState();
}

@Override
Expand All @@ -661,6 +663,8 @@ public void didDetachInterstitialPage() {
for (TabObserver observer : mObservers) {
observer.onDidDetachInterstitialPage(Tab.this);
}

updateFullscreenEnabledState();
}

@Override
Expand Down Expand Up @@ -2425,6 +2429,7 @@ protected boolean isHidingTopControlsEnabled() {
!AccessibilityUtil.isAccessibilityEnabled(getApplicationContext());
enableHidingTopControls &= !mIsImeShowing;
enableHidingTopControls &= !mIsShowingErrorPage;
enableHidingTopControls &= !getWebContents().isShowingInterstitialPage();

return enableHidingTopControls;
}
Expand Down
10 changes: 10 additions & 0 deletions chrome/browser/android/tab_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,12 @@
#include "components/url_fixer/url_fixer.h"
#include "content/public/browser/android/content_view_core.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/interstitial_page.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/user_metrics.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/top_controls_state.h"
Expand Down Expand Up @@ -737,6 +739,14 @@ void TabAndroid::UpdateTopControlsState(JNIEnv* env,
WebContents* sender = web_contents();
sender->Send(new ChromeViewMsg_UpdateTopControlsState(
sender->GetRoutingID(), constraints_state, current_state, animate));

if (sender->ShowingInterstitialPage()) {
content::RenderViewHost* interstitial_view_host =
sender->GetInterstitialPage()->GetMainFrame()->GetRenderViewHost();
interstitial_view_host->Send(new ChromeViewMsg_UpdateTopControlsState(
interstitial_view_host->GetRoutingID(), constraints_state,
current_state, animate));
}
}

void TabAndroid::SearchByImageInNewTabAsync(JNIEnv* env, jobject obj) {
Expand Down

0 comments on commit 63e0caf

Please sign in to comment.