Commit cbfd53a1 authored by Peter E Conn's avatar Peter E Conn Committed by Commit Bot

📺 Dismiss InfoBars before entering PiP.

Bug: 793267
Change-Id: Ia3bfa5852b2d00031a8467e75b4ee9f686397660
Reviewed-on: https://chromium-review.googlesource.com/816869Reviewed-by: default avatarTed Choc (back but slow, ping me) <tedchoc@chromium.org>
Reviewed-by: default avatarMatthew Jones <mdjones@chromium.org>
Commit-Queue: Peter Conn <peconn@chromium.org>
Cr-Commit-Position: refs/heads/master@{#526686}
parent cdde7441
......@@ -396,7 +396,7 @@ public class ContextualSearchManager
mWereInfoBarsHidden = false;
InfoBarContainer container = getInfoBarContainer();
if (container != null) {
container.setIsObscuredByOtherView(false);
container.setHidden(false);
}
}
......@@ -448,7 +448,7 @@ public class ContextualSearchManager
InfoBarContainer container = getInfoBarContainer();
if (container != null && container.getVisibility() == View.VISIBLE) {
mWereInfoBarsHidden = true;
container.setIsObscuredByOtherView(true);
container.setHidden(true);
}
}
......
......@@ -114,7 +114,7 @@ public class InfoBarContainer extends SwipableOverlayView {
boolean isFragmentNavigation, Integer pageTransition, int errorCode,
int httpStatusCode) {
if (hasCommitted && isInMainFrame) {
setIsObscuredByOtherView(false);
setHidden(false);
}
}
......@@ -171,8 +171,8 @@ public class InfoBarContainer extends SwipableOverlayView {
/** The view that {@link Tab#getView()} returns. */
private View mTabView;
/** Whether or not another View is occupying the same space as this one. */
private boolean mIsObscured;
/** Whether or not this View should be hidden. */
private boolean mIsHidden;
/** Animation used to snap the container to the nearest state if scroll direction changes. */
private Animator mScrollDirectionChangeAnimation;
......@@ -413,15 +413,13 @@ public class InfoBarContainer extends SwipableOverlayView {
}
/**
* Tells this class that a View with higher priority is occupying the same space.
* Hides or stops hiding this View/
*
* Causes this View to hide itself until the obscuring View goes away.
*
* @param isObscured Whether this View is obscured by another one.
* @param isHidden Whether this View is should be hidden.
*/
public void setIsObscuredByOtherView(boolean isObscured) {
mIsObscured = isObscured;
if (isObscured) {
public void setHidden(boolean isHidden) {
mIsHidden = isHidden;
if (isHidden) {
setVisibility(View.GONE);
} else {
setVisibility(View.VISIBLE);
......@@ -445,7 +443,7 @@ public class InfoBarContainer extends SwipableOverlayView {
@Override
protected void onAttachedToWindow() {
super.onAttachedToWindow();
if (!mIsObscured) {
if (!mIsHidden) {
setVisibility(VISIBLE);
setAlpha(0f);
animate().alpha(1f).setDuration(REATTACH_FADE_IN_MS);
......@@ -481,7 +479,7 @@ public class InfoBarContainer extends SwipableOverlayView {
setVisibility(View.INVISIBLE);
}
} else {
if (!isShowing && !mIsObscured) {
if (!isShowing && !mIsHidden) {
setVisibility(View.VISIBLE);
}
}
......
......@@ -185,10 +185,14 @@ public class PictureInPictureController {
webContents.setHasPersistentVideo(true);
// We don't want InfoBars displaying while in PiP, they cover too much content.
activity.getActivityTab().getInfoBarContainer().setHidden(true);
mOnLeavePipCallbacks.add(new Callback<ChromeActivity>() {
@Override
public void onResult(ChromeActivity activity2) {
webContents.setHasPersistentVideo(false);
activity.getActivityTab().getInfoBarContainer().setHidden(false);
}
});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment