| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.chrome.browser.tab; | 5 package org.chromium.chrome.browser.tab; |
| 6 | 6 |
| 7 import org.chromium.chrome.browser.UrlConstants; | 7 import org.chromium.chrome.browser.UrlConstants; |
| 8 import org.chromium.chrome.browser.device.DeviceClassManager; | 8 import org.chromium.chrome.browser.device.DeviceClassManager; |
| 9 import org.chromium.chrome.browser.util.AccessibilityUtil; | 9 import org.chromium.chrome.browser.util.AccessibilityUtil; |
| 10 import org.chromium.components.security_state.ConnectionSecurityLevel; | 10 import org.chromium.components.security_state.ConnectionSecurityLevel; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 public boolean isHidingTopControlsEnabled() { | 31 public boolean isHidingTopControlsEnabled() { |
| 32 WebContents webContents = mTab.getWebContents(); | 32 WebContents webContents = mTab.getWebContents(); |
| 33 if (webContents == null || webContents.isDestroyed()) return false; | 33 if (webContents == null || webContents.isDestroyed()) return false; |
| 34 | 34 |
| 35 String url = mTab.getUrl(); | 35 String url = mTab.getUrl(); |
| 36 boolean enableHidingTopControls = url != null; | 36 boolean enableHidingTopControls = url != null; |
| 37 enableHidingTopControls &= !url.startsWith(UrlConstants.CHROME_SCHEME); | 37 enableHidingTopControls &= !url.startsWith(UrlConstants.CHROME_SCHEME); |
| 38 enableHidingTopControls &= !url.startsWith(UrlConstants.CHROME_NATIVE_SC
HEME); | 38 enableHidingTopControls &= !url.startsWith(UrlConstants.CHROME_NATIVE_SC
HEME); |
| 39 | 39 |
| 40 int securityState = mTab.getSecurityLevel(); | 40 int securityState = mTab.getSecurityLevel(); |
| 41 enableHidingTopControls &= (securityState != ConnectionSecurityLevel.SEC
URITY_ERROR | 41 enableHidingTopControls &= (securityState != ConnectionSecurityLevel.SEC
URITY_ERROR); |
| 42 && securityState != ConnectionSecurityLevel.SECURITY_WARNING); | |
| 43 | 42 |
| 44 enableHidingTopControls &= | 43 enableHidingTopControls &= |
| 45 !AccessibilityUtil.isAccessibilityEnabled(mTab.getApplicationCon
text()); | 44 !AccessibilityUtil.isAccessibilityEnabled(mTab.getApplicationCon
text()); |
| 46 | 45 |
| 47 ContentViewCore cvc = mTab.getContentViewCore(); | 46 ContentViewCore cvc = mTab.getContentViewCore(); |
| 48 enableHidingTopControls &= cvc == null || !cvc.isFocusedNodeEditable(); | 47 enableHidingTopControls &= cvc == null || !cvc.isFocusedNodeEditable(); |
| 49 enableHidingTopControls &= !mTab.isShowingErrorPage(); | 48 enableHidingTopControls &= !mTab.isShowingErrorPage(); |
| 50 enableHidingTopControls &= !webContents.isShowingInterstitialPage(); | 49 enableHidingTopControls &= !webContents.isShowingInterstitialPage(); |
| 51 enableHidingTopControls &= (mTab.getFullscreenManager() != null); | 50 enableHidingTopControls &= (mTab.getFullscreenManager() != null); |
| 52 enableHidingTopControls &= DeviceClassManager.enableFullscreen(); | 51 enableHidingTopControls &= DeviceClassManager.enableFullscreen(); |
| 53 enableHidingTopControls &= !mTab.isFullscreenWaitingForLoad(); | 52 enableHidingTopControls &= !mTab.isFullscreenWaitingForLoad(); |
| 54 | 53 |
| 55 return enableHidingTopControls; | 54 return enableHidingTopControls; |
| 56 } | 55 } |
| 57 | 56 |
| 58 /** | 57 /** |
| 59 * @return Whether showing top controls is enabled or not. | 58 * @return Whether showing top controls is enabled or not. |
| 60 */ | 59 */ |
| 61 public boolean isShowingTopControlsEnabled() { | 60 public boolean isShowingTopControlsEnabled() { |
| 62 if (mTab.getFullscreenManager() == null) return true; | 61 if (mTab.getFullscreenManager() == null) return true; |
| 63 return !mTab.getFullscreenManager().getPersistentFullscreenMode(); | 62 return !mTab.getFullscreenManager().getPersistentFullscreenMode(); |
| 64 } | 63 } |
| 65 } | 64 } |
| OLD | NEW |