Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(334)

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/Tab.java

Issue 1209243003: Changed the constraints for hiding the top controls (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Used pollForUIThreadCriteria instead of pollForCriteria in the test code Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/android/javatests/src/org/chromium/chrome/browser/fullscreen/FullscreenManagerTest.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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.content.Intent; 9 import android.content.Intent;
10 import android.graphics.Bitmap; 10 import android.graphics.Bitmap;
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 */ 189 */
190 private Intent mParentIntent; 190 private Intent mParentIntent;
191 191
192 /** 192 /**
193 * Whether the tab should be grouped with its parent tab. 193 * Whether the tab should be grouped with its parent tab.
194 */ 194 */
195 private boolean mGroupedWithParent = true; 195 private boolean mGroupedWithParent = true;
196 196
197 private boolean mIsClosing; 197 private boolean mIsClosing;
198 private boolean mIsShowingErrorPage; 198 private boolean mIsShowingErrorPage;
199 private boolean mIsImeShowing;
200 199
201 private Bitmap mFavicon; 200 private Bitmap mFavicon;
202 201
203 private String mFaviconUrl; 202 private String mFaviconUrl;
204 203
205 /** 204 /**
206 * The number of pixel of 16DP. 205 * The number of pixel of 16DP.
207 */ 206 */
208 private int mNumPixel16DP; 207 private int mNumPixel16DP;
209 208
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 513
515 @Override 514 @Override
516 public void onImeEvent() { 515 public void onImeEvent() {
517 // Some text was set in the page. Don't reuse it if a tab is 516 // Some text was set in the page. Don't reuse it if a tab is
518 // open from the same external application, we might lose some 517 // open from the same external application, we might lose some
519 // user data. 518 // user data.
520 mAppAssociatedWith = null; 519 mAppAssociatedWith = null;
521 } 520 }
522 521
523 @Override 522 @Override
524 public void onImeStateChangeRequested(boolean requestShow) { 523 public void onFocusedNodeEditabilityChanged(boolean editable) {
525 if (getFullscreenManager() == null) return; 524 if (getFullscreenManager() == null) return;
526 mIsImeShowing = requestShow;
527 updateFullscreenEnabledState(); 525 updateFullscreenEnabledState();
528 } 526 }
529 } 527 }
530 528
531 private class TabContextMenuPopulator extends ContextMenuPopulatorWrapper { 529 private class TabContextMenuPopulator extends ContextMenuPopulatorWrapper {
532 public TabContextMenuPopulator(ContextMenuPopulator populator) { 530 public TabContextMenuPopulator(ContextMenuPopulator populator) {
533 super(populator); 531 super(populator);
534 } 532 }
535 533
536 @Override 534 @Override
(...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after
1319 1317
1320 if (mContentViewCore != null) mContentViewCore.onHide(); 1318 if (mContentViewCore != null) mContentViewCore.onHide();
1321 1319
1322 // Clean up any fullscreen state that might impact other tabs. 1320 // Clean up any fullscreen state that might impact other tabs.
1323 if (mFullscreenManager != null) { 1321 if (mFullscreenManager != null) {
1324 mFullscreenManager.setPersistentFullscreenMode(false); 1322 mFullscreenManager.setPersistentFullscreenMode(false);
1325 mFullscreenManager.hideControlsPersistent(mFullscreenHungRendererTok en); 1323 mFullscreenManager.hideControlsPersistent(mFullscreenHungRendererTok en);
1326 mFullscreenHungRendererToken = FullscreenManager.INVALID_TOKEN; 1324 mFullscreenHungRendererToken = FullscreenManager.INVALID_TOKEN;
1327 mPreviousFullscreenOverdrawBottomHeight = Float.NaN; 1325 mPreviousFullscreenOverdrawBottomHeight = Float.NaN;
1328 } 1326 }
1329 mIsImeShowing = false;
1330 1327
1331 hideInternal(); 1328 hideInternal();
1332 1329
1333 for (TabObserver observer : mObservers) observer.onHidden(this); 1330 for (TabObserver observer : mObservers) observer.onHidden(this);
1334 } 1331 }
1335 1332
1336 /** 1333 /**
1337 * Called when the Tab is being hidden to perform any subclass-specific task s. 1334 * Called when the Tab is being hidden to perform any subclass-specific task s.
1338 */ 1335 */
1339 protected void hideInternal() { 1336 protected void hideInternal() {
(...skipping 1143 matching lines...) Expand 10 before | Expand all | Expand 10 after
2483 String url = getUrl(); 2480 String url = getUrl();
2484 boolean enableHidingTopControls = url != null && !url.startsWith(UrlCons tants.CHROME_SCHEME) 2481 boolean enableHidingTopControls = url != null && !url.startsWith(UrlCons tants.CHROME_SCHEME)
2485 && !url.startsWith(UrlConstants.CHROME_NATIVE_SCHEME); 2482 && !url.startsWith(UrlConstants.CHROME_NATIVE_SCHEME);
2486 2483
2487 int securityState = getSecurityLevel(); 2484 int securityState = getSecurityLevel();
2488 enableHidingTopControls &= (securityState != ConnectionSecurityLevel.SEC URITY_ERROR 2485 enableHidingTopControls &= (securityState != ConnectionSecurityLevel.SEC URITY_ERROR
2489 && securityState != ConnectionSecurityLevel.SECURITY_WARNING); 2486 && securityState != ConnectionSecurityLevel.SECURITY_WARNING);
2490 2487
2491 enableHidingTopControls &= 2488 enableHidingTopControls &=
2492 !AccessibilityUtil.isAccessibilityEnabled(getApplicationContext( )); 2489 !AccessibilityUtil.isAccessibilityEnabled(getApplicationContext( ));
2493 enableHidingTopControls &= !mIsImeShowing; 2490 enableHidingTopControls &= !mContentViewCore.isFocusedNodeEditable();
2494 enableHidingTopControls &= !mIsShowingErrorPage; 2491 enableHidingTopControls &= !mIsShowingErrorPage;
2495 enableHidingTopControls &= !webContents.isShowingInterstitialPage(); 2492 enableHidingTopControls &= !webContents.isShowingInterstitialPage();
2496 enableHidingTopControls &= (mFullscreenManager != null); 2493 enableHidingTopControls &= (mFullscreenManager != null);
2497 2494
2498 return enableHidingTopControls; 2495 return enableHidingTopControls;
2499 } 2496 }
2500 2497
2501 /** 2498 /**
2502 * Performs any subclass-specific tasks when the Tab crashes. 2499 * Performs any subclass-specific tasks when the Tab crashes.
2503 */ 2500 */
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
2804 private native void nativeAttachToTabContentManager(long nativeTabAndroid, 2801 private native void nativeAttachToTabContentManager(long nativeTabAndroid,
2805 TabContentManager tabContentManager); 2802 TabContentManager tabContentManager);
2806 private native void nativeAttachOverlayContentViewCore(long nativeTabAndroid , 2803 private native void nativeAttachOverlayContentViewCore(long nativeTabAndroid ,
2807 ContentViewCore content, boolean visible); 2804 ContentViewCore content, boolean visible);
2808 private native void nativeDetachOverlayContentViewCore(long nativeTabAndroid , 2805 private native void nativeDetachOverlayContentViewCore(long nativeTabAndroid ,
2809 ContentViewCore content); 2806 ContentViewCore content);
2810 private native boolean nativeHasPrerenderedUrl(long nativeTabAndroid, String url); 2807 private native boolean nativeHasPrerenderedUrl(long nativeTabAndroid, String url);
2811 2808
2812 private static native void nativeRecordStartupToCommitUma(); 2809 private static native void nativeRecordStartupToCommitUma();
2813 } 2810 }
OLDNEW
« no previous file with comments | « no previous file | chrome/android/javatests/src/org/chromium/chrome/browser/fullscreen/FullscreenManagerTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698