Chromium Code Reviews| 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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 182 */ | 182 */ |
| 183 private int mParentId = INVALID_TAB_ID; | 183 private int mParentId = INVALID_TAB_ID; |
| 184 | 184 |
| 185 /** | 185 /** |
| 186 * Whether the tab should be grouped with its parent tab. | 186 * Whether the tab should be grouped with its parent tab. |
| 187 */ | 187 */ |
| 188 private boolean mGroupedWithParent = true; | 188 private boolean mGroupedWithParent = true; |
| 189 | 189 |
| 190 private boolean mIsClosing; | 190 private boolean mIsClosing; |
| 191 private boolean mIsShowingErrorPage; | 191 private boolean mIsShowingErrorPage; |
| 192 private boolean mIsImeShowing; | |
| 193 | 192 |
| 194 private Bitmap mFavicon; | 193 private Bitmap mFavicon; |
| 195 | 194 |
| 196 private String mFaviconUrl; | 195 private String mFaviconUrl; |
| 197 | 196 |
| 198 /** | 197 /** |
| 199 * The number of pixel of 16DP. | 198 * The number of pixel of 16DP. |
| 200 */ | 199 */ |
| 201 private int mNumPixel16DP; | 200 private int mNumPixel16DP; |
| 202 | 201 |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 509 public void onImeEvent() { | 508 public void onImeEvent() { |
| 510 // Some text was set in the page. Don't reuse it if a tab is | 509 // Some text was set in the page. Don't reuse it if a tab is |
| 511 // open from the same external application, we might lose some | 510 // open from the same external application, we might lose some |
| 512 // user data. | 511 // user data. |
| 513 mAppAssociatedWith = null; | 512 mAppAssociatedWith = null; |
| 514 } | 513 } |
| 515 | 514 |
| 516 @Override | 515 @Override |
| 517 public void onImeStateChangeRequested(boolean requestShow) { | 516 public void onImeStateChangeRequested(boolean requestShow) { |
| 518 if (getFullscreenManager() == null) return; | 517 if (getFullscreenManager() == null) return; |
| 519 mIsImeShowing = requestShow; | |
| 520 updateFullscreenEnabledState(); | 518 updateFullscreenEnabledState(); |
| 521 } | 519 } |
| 522 } | 520 } |
| 523 | 521 |
| 524 private class TabContextMenuPopulator extends ContextMenuPopulatorWrapper { | 522 private class TabContextMenuPopulator extends ContextMenuPopulatorWrapper { |
| 525 public TabContextMenuPopulator(ContextMenuPopulator populator) { | 523 public TabContextMenuPopulator(ContextMenuPopulator populator) { |
| 526 super(populator); | 524 super(populator); |
| 527 } | 525 } |
| 528 | 526 |
| 529 @Override | 527 @Override |
| (...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1305 | 1303 |
| 1306 if (mContentViewCore != null) mContentViewCore.onHide(); | 1304 if (mContentViewCore != null) mContentViewCore.onHide(); |
| 1307 | 1305 |
| 1308 // Clean up any fullscreen state that might impact other tabs. | 1306 // Clean up any fullscreen state that might impact other tabs. |
| 1309 if (mFullscreenManager != null) { | 1307 if (mFullscreenManager != null) { |
| 1310 mFullscreenManager.setPersistentFullscreenMode(false); | 1308 mFullscreenManager.setPersistentFullscreenMode(false); |
| 1311 mFullscreenManager.hideControlsPersistent(mFullscreenHungRendererTok en); | 1309 mFullscreenManager.hideControlsPersistent(mFullscreenHungRendererTok en); |
| 1312 mFullscreenHungRendererToken = FullscreenManager.INVALID_TOKEN; | 1310 mFullscreenHungRendererToken = FullscreenManager.INVALID_TOKEN; |
| 1313 mPreviousFullscreenOverdrawBottomHeight = Float.NaN; | 1311 mPreviousFullscreenOverdrawBottomHeight = Float.NaN; |
| 1314 } | 1312 } |
| 1315 mIsImeShowing = false; | |
| 1316 | 1313 |
| 1317 hideInternal(); | 1314 hideInternal(); |
| 1318 | 1315 |
| 1319 for (TabObserver observer : mObservers) observer.onHidden(this); | 1316 for (TabObserver observer : mObservers) observer.onHidden(this); |
| 1320 } | 1317 } |
| 1321 | 1318 |
| 1322 /** | 1319 /** |
| 1323 * Called when the Tab is being hidden to perform any subclass-specific task s. | 1320 * Called when the Tab is being hidden to perform any subclass-specific task s. |
| 1324 */ | 1321 */ |
| 1325 protected void hideInternal() { | 1322 protected void hideInternal() { |
| (...skipping 1143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2469 String url = getUrl(); | 2466 String url = getUrl(); |
| 2470 boolean enableHidingTopControls = url != null && !url.startsWith(UrlCons tants.CHROME_SCHEME) | 2467 boolean enableHidingTopControls = url != null && !url.startsWith(UrlCons tants.CHROME_SCHEME) |
| 2471 && !url.startsWith(UrlConstants.CHROME_NATIVE_SCHEME); | 2468 && !url.startsWith(UrlConstants.CHROME_NATIVE_SCHEME); |
| 2472 | 2469 |
| 2473 int securityState = getSecurityLevel(); | 2470 int securityState = getSecurityLevel(); |
| 2474 enableHidingTopControls &= (securityState != ConnectionSecurityLevel.SEC URITY_ERROR | 2471 enableHidingTopControls &= (securityState != ConnectionSecurityLevel.SEC URITY_ERROR |
| 2475 && securityState != ConnectionSecurityLevel.SECURITY_WARNING); | 2472 && securityState != ConnectionSecurityLevel.SECURITY_WARNING); |
| 2476 | 2473 |
| 2477 enableHidingTopControls &= | 2474 enableHidingTopControls &= |
| 2478 !AccessibilityUtil.isAccessibilityEnabled(getApplicationContext( )); | 2475 !AccessibilityUtil.isAccessibilityEnabled(getApplicationContext( )); |
| 2479 enableHidingTopControls &= !mIsImeShowing; | 2476 enableHidingTopControls &= !mContentViewCore.isFocusedNodeEditable(); |
|
jdduke (slow)
2015/06/26 15:03:08
With this change I think we still need a way to no
Ted C
2015/06/26 16:49:53
Agreed. And while this feature is woefully under
| |
| 2480 enableHidingTopControls &= !mIsShowingErrorPage; | 2477 enableHidingTopControls &= !mIsShowingErrorPage; |
| 2481 enableHidingTopControls &= !webContents.isShowingInterstitialPage(); | 2478 enableHidingTopControls &= !webContents.isShowingInterstitialPage(); |
| 2482 enableHidingTopControls &= (mFullscreenManager != null); | 2479 enableHidingTopControls &= (mFullscreenManager != null); |
| 2483 | 2480 |
| 2484 return enableHidingTopControls; | 2481 return enableHidingTopControls; |
| 2485 } | 2482 } |
| 2486 | 2483 |
| 2487 /** | 2484 /** |
| 2488 * Performs any subclass-specific tasks when the Tab crashes. | 2485 * Performs any subclass-specific tasks when the Tab crashes. |
| 2489 */ | 2486 */ |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2774 private native void nativeAttachToTabContentManager(long nativeTabAndroid, | 2771 private native void nativeAttachToTabContentManager(long nativeTabAndroid, |
| 2775 TabContentManager tabContentManager); | 2772 TabContentManager tabContentManager); |
| 2776 private native void nativeAttachOverlayContentViewCore(long nativeTabAndroid , | 2773 private native void nativeAttachOverlayContentViewCore(long nativeTabAndroid , |
| 2777 ContentViewCore content, boolean visible); | 2774 ContentViewCore content, boolean visible); |
| 2778 private native void nativeDetachOverlayContentViewCore(long nativeTabAndroid , | 2775 private native void nativeDetachOverlayContentViewCore(long nativeTabAndroid , |
| 2779 ContentViewCore content); | 2776 ContentViewCore content); |
| 2780 private native boolean nativeHasPrerenderedUrl(long nativeTabAndroid, String url); | 2777 private native boolean nativeHasPrerenderedUrl(long nativeTabAndroid, String url); |
| 2781 | 2778 |
| 2782 private static native void nativeRecordStartupToCommitUma(); | 2779 private static native void nativeRecordStartupToCommitUma(); |
| 2783 } | 2780 } |
| OLD | NEW |