OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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; | 5 package org.chromium.chrome.browser; |
6 | 6 |
7 import android.app.Activity; | 7 import android.app.Activity; |
8 import android.content.Context; | 8 import android.content.Context; |
9 import android.graphics.Bitmap; | 9 import android.graphics.Bitmap; |
10 import android.graphics.Color; | 10 import android.graphics.Color; |
(...skipping 2246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2257 int securityState = getSecurityLevel(); | 2257 int securityState = getSecurityLevel(); |
2258 enableHidingTopControls &= (securityState != ToolbarModelSecurityLevel.S
ECURITY_ERROR | 2258 enableHidingTopControls &= (securityState != ToolbarModelSecurityLevel.S
ECURITY_ERROR |
2259 && securityState != ToolbarModelSecurityLevel.SECURITY_WARNING); | 2259 && securityState != ToolbarModelSecurityLevel.SECURITY_WARNING); |
2260 | 2260 |
2261 enableHidingTopControls &= | 2261 enableHidingTopControls &= |
2262 !AccessibilityUtil.isAccessibilityEnabled(getApplicationContext(
)); | 2262 !AccessibilityUtil.isAccessibilityEnabled(getApplicationContext(
)); |
2263 return enableHidingTopControls; | 2263 return enableHidingTopControls; |
2264 } | 2264 } |
2265 | 2265 |
2266 /** | 2266 /** |
| 2267 * @return Whether showing top controls is enabled or not. |
| 2268 */ |
| 2269 public boolean isShowingTopControlsEnabled() { |
| 2270 if (mFullscreenManager == null) return true; |
| 2271 return !mFullscreenManager.getPersistentFullscreenMode(); |
| 2272 } |
| 2273 |
| 2274 /** |
2267 * @return The current visibility constraints for the display of top control
s. | 2275 * @return The current visibility constraints for the display of top control
s. |
2268 * {@link TopControlsState} defines the valid return options. | 2276 * {@link TopControlsState} defines the valid return options. |
2269 */ | 2277 */ |
2270 protected int getTopControlsStateConstraints() { | 2278 protected int getTopControlsStateConstraints() { |
2271 if (mFullscreenManager == null) return TopControlsState.SHOWN; | 2279 if (mFullscreenManager == null) return TopControlsState.SHOWN; |
2272 | 2280 |
2273 boolean enableHidingTopControls = isHidingTopControlsEnabled(); | 2281 boolean enableHidingTopControls = isHidingTopControlsEnabled(); |
2274 boolean enableShowingTopControls = !mFullscreenManager.getPersistentFull
screenMode(); | 2282 boolean enableShowingTopControls = isShowingTopControlsEnabled(); |
2275 | 2283 |
2276 int constraints = TopControlsState.BOTH; | 2284 int constraints = TopControlsState.BOTH; |
2277 if (!enableShowingTopControls) { | 2285 if (!enableShowingTopControls) { |
2278 constraints = TopControlsState.HIDDEN; | 2286 constraints = TopControlsState.HIDDEN; |
2279 } else if (!enableHidingTopControls) { | 2287 } else if (!enableHidingTopControls) { |
2280 constraints = TopControlsState.SHOWN; | 2288 constraints = TopControlsState.SHOWN; |
2281 } | 2289 } |
2282 return constraints; | 2290 return constraints; |
2283 } | 2291 } |
2284 | 2292 |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2469 private native void nativeSetInterceptNavigationDelegate(long nativeTabAndro
id, | 2477 private native void nativeSetInterceptNavigationDelegate(long nativeTabAndro
id, |
2470 InterceptNavigationDelegate delegate); | 2478 InterceptNavigationDelegate delegate); |
2471 private native void nativeAttachToTabContentManager(long nativeTabAndroid, | 2479 private native void nativeAttachToTabContentManager(long nativeTabAndroid, |
2472 TabContentManager tabContentManager); | 2480 TabContentManager tabContentManager); |
2473 private native void nativeAttachOverlayContentViewCore(long nativeTabAndroid
, | 2481 private native void nativeAttachOverlayContentViewCore(long nativeTabAndroid
, |
2474 ContentViewCore content, boolean visible); | 2482 ContentViewCore content, boolean visible); |
2475 private native void nativeDetachOverlayContentViewCore(long nativeTabAndroid
, | 2483 private native void nativeDetachOverlayContentViewCore(long nativeTabAndroid
, |
2476 ContentViewCore content); | 2484 ContentViewCore content); |
2477 private static native void nativeRecordStartupToCommitUma(); | 2485 private static native void nativeRecordStartupToCommitUma(); |
2478 } | 2486 } |
OLD | NEW |