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; | 192 private boolean mFocusedNodeEditable; |
jdduke (slow)
2015/07/01 16:02:04
Do we need to cache this? Can we just pull it from
raghu
2015/07/01 17:16:57
We can pull it from the |isFocusedNodeEditable()|
| |
193 | 193 |
194 private Bitmap mFavicon; | 194 private Bitmap mFavicon; |
195 | 195 |
196 private String mFaviconUrl; | 196 private String mFaviconUrl; |
197 | 197 |
198 /** | 198 /** |
199 * The number of pixel of 16DP. | 199 * The number of pixel of 16DP. |
200 */ | 200 */ |
201 private int mNumPixel16DP; | 201 private int mNumPixel16DP; |
202 | 202 |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
507 | 507 |
508 @Override | 508 @Override |
509 public void onImeEvent() { | 509 public void onImeEvent() { |
510 // Some text was set in the page. Don't reuse it if a tab is | 510 // 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 | 511 // open from the same external application, we might lose some |
512 // user data. | 512 // user data. |
513 mAppAssociatedWith = null; | 513 mAppAssociatedWith = null; |
514 } | 514 } |
515 | 515 |
516 @Override | 516 @Override |
517 public void onImeStateChangeRequested(boolean requestShow) { | 517 public void onFocusedNodeEditabilityChanged(boolean editable) { |
518 if (getFullscreenManager() == null) return; | 518 if (getFullscreenManager() == null) return; |
519 mIsImeShowing = requestShow; | 519 mFocusedNodeEditable = editable; |
520 updateFullscreenEnabledState(); | 520 updateFullscreenEnabledState(); |
521 } | 521 } |
522 } | 522 } |
523 | 523 |
524 private class TabContextMenuPopulator extends ContextMenuPopulatorWrapper { | 524 private class TabContextMenuPopulator extends ContextMenuPopulatorWrapper { |
525 public TabContextMenuPopulator(ContextMenuPopulator populator) { | 525 public TabContextMenuPopulator(ContextMenuPopulator populator) { |
526 super(populator); | 526 super(populator); |
527 } | 527 } |
528 | 528 |
529 @Override | 529 @Override |
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1305 | 1305 |
1306 if (mContentViewCore != null) mContentViewCore.onHide(); | 1306 if (mContentViewCore != null) mContentViewCore.onHide(); |
1307 | 1307 |
1308 // Clean up any fullscreen state that might impact other tabs. | 1308 // Clean up any fullscreen state that might impact other tabs. |
1309 if (mFullscreenManager != null) { | 1309 if (mFullscreenManager != null) { |
1310 mFullscreenManager.setPersistentFullscreenMode(false); | 1310 mFullscreenManager.setPersistentFullscreenMode(false); |
1311 mFullscreenManager.hideControlsPersistent(mFullscreenHungRendererTok en); | 1311 mFullscreenManager.hideControlsPersistent(mFullscreenHungRendererTok en); |
1312 mFullscreenHungRendererToken = FullscreenManager.INVALID_TOKEN; | 1312 mFullscreenHungRendererToken = FullscreenManager.INVALID_TOKEN; |
1313 mPreviousFullscreenOverdrawBottomHeight = Float.NaN; | 1313 mPreviousFullscreenOverdrawBottomHeight = Float.NaN; |
1314 } | 1314 } |
1315 mIsImeShowing = false; | 1315 mFocusedNodeEditable = false; |
1316 | 1316 |
1317 hideInternal(); | 1317 hideInternal(); |
1318 | 1318 |
1319 for (TabObserver observer : mObservers) observer.onHidden(this); | 1319 for (TabObserver observer : mObservers) observer.onHidden(this); |
1320 } | 1320 } |
1321 | 1321 |
1322 /** | 1322 /** |
1323 * Called when the Tab is being hidden to perform any subclass-specific task s. | 1323 * Called when the Tab is being hidden to perform any subclass-specific task s. |
1324 */ | 1324 */ |
1325 protected void hideInternal() { | 1325 protected void hideInternal() { |
(...skipping 1143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2469 String url = getUrl(); | 2469 String url = getUrl(); |
2470 boolean enableHidingTopControls = url != null && !url.startsWith(UrlCons tants.CHROME_SCHEME) | 2470 boolean enableHidingTopControls = url != null && !url.startsWith(UrlCons tants.CHROME_SCHEME) |
2471 && !url.startsWith(UrlConstants.CHROME_NATIVE_SCHEME); | 2471 && !url.startsWith(UrlConstants.CHROME_NATIVE_SCHEME); |
2472 | 2472 |
2473 int securityState = getSecurityLevel(); | 2473 int securityState = getSecurityLevel(); |
2474 enableHidingTopControls &= (securityState != ConnectionSecurityLevel.SEC URITY_ERROR | 2474 enableHidingTopControls &= (securityState != ConnectionSecurityLevel.SEC URITY_ERROR |
2475 && securityState != ConnectionSecurityLevel.SECURITY_WARNING); | 2475 && securityState != ConnectionSecurityLevel.SECURITY_WARNING); |
2476 | 2476 |
2477 enableHidingTopControls &= | 2477 enableHidingTopControls &= |
2478 !AccessibilityUtil.isAccessibilityEnabled(getApplicationContext( )); | 2478 !AccessibilityUtil.isAccessibilityEnabled(getApplicationContext( )); |
2479 enableHidingTopControls &= !mIsImeShowing; | 2479 enableHidingTopControls &= !mFocusedNodeEditable; |
2480 enableHidingTopControls &= !mIsShowingErrorPage; | 2480 enableHidingTopControls &= !mIsShowingErrorPage; |
2481 enableHidingTopControls &= !webContents.isShowingInterstitialPage(); | 2481 enableHidingTopControls &= !webContents.isShowingInterstitialPage(); |
2482 enableHidingTopControls &= (mFullscreenManager != null); | 2482 enableHidingTopControls &= (mFullscreenManager != null); |
2483 | 2483 |
2484 return enableHidingTopControls; | 2484 return enableHidingTopControls; |
2485 } | 2485 } |
2486 | 2486 |
2487 /** | 2487 /** |
2488 * Performs any subclass-specific tasks when the Tab crashes. | 2488 * Performs any subclass-specific tasks when the Tab crashes. |
2489 */ | 2489 */ |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2774 private native void nativeAttachToTabContentManager(long nativeTabAndroid, | 2774 private native void nativeAttachToTabContentManager(long nativeTabAndroid, |
2775 TabContentManager tabContentManager); | 2775 TabContentManager tabContentManager); |
2776 private native void nativeAttachOverlayContentViewCore(long nativeTabAndroid , | 2776 private native void nativeAttachOverlayContentViewCore(long nativeTabAndroid , |
2777 ContentViewCore content, boolean visible); | 2777 ContentViewCore content, boolean visible); |
2778 private native void nativeDetachOverlayContentViewCore(long nativeTabAndroid , | 2778 private native void nativeDetachOverlayContentViewCore(long nativeTabAndroid , |
2779 ContentViewCore content); | 2779 ContentViewCore content); |
2780 private native boolean nativeHasPrerenderedUrl(long nativeTabAndroid, String url); | 2780 private native boolean nativeHasPrerenderedUrl(long nativeTabAndroid, String url); |
2781 | 2781 |
2782 private static native void nativeRecordStartupToCommitUma(); | 2782 private static native void nativeRecordStartupToCommitUma(); |
2783 } | 2783 } |
OLD | NEW |