@Override public void setActiveTab(final Tab tab) { mHandler.removeMessages(MSG_HIDE_TITLEBAR); if ((tab != mActiveTab) && (mActiveTab != null)) { removeTabFromContentView(mActiveTab); WebView web = mActiveTab.getWebView(); if (web != null) { web.setOnTouchListener(null); } } mActiveTab = tab; WebView web = mActiveTab.getWebView(); updateUrlBarAutoShowManagerTarget(); attachTabToContentView(tab); setShouldShowErrorConsole(tab, mUiController.shouldShowErrorConsole()); onTabDataChanged(tab); onProgressChanged(tab); mNavigationBar.setIncognitoMode(tab.isPrivateBrowsingEnabled()); updateAutoLogin(tab, false); if (web != null && web.getVisibleTitleHeight() != mTitleBar.getEmbeddedHeight() && !mUseQuickControls) { showTitleBarForDuration(); } }