1 // Copyright 2020 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 package org.chromium.chrome.browser.browser_controls; 6 7 import org.chromium.ui.util.TokenHolder; 8 9 /** 10 * Allows for manipulating visibility of the browser controls, as well as retrieving state. 11 */ 12 public interface BrowserControlsVisibilityManager extends BrowserControlsStateProvider { 13 /** 14 * @return The visibility delegate that allows browser UI to control the browser control 15 * visibility. 16 */ getBrowserVisibilityDelegate()17 BrowserStateBrowserControlsVisibilityDelegate getBrowserVisibilityDelegate(); 18 19 /** 20 * Shows the Android browser controls view. 21 * @param animate Whether a slide-in animation should be run. 22 */ showAndroidControls(boolean animate)23 void showAndroidControls(boolean animate); 24 25 /** 26 * Indicates whether the browser controls offsets are currently overridden by a Java-side 27 * animation started by #showAndroidControls(boolean). 28 * @return {@code true} if browser controls offsets are overridden by animation. 29 */ offsetOverridden()30 boolean offsetOverridden(); 31 32 /** 33 * Forces the Android controls to hide an replaces the provided oldToken. While there are 34 * acquired tokens the browser controls Android view will always be hidden, otherwise they will 35 * show/hide based on position. 36 * 37 * Note: this only affects the Android controls. 38 * 39 * @param oldToken the oldToken to clear. Pass {@link TokenHolder#INVALID_TOKEN} if no token is 40 * being held. 41 */ hideAndroidControlsAndClearOldToken(int oldToken)42 int hideAndroidControlsAndClearOldToken(int oldToken); 43 44 /** 45 * Release a hiding token returned from {@link #hideAndroidControlsAndClearOldToken(int)}. 46 */ releaseAndroidControlsHidingToken(int token)47 void releaseAndroidControlsHidingToken(int token); 48 } 49